hlfw.ca

hwwm

Download patch

ref: f6071e0f0b03a6f48e11a5cb1e5a342e2e7215bd
parent: 2d792860ba40d18d3819a46af9baa72d94efe951
author: Halfwit <michaelmisch1985@gmail.com>
date: Fri Mar 17 15:56:30 PDT 2017

Finishing up makefile, config and the rest

--- a/README.md
+++ b/README.md
@@ -3,7 +3,8 @@
 
 ## Installation
 Requires watom, wmgroup, wmutils
-Copy files into $XDG_DATA_HOME/x11/
+PREFIX=myprefix make install
+
 Modify autotag, watcher, and most likely the groups script to match your setup. The inotifybar is very specific to my system, but serves as an interesting example of what is possible, with the various \*bar scripts being ran on hooks or at the ends of scripts only, such that polling doesn't take too much CPU time. 
 
 
@@ -10,7 +11,18 @@
 ## Configuration
 This presumes $XDG_CONFIG_HOME/x11 exists, with the following files: 
 
-Size 
+tags
+```sh
+
+# name autofocus group
+mpv false 1
+firefox true 2
+vim true 3
+irc true 4
+zathura true 5
+``` 
+
+size 
 ```sh
 width=1363
 height=751
--- a/autotag
+++ b/autotag
@@ -1,29 +1,13 @@
 #!/bin/sh
 
-getname() {
-  cd "$XDG_CONFIG_HOME"/x11/windows || exit 1
-  for i in *; do
-    watom "$1" WM_NAME  | grep -io "$i" 2>/dev/null && break
-    watom "$1" WM_CLASS | grep -io "$i" 2>/dev/null && break
-  done
-}
+WIN=$XDG_CONFIG_HOME/x11/tags
 
-# See if already exists
-case "`getname $1`" in
-  mpv*)        grp=1 ;;
-  browse*)     wtf "$1" && grp=2 ;;
-  vimb*)       wrs 450 100 "$1"  
-			   wtf "$1" && grp=2 ;;
-  edit*)       wtf "$1" && grp=3 ;;
-  mutt*|news*) wtf "$1" && grp=4 ;;
-  irc*)        wtf "$1" && grp=5 ;;
-  *docs*)      wtf "$1" && grp=6 ;;
-  zathura*)    wtf "$1" && grp=6 ;;
-esac
-
+focus="`awk -v r="$(watom "$1" WM_NAME)" -v s="$(watom $1 WM_CLASS)" '$0 ~  r || $0 ~ s {print $2}' "$WIN"`"
+test focus = true && wtf "$focus"
+group="`awk -v r="$(watom "$1" WM_NAME)" -v s="$(watom $1 WM_CLASS)" '$0 ~ r || $0 ~ s {print $3}' "$WIN"`"
 chwso -r "$1"
 
-if [ $grp ]; then
-  grp "$grp" "$1"
-  "$XDG_DATA_HOME"/x11/groupsbar
+if [ $group ]; then
+	grp "$group" "$1"
+	"$XDG_DATA_HOME"/x11/groupsbar
 fi
--- a/wshuf
+++ b/wshuf
@@ -1,5 +1,7 @@
 #!/bin/sh
 # Requires https://github.com/wmutils
+#          https://github.com/halfwit/wmgroup
+#          https://github.com/halfwit/watom
 
 # directory of files that correlate to window names
 WIN="$XDG_CONFIG_HOME"/x11/window