rio.sh: use btn3 like rio; sirius.sh: fix path to socket

This commit is contained in:
Iris Lightshard 2023-12-09 23:49:21 -07:00
parent 000dfce9fc
commit 02566d04a9
Signed by: Iris Lightshard
GPG key ID: F54E0D40695271D4
3 changed files with 33 additions and 16 deletions

View file

@ -40,7 +40,7 @@ Breakdown weekly data from `zeit` into by-day/by-project buckets for easy transf
### 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

23
rio.sh
View file

@ -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 @@ new()
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 @@ hide()
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 @@ case $1 in
hide)
hide;;
esac
# restore original mouse config
xmodmap -e 'pointer = 1 2 3'

View file

@ -5,18 +5,31 @@
# 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 [ "$1" = "-s" ]; 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 @@ else
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