dotfiles

custom linux config files managed with gnu stow

dotfiles

wmutils/bin/wm


#!/bin/sh
#                                  ██   ██  ██        
#                                 ░██  ░░  ░██        
# ███     ██ ██████████  ██   ██ ██████ ██ ░██  ██████
#░░██  █ ░██░░██░░██░░██░██  ░██░░░██░ ░██ ░██ ██░░░░ 
# ░██ ███░██ ░██ ░██ ░██░██  ░██  ░██  ░██ ░██░░█████ 
# ░████░████ ░██ ░██ ░██░██  ░██  ░██  ░██ ░██ ░░░░░██
# ███░ ░░░██ ███ ░██ ░██░░██████  ░░██ ░██ ███ ██████ 
#░░░    ░░░ ░░░  ░░  ░░  ░░░░░░    ░░  ░░ ░░░ ░░░░░░  


wmutilsdir="/tmp/wmutils"
mkdir -p "$wmutilsdir/window"
cat "/dev/null" > "$wmutilsdir/window/active"

~/bin/tray &
~/bin/clock &
~/bin/wgrp -m &
~/bin/bar 'wgrp -b' &
~/bin/pulse &

wew | while IFS=: read ev wid; do
    wattr o $wid && continue
    case $ev in
        # enter/leave
        7)
          echo "$(wname "$wid")" > "$wmutilsdir/window/active"
        ;;
        # create
        16)
          echo "$(wname "$wid")" > "$wmutilsdir/window/active"
        ;;
        # close
        18)
          ~/bin/focus.sh prev 2>/dev/null
          ~/bin/wgrp -R $wid  2>/dev/null
          echo "$(wname `pfw`)" > "$wmutilsdir/window/active"
        ;;
        # window map 
        19)
          echo "$(wname "$wid")" > "$wmutilsdir/window/active"
          ~/bin/focus.sh $wid
        ;;
    esac
done

Download

raw zip tar