diff options
Diffstat (limited to '.wmii/include.sh')
-rw-r--r-- | .wmii/include.sh | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/.wmii/include.sh b/.wmii/include.sh index 29d4d67..b1ec901 100644 --- a/.wmii/include.sh +++ b/.wmii/include.sh @@ -7,20 +7,22 @@ if [ -z "$WMII_DIR" ]; then export WMII_DIR="$HOME/n/wmii" fi -# a -- a work-around for buggy IO append in 9pfuse -# useing '|a' should be just like using '>>', but will work -# when 9pfuse decides to bug out. -a() { - f="${1/#${WMII_DIR}/}" - if [ "$f" = "$1" ]; then - cat >> "$1" - else - if wmiir ls "$f" &>/dev/null; then - wmiir write "$f" - else - wmiir create "$f" - fi - fi +# Linux's 9p kernel module sometimes omits entries in directory listings +unalias ls 2>/dev/null +ls() { + real_ls="`which ls` -1F" + [ $# = 0 ] && set -- "`pwd`" + case $# in + 1) + f="${1/#${WMII_DIR}/}" + if [ "$f" = "$1" ]; then + $real_ls "$f" + else + wmiir ls "$f" + fi + ;; + *) $real_ls "$f";; + esac } # I like wmiir's setsid better than linux-utils' @@ -37,9 +39,8 @@ path_which() { PATH="$mypath" "$which" -- "$prog" 2>/dev/null } - lstags() { - ls $WMII_DIR/tag | sed '/^sel$/d' + ls $WMII_DIR/tag | sed -e 's@/@@' -e '/^sel$/d' } scansection() { @@ -70,6 +71,6 @@ Action() { } connected_to_x_server() { - xdpyinfo &>/dev/null - return $? + xdpyinfo &>/dev/null + return $? } |