wok-6.x diff openbox/stuff/open-folder-menu.sh @ rev 15214

nbd: add config file
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 13 12:30:04 2013 +0000 (2013-09-13)
parents 372dd84badab
children 7309fd1536fe
line diff
     1.1 --- a/openbox/stuff/open-folder-menu.sh	Tue Jun 18 15:32:37 2013 +0200
     1.2 +++ b/openbox/stuff/open-folder-menu.sh	Fri Sep 13 12:30:04 2013 +0000
     1.3 @@ -1,29 +1,23 @@
     1.4  #!/bin/sh
     1.5  #
     1.6 -# Openbox pipe menu to launch SpaceFM using GTK bookmarks.
     1.7 +# Openbox pipe menu to launch file-manager using GTK bookmarks.
     1.8  #
     1.9 -
    1.10  echo '<openbox_pipe_menu>'
    1.11  
    1.12 -# Home
    1.13 -echo '<item label="Home">'
    1.14 -echo '<action name="Execute"><execute>'
    1.15 -echo "spacefm ~"
    1.16 -echo '</execute></action></item>'
    1.17 +bookmarks="~ $(whoami)
    1.18 +~/Desktop $(gettext gtk20 Desktop)
    1.19 +$(cat ~/.gtk-bookmarks)"
    1.20  
    1.21 -# ~/Desktop
    1.22 -echo '<item label="Desktop">'
    1.23 -echo '<action name="Execute"><execute>'
    1.24 -echo "spacefm ~/Desktop"
    1.25 -echo '</execute></action></item>'
    1.26 -
    1.27 -# GTK bookmarks
    1.28 -for dir in `sed 's/[ ][^ ]*$//' .gtk-bookmarks`
    1.29 -do
    1.30 -	echo '<item label="'`basename $dir`'">'
    1.31 -	echo '<action name="Execute"><execute>'
    1.32 -	echo "spacefm $dir"
    1.33 -	echo '</execute></action></item>'
    1.34 +IFS='
    1.35 +'
    1.36 +for dir in $bookmarks; do
    1.37 +	cat << EOT
    1.38 +	<item label="$(echo $dir | sed 's|^[^ ]* ||')">
    1.39 +		<action name="Execute">
    1.40 +			<execute>file-manager $(echo $dir | awk '{print $1}')</execute>
    1.41 +		</action>
    1.42 +	</item>
    1.43 +EOT
    1.44  done
    1.45  
    1.46  echo '</openbox_pipe_menu>'