hlfw.ca

hwwm

Download patch

ref: 7ff234aaca861b4f04be8324223737d8a76c7524
parent: a7e98f81daba727890aeb739375d9e1cd04df0c5
author: halfwit <michaelmisch1985@gmail.com>
date: Fri Feb 1 16:14:43 PST 2019

Small changes to get things working properly

--- a/focus
+++ b/focus
@@ -35,5 +35,4 @@
 	focus=$id
 	distance=$here
 	echo "$id"
-done | tail -n 1 | xargs wtf
-
+done | tail -n 1 | xargs wtf
\ No newline at end of file
--- a/hwwm
+++ b/hwwm
@@ -5,8 +5,6 @@
 # Update the database
 xrdb -merge "$XDG_CONFIG_HOME"/x11/Xresources
 
-# Set background image
-hsetroot -solid $(xrdb -query | awk '/desktop/{print $NF}')
 
 # Key watcher
 sxhkd -m -1 &
@@ -16,18 +14,22 @@
 inotifybar &
 
 # Colors
-highlight="$(xrdb -query | awk '/color12/{print $NF}' | sed 's/#//')"
+highlight="$(xrdb -query | awk '/color4/{print $NF}' | sed 's/#//')"
+background="$(xrdb -query | awk '/background/{print $NF}' | sed 's/#//')"
+normal="$(xrdb -query | awk '/color7/{print $NF}' | sed 's/#//')"
 
-normal="$(xrdb -query | awk '/color4/{print $NF}' | sed 's/#//')"
-
 FOCUS_MASK=2097152
 wew -m $FOCUS_MASK | while read -r ev; do
 	wid=`echo "$ev" | sed 's/.*://'`
 	# Short circuit on statusbar, some other types
-	xprop -id $wid | grep -q -e TRANSIENT -e TYPE_MENU -e TYPE_DOCK -e drawterm && continue
+	xprop -id $wid | grep -q -e TRANSIENT -e TYPE_MENU -e TYPE_DOCK && continue
 	fullscreen="$(watom `lsw -r` FS 2>/dev/null)"
 	case "$ev" in
-	# Unmap
+	# Focus in
+	9*)	chwb -s 2 -c "$highlight" "$wid" ;;
+	# Focus out
+	10*)	chwb -s 2 -c "$normal" "$wid" ;; 
+# Unmap
 	18*)	if test -z $fullscreen; then 
 			$DIR/wshuf | xargs -n 5 wtp
 		fi