commit aa2e2bb7030979fcf0367c2168d79efd20019c25
parent 62686ec717f8917a907f1f076d9d3778821bc5d9
Author: Georg Neis <gn@wmii.de>
Date: Sat, 18 Feb 2006 23:35:43 +0200
simplified items function
Diffstat:
4 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/cmd/wm/wmii b/cmd/wm/wmii
@@ -9,8 +9,8 @@ if(! wmiiwm -c) {
exit 1 # wmiiwm is already running or $DISPLAY is unset
}
-OLD_PATH=$PATH
-PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:9PREFIX/bin:$PATH
+old_path=$path
+path=($HOME/.wmii-3 CONFPREFIX/wmii-3 9PREFIX/bin $path)
WMII_ADDRESS=unix!/tmp/ns.$USER.$DISPLAY/wmii
# start window manager and utilities:
diff --git a/cmd/wm/wmii.1 b/cmd/wm/wmii.1
@@ -65,13 +65,13 @@ The following variables are set and exported within
.BR wmii (1)
and thus can be used in actions.
.TP
-OLD_PATH
-PATH as it was before
+old_path
+path as it was before
.BR wmii (1)
added the local and global action directory and the location where the 9base
tools reside. The
.B wmiire
-action resets PATH and removes OLD_PATH before executing a command.
+action resets path and removes old_path before executing a command.
.TP
WMII_CONFDIR
Global action directory.
diff --git a/rc/extern b/rc/extern
@@ -1,8 +1,8 @@
#!9PREFIX/bin/rc
# clean the environment and execute the given command
-PATH=$OLD_PATH
-OLD_PATH=()
+path=$old_path
+old_path=()
wmiircpid=()
apid=()
cmd=()
diff --git a/rc/wmiirc b/rc/wmiirc
@@ -87,15 +87,9 @@ xwrite /bar/expand 2
nl='
'
fn items {
- ifs=:$nl { dirs=`{echo $1} }
- {
- for(dir in $dirs)
- for(file in $dir/*)
- if(! ~ $file $dir^'/*' && ! test -d $file && test -x $file)
- echo `{basename $file}
- } | sort | uniq
+ ls -lpQ $* | awk '!/^d/ && $1 ~ /x/ {print $NF}' | sort | uniq
}
-items $OLD_PATH >/tmp/ns.$USER.$DISPLAY/p.menu &
+items $old_path >/tmp/ns.$USER.$DISPLAY/p.menu &
# MISC
xsetroot -solid '#0b1014'
@@ -147,7 +141,7 @@ while(event=`{read}) {
} &
case $MODKEY-Control-a
{
- cmd=`{items CONFPREFIX/wmii-3:$HOME/.wmii-3 | wmiimenu}
+ cmd=`{items CONFPREFIX/wmii-3 $HOME/.wmii-3 | wmiimenu}
if(! ~ $#cmd 0)
$cmd
} &