1
0
Fork 0
mirror of https://gitlab.com/dwt1/dotfiles.git synced 2023-02-13 20:55:19 -05:00
dwt1--dotfiles/.jwm/menus/recent-files.sh

13 lines
366 B
Bash
Raw Normal View History

2019-01-15 16:27:01 -05:00
#!/bin/sh
XBEL_PATH=/home/dt/.local/share/recently-used.xbel
MAX_ITEMS=20
if [[ -e $XBEL_PATH ]];then
ITEMS=$(sed -rn 's_.*file://([^"]*).*_<Program label="\1">rox -s "\1"</Program>_ p' "$XBEL_PATH")
else
ITEMS="<Program label=\"File ${XBEL_PATH##*/} not found!\"></Program>"
fi
echo "<JWM>"
echo -e "${ITEMS//%/\\x}" | tail -n $MAX_ITEMS
echo "</JWM>"