Openbox:Pipemenus:recentfilesxbel

From Openbox

(Difference between revisions)
Jump to: navigation, search
(New page: <pre> #!/bin/sh echo "<openbox_pipe_menu>" files=$( cat ~/.recently-used.xbel | grep file:/// | tail -n15 | cut -d "\"" -f 2 | while read line; do file=$(echo "$line") name=$(echo -en...)
 
 
Line 3: Line 3:
 
echo "<openbox_pipe_menu>"
 
echo "<openbox_pipe_menu>"
 
files=$(
 
files=$(
cat ~/.recently-used.xbel | grep file:///  | tail -n15 |  cut -d "\"" -f 2 | while read line;  
+
cat ~/.recently-used.xbel | grep file:///  | tail -n15 |  cut -d "\"" -f 2 | tac | while read line;  
 
do   
 
do   
 
file=$(echo "$line")
 
file=$(echo "$line")

Latest revision as of 08:17, 20 November 2009

#!/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