mirror of
https://github.com/0intro/wmii
synced 2024-11-29 17:13:11 +03:00
simplified items function
This commit is contained in:
parent
62686ec717
commit
aa2e2bb703
@ -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:
|
||||
|
@ -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.
|
||||
|
@ -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=()
|
||||
|
12
rc/wmiirc
12
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
|
||||
} &
|
||||
|
Loading…
Reference in New Issue
Block a user