all repos — zenUtils @ 02566d04a9c85ebb080ba732fcad6732b4cd2a6a

misc utilities for computing zen

rio.sh: use btn3 like rio; sirius.sh: fix path to socket
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQR2zYvweXfSPsSU6pP1Tg1AaVJx1AUCZXVfcQAKCRD1Tg1AaVJx
1GtAAQDW214UvJ9GTBpte7j9KEqss0gqhNBkpmXgnDn8hFCOJAEA797lFaZ/t2fu
3LLCqFxLE4XIVjZSx2os/tYSsYIonAw=
=hCyf
-----END PGP SIGNATURE-----
commit

02566d04a9c85ebb080ba732fcad6732b4cd2a6a

parent

000dfce9fc7c93582c472ab1533b1b494b8876f5

3 files changed, 33 insertions(+), 16 deletions(-)

jump to
M README.mdREADME.md

@@ -40,7 +40,7 @@ Breakdown weekly data from `zeit` into by-day/by-project buckets for easy transferral to daptiv

### riosh -Shell script to loosley emulate `rio` behavior in a EWMH-compliant WM +Shell script to loosley emulate `rio` behavior in a EWMH-compliant WM; requires `wmctrl`, `slop`, `xdotool`, and `xmodmap` ### desks
M rio.shrio.sh

@@ -1,10 +1,6 @@

#!/bin/sh -# use slop and wmctrl to emulate rio behavior in an EWMH compliant WM -# Derek Stevens <nilix@nilfm.cc> -# MIT License - -termcmd="alacritty --option geometry=" +termprog="st" movebind="super+v" delete()

@@ -17,22 +13,20 @@ {

geom=$(slop -t 0 -f %x,%y,%w,%h) x=$(echo $geom | awk -F , '{print $1}') y=$(echo $geom | awk -F , '{print $2}') - - wl=$(mktemp .windowlistXXX) - wmctrl -l >> $wl + wmctrl -l > ~/.wl - ${termcmd}80x24+${x}+${y}& + $termprog -g 80x24+${x}+${y}& while true; do lastCreatedID=$(wmctrl -l | tail -n 1 | awk '{print $1}') - if [ "$lastCreatedID" != "$(tail -n 1 $wl | awk '{print $1}')" ]; then + if [ "$lastCreatedID" != "$(tail -n 1 ~/.wl | awk '{print $1}')" ]; then break fi done wmctrl -i -r $lastCreatedID -e 0,$geom - rm $wl + rm ~/.wl } resize()

@@ -56,6 +50,10 @@ wid=$(slop -t 9999999 -f %i)

wmctrl -i -r $wid -b add,hidden } + +# swap mouse buttons so we can use right button like in rio +xmodmap -e 'pointer = 3 2 1' + case $1 in delete) delete;;

@@ -68,3 +66,6 @@ move;;

hide) hide;; esac + +# restore original mouse config +xmodmap -e 'pointer = 1 2 3'
M sirius.shsirius.sh

@@ -5,18 +5,31 @@ # Derek Stevens <nilix@nilfm.cc>

# MIT License inbox=~/lib/mail/zoho/INBOX -tarosock=~/src/taro/taro.sock +tarosock=~/lib/taro/taro.sock if [ "$1" = "-s" ]; then oldnew=$(\ls -1 ${inbox}/new | wc -l) - msg="syncing." + dots=" " mbsync -a & while pgrep mbsync; do - notify-send -c mail 'mail' "[${msg}]" + case $dots in + "...") + dots=" ..";; + " ..") + dots=" .";; + " .") + dots=" ";; + " ") + dots=". ";; + ". ") + dots=".. ";; + ".. ") + dots="...";; + esac + notify-send -c mail 'mail' "[syncing${dots}]" sleep 1 - msg=${msg}. done newnew=$(\ls -1 ${inbox}/new | wc -l)

@@ -24,6 +37,7 @@ if [ ${newnew} -gt ${oldnew} ]; then

notify-send -c mail 'new mail' "[${newnew}]" if [ -S ${tarosock} ]; then printf "0" | socat UNIX-CONNECT:${tarosock} - + echo "pushed to socket" fi else notify-send -c mail 'mail' "[sync complete]"

@@ -39,9 +53,11 @@ if [ ${newnew} -gt ${oldnew} ]; then

notify-send -c mail 'new mail' "[${newnew}]" if [ -S ${tarosock} ]; then printf "0" | socat UNIX-CONNECT:${tarosock} - + echo "pushed to socket" fi fi oldnew=${newnew} sleep 5m + echo "slept 5m" done fi