summaryrefslogtreecommitdiff
path: root/.config/wmii-hg
diff options
context:
space:
mode:
Diffstat (limited to '.config/wmii-hg')
-rwxr-xr-x.config/wmii-hg/autostart14
-rw-r--r--.config/wmii-hg/include.sh71
-rwxr-xr-x.config/wmii-hg/quit4
-rwxr-xr-x.config/wmii-hg/rbar_battery7
-rwxr-xr-x.config/wmii-hg/rbar_clock7
-rwxr-xr-x.config/wmii-hg/rbar_cpu9
-rwxr-xr-x.config/wmii-hg/rbar_wifi7
7 files changed, 87 insertions, 32 deletions
diff --git a/.config/wmii-hg/autostart b/.config/wmii-hg/autostart
index 9c47a9d..aae23f4 100755
--- a/.config/wmii-hg/autostart
+++ b/.config/wmii-hg/autostart
@@ -1,12 +1,4 @@
#!/bin/bash
-. include.sh
-
-daemon xcompmgr &> /dev/null
-daemon lxpanel &> /dev/null
-daemon nm-applet &> /dev/null
-daemon dunst &> /dev/null
-
-#Action rbar_cpu 01 &
-#Action rbar_wifi 97 &
-#Action rbar_battery 98 &
-Action rbar_clock 99 &
+daemon lxpanel &> /dev/null
+daemon wicd-client -t &> /dev/null
+daemon notifyd &> /dev/null
diff --git a/.config/wmii-hg/include.sh b/.config/wmii-hg/include.sh
index bd9456f..36f8f3e 100644
--- a/.config/wmii-hg/include.sh
+++ b/.config/wmii-hg/include.sh
@@ -1,11 +1,70 @@
#!/bin/bash
-if [[ -z "$WMII_NAMESPACE" ]]; then
- export WMII_NAMESPACE="`wmiir namespace`"
+if [ -z "$WMII_NAMESPACE" ]; then
+ export WMII_NAMESPACE=`wmiir namespace`
fi
-if [[ -z "$WMII_DIR" ]]; then
- export WMII_DIR="$HOME/n/wmii${DISPLAY}"
+if [ -z "$WMII_DIR" ]; then
+ export WMII_DIR=$WMII_NAMESPACE/mnt
fi
-. util.sh
-. config.sh
+# 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
+}
+
+# I like wmiir's setsid better than linux-utils'
+setsid() { wmiir setsid "$@"; }
+
+path_ls() {
+ find -L `echo "$@"|sed 'y/:/ /'` -maxdepth 1 -type f -executable -printf '%f\n' 2>/dev/null| sort -u
+}
+
+path_which() {
+ mypath=$1
+ prog=$2
+ which=`which which`
+ PATH="$mypath" "$which" -- "$prog" 2>/dev/null
+}
+
+
+lstags() {
+ ls $WMII_DIR/tag | sed '/^sel$/d'
+}
+
+scansection() {
+ file=`path_which "$WMII_CONFPATH" wmiirc`
+ sec=$1
+ tmp=`mktemp`
+ if [ -n "$sec" ]; then
+ < "$file" sed -n "/^\s*$sec\s*()/,/##\s*End $sec/p" | sed '1d;$d'> $tmp
+ else
+ < "$file" sed "/\s*}\s*##\s*End\s/d" > $tmp
+ fi
+ < $tmp sed -n '/##/p'|sed -r 's/^\s*(.*)\)\s*## ?/\t\1\t/;s/\s*## ?//'
+ rm $tmp
+}
+
+conffile() {
+ echo "$HOME/.wmii/$@"
+}
+
+Action() {
+ prog=`path_which "$WMII_CONFPATH" $1`; shift
+ if [ -n "$prog" ]; then
+ "$prog" "$@"
+ return $?
+ else
+ return 1
+ fi
+}
diff --git a/.config/wmii-hg/quit b/.config/wmii-hg/quit
index 27d9052..54f64e7 100755
--- a/.config/wmii-hg/quit
+++ b/.config/wmii-hg/quit
@@ -1,3 +1,3 @@
#!/bin/bash
-. include.sh
-echo quit >> $WMII_DIR/ctl
+. "$HOME/.wmii/include.sh"
+echo quit |a $WMII_DIR/ctl
diff --git a/.config/wmii-hg/rbar_battery b/.config/wmii-hg/rbar_battery
index f632f7e..7a7f24f 100755
--- a/.config/wmii-hg/rbar_battery
+++ b/.config/wmii-hg/rbar_battery
@@ -1,9 +1,10 @@
#!/bin/bash
-. include.sh
+. "$HOME/.wmii/include.sh"
priority=$1
-while connected_to_x_server; do
- printf 'label %s\n' "$(acpi -b)" >> "$WMII_DIR/rbar/${priority}_battery"
+set -e
+while true; do
+ acpi -b |a "$WMII_DIR/rbar/${priority}_battery"
sleep 1
done
diff --git a/.config/wmii-hg/rbar_clock b/.config/wmii-hg/rbar_clock
index 6aecb92..8e7d2a4 100755
--- a/.config/wmii-hg/rbar_clock
+++ b/.config/wmii-hg/rbar_clock
@@ -1,9 +1,10 @@
#!/bin/bash
-. include.sh
+. "$HOME/.wmii/include.sh"
priority=$1
-while connected_to_x_server; do
- printf 'label %s\n' "$(date)" >> "$WMII_DIR/rbar/${priority}_clock"
+set -e
+while true; do
+ date |a "$WMII_DIR/rbar/${priority}_clock"
sleep .5
done
diff --git a/.config/wmii-hg/rbar_cpu b/.config/wmii-hg/rbar_cpu
index 5531e60..7f891da 100755
--- a/.config/wmii-hg/rbar_cpu
+++ b/.config/wmii-hg/rbar_cpu
@@ -1,12 +1,13 @@
#!/bin/bash
-. include.sh
+. "$HOME/.wmii/include.sh"
priority=$1
-while connected_to_x_server; do
+set -e
+while true; do
# This doesn't work for me, it shows capacity
- #echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') >> "$WMII_DIR/rbar/${priority}_cpu"
+ #echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') |a "$WMII_DIR/rbar/${priority}_cpu"
# This actually displays %idle
- echo 'label CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]' >> "$WMII_DIR/rbar/${priority}_cpu"
+ echo 'CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]' |a "$WMII_DIR/rbar/${priority}_cpu"
sleep 1
done
diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi
index 18395a3..608b164 100755
--- a/.config/wmii-hg/rbar_wifi
+++ b/.config/wmii-hg/rbar_wifi
@@ -1,9 +1,10 @@
#!/bin/bash
-. include.sh
+. "$HOME/.wmii/include.sh"
priority=$1
-while connected_to_x_server; do
- echo 'label Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) >> "$WMII_DIR/rbar/${priority}_wifi"
+set -e
+while true; do
+ echo 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) |a "$WMII_DIR/rbar/${priority}_wifi"
sleep 1
done