1
0
Fork 0
mirror of https://gitlab.com/dwt1/dotfiles.git synced 2023-02-13 20:55:19 -05:00
dwt1--dotfiles/.config/openbox/pipemenus/obrecent.sh
2019-01-15 15:27:01 -06:00

22 lines
615 B
Bash
Executable file

From Openbox
Jump to: navigation, search
#!/bin/sh
echo "<openbox_pipe_menu>"
files=$(
cat ~/.local/share/recently-used.xbel | grep file:/// | tail -n15 | cut -d "\"" -f 2 | tac | while read line;
do
file=$(echo "$line")
name=$(echo -en "$file" | sed 's,.*/,,' | sed 's/%20/ /g')
echo "<item label=\"$name\">
<action name=\"Execute\"><command>xdg-open $line</command></action>
</item>"
done);
echo "$files"
echo "<separator />"
echo "<item label=\"Clear Recent Documents\">
<action name=\"Execute\"><command>rm ~/.local/share/recently-used.xbel</command></action>
</item>"
echo "</openbox_pipe_menu>"