Openbox:Pipemenus:recentfilesxbel

From Openbox

Revision as of 08:17, 20 November 2009 by Davidbarr (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#!/bin/sh
echo "<openbox_pipe_menu>"
files=$(
cat ~/.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 ~/.recently-used.xbel</command></action>
	</item>"
echo "</openbox_pipe_menu>"

Personal tools