diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-10-15 18:59:31 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-10-15 20:22:27 -0400 |
commit | b18a02654e2c8b4a91f7c97352b75464e24c6edb (patch) | |
tree | c25981c27e6c31b47406bb138c219491cac65a88 /.wmii/config.sh | |
parent | 198455ac623054f46b4da3fec040fb7cb0494ce1 (diff) |
wmii: redo the mount/unmount and quit code
Diffstat (limited to '.wmii/config.sh')
-rw-r--r-- | .wmii/config.sh | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/.wmii/config.sh b/.wmii/config.sh index 58217fa..4c2da38 100644 --- a/.wmii/config.sh +++ b/.wmii/config.sh @@ -28,9 +28,8 @@ Event() { ## Custom (non-WMII-generated) events WmiircStart) ## No args echo ' ==> Starting wmiirc' - 9umount "$WMII_DIR" &>/dev/null # just in case - mkdir -p "$WMII_DIR" - 9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR" + is_mounted $WMII_DIR && Event WmiircUnmount + Event WmiircMount # Configure wmii < "`conffile tagrules`" expand_variables >> $WMII_DIR/tagrules @@ -54,15 +53,24 @@ Event() { Action autostart 2>/dev/null & ;; WmiircQuit) ## No args - Event Quit;; - ## WMII-meta events - Quit) ## No args echo ' ==> Stopping wmiirc' - echo " -> unmounting WMII_DIR=$WMII_DIR..." - 9umount "$WMII_DIR" - echo " -> rmdir'ing WMII_DIR=$WMII_DIR..." - rmdir "$WMII_DIR" exit;; + WmiircMount) ## No args + echo " -> Creating mountpoint WMII_DIR=$WMII_DIR..." + mkdir -p "$WMII_DIR" + echo " -> Mounting WMII_DIR=$WMII_DIR..." + 9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR";; + WmiircUnmount) ## No args + echo " -> Unmounting WMII_DIR=$WMII_DIR..." + 9umount "$WMII_DIR" + echo " -> Removing mountpoint WMII_DIR=$WMII_DIR..." + rmdir "$WMII_DIR";; + ## WMII-meta events + Quit) ## No args + echo ' ==> wmii quit: unmounting' + trap - EXIT + Event WmiircUnmount + Event WmiircQuit;; Warning) ## $@=string notify-send "wmii warning: $*";; Key) ## $1=keystroke |