#!/bin/bash # # Dzen2 App Launcher script box version by Rasmus Edgar. # -tw = Width of titlebar, -w = Width of slavewindow, # -l = length of slavewindow. Remember to adjust -l accordingly when adding # apps. ^pa(*) is for text/decoration alignment. # # The getcurpos(x+y) programs are minor hacks of Robert Manea's getcurpos available # on his website. The only thing that is changed in the source code is the removal of # one of the "%d" and e.xbutton.*'s. # # Menu script starts below. # # Needed Applications: MENUFILE=~/.menuxy if [ $1 ]; then test -e $1 && MENUFILE=$1 fi # Get cursor position: XP=$(getcurpos | cut -c1-4) YP=$(getcurpos | cut -c5-10) # Decorations for the menu: DC1=1x17 DC2=3x2 DC3=4x2 DC4=3x1 DC5=123x10 DC6=125x17 # Font: FONT="-*-dina-medium-r-*-*-15-*-*-*-*-*-iso8859-1" # Menu Title TI="Dzen Menu" # Colors: FG1=#9ab8c2 FG2=#f57900 FG3=#D9A509 BG1=#43464f LINES=`wc -l $MENUFILE | awk '{ print $1 }'` let LINES++ # Text piped to Dzen2 function menu { echo "^ro(${DC6})^ib(1)^pa(30)$TI" echo -e "^fg(${FG1})" while read LINE do PRG=`echo $LINE | awk -F , '{ print $1 }'` IC=`echo $LINE | awk -F , '{ print $2 }'` ICON=`eval echo $IC` echo -e "^r(${DC1})^r(${DC2})^r(${DC3}) ^fg(${FG3})^i(${ICON})^fg(${FG1}) ${PRG} ^pa(117)^r(${DC3})^r(${DC2})^r(${DC1})" done < $MENUFILE echo "^ro(${DC6})^ib(1)^pa(2)ver. 0.1" } menu | (dzen2 -y "$YP" -x "$XP" -fn "$FONT" -bg "$BG1" -fg "$FG1" -l $LINES -tw 125 -ta l -w 125 -m -p -e 'onstart=uncollapse;button1=menuexec,exit;leaveslave=exit;button3=exit')