mikshaw


Group: Members
Posts: 4856
Joined: July 2004 |
 |
Posted: Aug. 14 2006,19:23 |
 |
I've been playing with dwm quite a lot the last couple of weeks, and enjoying it much. The dmenu utility (a stripped-down version of wmiimenu) is very cool when mixed with a little scripting.
This is a little script that will list *.uci files using dmenu or wmiimenu (included with wmii.uci), and run mydsl-load on the selected item. If it's already mounted it will be listed with "(M)".
It could easily be extended to use other types of extensions, but since I use *.uci 99.94% of the time I didn't bother =o)
Code Sample | #!/bin/bash
cd $HOME/mydsl/optional #change to location of *.uci files
for i in *.uci; do grep -q "\/$i " /etc/mtab [ "$?" == "0" ] && i="${i}(M)" [ -n "$UCI_LIST" ] && UCI_LIST="$UCI_LIST,$i" || UCI_LIST="$i" #this check might be unnecessary done
UCI_FILE=`echo "$UCI_LIST" | tr ',' '\n' | dmenu` #or wmiimenu [ -n "$UCI_FILE" ] && mydsl-load ${UCI_FILE%(M)}
|
EDIT: updated dwm link. NOTE: dmenu has recently been added to the myDSL repository. The package includes a heavily tweaked (and improved, imo) version of this script.
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|