rio.sh: use btn3 like rio; sirius.sh: fix path to socket
This commit is contained in:
parent
000dfce9fc
commit
02566d04a9
3 changed files with 33 additions and 16 deletions
|
@ -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
23
rio.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()
|
||||
|
@ -18,21 +14,19 @@ new()
|
|||
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'
|
||||
|
|
24
sirius.sh
24
sirius.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue