You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.1 KiB
65 lines
1.1 KiB
#!/bin/sh |
|
|
|
# Not a true screensaver, but a fun thing to be run at idle. |
|
|
|
COLOR=blue |
|
FONT=MesloLGS\ NF:size= |
|
INTERVAL=0.5 |
|
|
|
moveright () { |
|
# move a window right one workspace |
|
echo "key super+shift+right" | dotool |
|
} |
|
mouseright () { |
|
# move mouse one monitor right (ish) |
|
echo "mousemove 1300 0" | dotool |
|
} |
|
mouseleft () { |
|
# move mouse one monitor left (ish) |
|
echo "mousemove -1300 0" | dotool |
|
} |
|
matrixterm () { |
|
# spawn terminal with fun matrix in it |
|
# $1 = the size of font |
|
xterm -fullscreen -bg black -fa "${FONT}$1" -e "cmatrix -abC$COLOR" & |
|
} |
|
|
|
openonall () { |
|
# Open $1 on all monitors |
|
$1 14 |
|
moveright |
|
mouseright |
|
moveright |
|
mouseleft |
|
$1 9 |
|
moveright |
|
$1 12 |
|
} |
|
|
|
echo "mouseto 0.3 0.5" | dotool |
|
|
|
openonall matrixterm |
|
|
|
XTERMS=$(ps -ef | grep xterm | grep -v 'grep' | awk '{print $2}') |
|
|
|
isrunning () { |
|
# $1 = process to check |
|
ps -p $1 >/dev/null |
|
} |
|
|
|
checkallprocs () { |
|
for proc in $* |
|
do |
|
isrunning $proc || return 1 |
|
done |
|
} |
|
|
|
while checkallprocs $XTERMS |
|
do |
|
sleep $INTERVAL |
|
done |
|
|
|
for proc in $XTERMS |
|
do |
|
kill -9 $proc 2>/dev/null |
|
done
|
|
|