Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- IFS=$(echo -en "\n\b")
- DESKTOP=$(xdg-user-dir DESKTOP)
- echo " <openbox_pipe_menu>"
- for FILENAME in `find $DESKTOP -type f -name *.desktop`
- do
- NAME=$(grep '^Name' $FILENAME | head -1 | sed 's/^Name=//' | sed 's/%.//')
- EXEC=$(grep '^Exec' $FILENAME | head -1 | sed 's/^Exec=//' | sed 's/%.//')
- ICON=$(grep '^Icon' $FILENAME | head -1 | sed 's/^Icon=//' | sed 's/%.//')
- # if [ ! -f $ICON ]; then
- # ICON=$(locate $ICON | tail -1)
- # fi
- cat << _menu_
- <item icon="$ICON" label="$NAME">
- <action name="Execute">
- <command>
- $EXEC
- </command>
- </action>
- </item>
- _menu_
- done
- echo " </openbox_pipe_menu>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement