ref: 3885827372c49e428ad82b9405f86b605da972e5
parent: 4092c8180df20032a53f95f2eb078d2cae85070c
parent: 1f2b43b8011836609f5d7ec4598f536e6c509e6f
author: Halfwit <michaelmisch1985@gmail.com>
date: Tue Apr 4 12:48:19 PDT 2017
Merge branch 'master' of https://github.com/halfwit/hwwm
--- a/autotag
+++ b/autotag
@@ -3,9 +3,8 @@
WIN=$XDG_CONFIG_HOME/x11/tags
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"
+test focus = true && wtf "$focus" && chwso "$1"
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 [ $group ]; then
grp "$group" "$1"
--- a/gitbar
+++ b/gitbar
@@ -2,15 +2,30 @@
GITBAR="$XDG_RUNTIME_DIR/statusbar/git"
-commit=`commit wc`
-push=`push wc`
-pull=`pull wc`
+comm=0
+push=0
+pull=0
+
+while IFS="⇄↑↓" read -r input; do
+ case $input in
+ *⇄*) comm=`echo $input | tr -cd [:digit:]` ;;
+ *↑*) push=`echo $input | tr -cd [:digit:]` ;;
+ *↓*) pull=`echo $input | tr -cd [:digit:]` ;;
+ esac
+done < $GITBAR
+
+case $1 in
+ commit) comm=`commit wc` ;;
+ pull) pull=`pull wc` ;;
+ push) push=`push wc` ;;
+esac
+
check=0
-if [ $commit -gt 0 ]; then
- commit="⇄$commit"
+if [ $comm -gt 0 ]; then
+ comm="⇄$comm"
check=1
else
- commit=""
+ comm=""
fi
if [ $push -gt 0 ]; then
@@ -28,7 +43,7 @@
fi
if [ $check -eq 1 ]; then
- printf '%s\n' " [$commit$push$pull]" > "$GITBAR"
+ printf '%s\n' " [$push$pull$comm]" > "$GITBAR"
else
printf '%s\n' "" > "$GITBAR"
fi
--- a/inotifybar
+++ b/inotifybar
@@ -3,6 +3,14 @@
statusdir="$XDG_RUNTIME_DIR/statusbar"
mkdir -pm0700 "$statusdir"
+trap reload USR1
+
+reload() {
+ kill -INT $$
+ battery &
+ barrun
+}
+
battery() {
while :; do
read -r level < /sys/class/power_supply/BAT0/capacity
@@ -24,8 +32,12 @@
battery &
+barrun() {
inotifywait -qme close_write --format %f "$statusdir" | while read -r file; do
if read -r -- "$file" < "$statusdir/$file"; then
printf -- ' %s %%{c} %s %%{r} %s%s%s \n' "$batt" "$groups" "$rss" "$git" "$media"
fi
-done | lemonbar -F '#282828' -d -b -f "DejaVu Book:size=9.5" -f "Symbola:size=9.5" -f "FreeSans:size=9.5"
\ No newline at end of file
+done | lemonbar -F '#282828' -d -b -f "DejaVu Book:size=9.5" -f "Symbola:size=9.5" -f "FreeSans:size=9.5"
+}
+
+barrun
--- a/wshuf
+++ b/wshuf
@@ -9,7 +9,7 @@
winsize() {
while read -r id; do
# Find our command to run in our file, else set it as default
- cmd="`awk -v r="$(watom $id WM_NAME)" -v s="$(watom $id WM_CLASS)" '$0 ~ r || $0 ~ s {$1=""; print}' "$WIN"`"
+ cmd="`awk -v r="$(watom $id WM_NAME | awk '{print $1}')" -v s="$(watom $id WM_CLASS)" '$0 ~ r || $0 ~ s {$1=""; print}' "$WIN"`"
test -z "$cmd" && cmd="`awk '/default/{$1=""; print}' "$WIN"`"
printf '%s %s\n' "`eval "$cmd"`" "$id"
done