diff options
Diffstat (limited to '.config/wmii-hg')
-rw-r--r-- | .config/wmii-hg/config.sh | 8 | ||||
-rw-r--r-- | .config/wmii-hg/include.sh | 4 | ||||
-rwxr-xr-x | .config/wmii-hg/quit | 8 | ||||
-rw-r--r-- | .config/wmii-hg/rbar.sh | 4 | ||||
-rwxr-xr-x | .config/wmii-hg/wmiirc | 4 |
5 files changed, 19 insertions, 9 deletions
diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index ad4d2fe..64596a8 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -66,8 +66,10 @@ Event() { rmdir -p "$WMII_DIR" 2>/dev/null;; ## WMII-meta events Quit) ## No args - echo ' ==> wmii quit: unmounting' trap - EXIT + if [ -S "$NOTIFY_SOCKET" ]; then + echo STOPPING=1 | socat STDIO UNIX-SENDTO:"$NOTIFY_SOCKET" + fi Event WmiircUnmount Event WmiircQuit;; Warning) ## $@=string @@ -228,9 +230,9 @@ Key() { $MODKEY-x) ## Open program menu local command command="$(path_ls "$_PATH" | wimenu -h "${HIST}.progs" -n 5000)" || return - ( PATH=$_PATH; unset _PATH; exec $command ) & ;; + ( PATH=$_PATH; unset _PATH NOTIFY_SOCKET; exec $command ) & ;; $MODKEY-Return) ## Launch a terminal - ( PATH=$_PATH; unset _PATH; exec x-terminal-emulator ) & ;; + ( PATH=$_PATH; unset _PATH NOTIFY_SOCKET; exec x-terminal-emulator ) & ;; ## Tag actions $MODKEY-t) ## Change to another tag diff --git a/.config/wmii-hg/include.sh b/.config/wmii-hg/include.sh index bd9456f..f9e3078 100644 --- a/.config/wmii-hg/include.sh +++ b/.config/wmii-hg/include.sh @@ -1,10 +1,10 @@ #!/bin/bash if [[ -z "$WMII_NAMESPACE" ]]; then - export WMII_NAMESPACE="`wmiir namespace`" + export WMII_NAMESPACE="$(wmiir namespace)" fi if [[ -z "$WMII_DIR" ]]; then - export WMII_DIR="$HOME/n/wmii${DISPLAY}" + export WMII_DIR="${XDG_RUNTIME_DIR}/n/wmii${DISPLAY}" fi . util.sh diff --git a/.config/wmii-hg/quit b/.config/wmii-hg/quit index 27d9052..341468e 100755 --- a/.config/wmii-hg/quit +++ b/.config/wmii-hg/quit @@ -1,3 +1,7 @@ #!/bin/bash -. include.sh -echo quit >> $WMII_DIR/ctl +if type systemctl &>/dev/null; then + systemctl --user stop "wmii@$DISPLAY.service" +else + . include.sh + echo quit >> $WMII_DIR/ctl +fi diff --git a/.config/wmii-hg/rbar.sh b/.config/wmii-hg/rbar.sh index 4f6faf1..8bff558 100644 --- a/.config/wmii-hg/rbar.sh +++ b/.config/wmii-hg/rbar.sh @@ -1,10 +1,10 @@ #!/bin/bash setup_trap() { - trap "rm -f -- ${HOME}/n/wmii*/rbar/${1}" EXIT + trap "rm -f -- \"\${XDG_RUNTIME_DIR}\"/n/wmii*/rbar/${1}" EXIT } write() { - dirs=("${HOME}"/n/wmii*/rbar/) + local dirs=("${XDG_RUNTIME_DIR}"/n/wmii*/rbar/) sponge|tee -a "${dirs[@]/%/${1}}" > /dev/null } diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc index 396bed2..6fd348f 100755 --- a/.config/wmii-hg/wmiirc +++ b/.config/wmii-hg/wmiirc @@ -12,6 +12,10 @@ fi wmiir xwrite /event WmiircQuit # close any existing wmiirc's Event WmiircStart +# Notify systemd that we're ready +if [ -S "$NOTIFY_SOCKET" ]; then + echo READY=1 | socat STDIO UNIX-SENDTO:"$NOTIFY_SOCKET" +fi trap "Event Quit" EXIT |