From aa2e2bb7030979fcf0367c2168d79efd20019c25 Mon Sep 17 00:00:00 2001 From: Georg Neis Date: Sat, 18 Feb 2006 23:35:43 +0200 Subject: [PATCH] simplified items function --- cmd/wm/wmii | 4 ++-- cmd/wm/wmii.1 | 6 +++--- rc/extern | 4 ++-- rc/wmiirc | 12 +++--------- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/cmd/wm/wmii b/cmd/wm/wmii index 1a050578..a6509aad 100644 --- 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 index 8621c7c5..c3c1fb3c 100644 --- 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 index 0dd2c4a4..d58e256f 100644 --- 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 index d1eeca3b..be895def 100755 --- 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 } &