scripts/gaming-time

54 lines
1.3 KiB
Plaintext
Raw Normal View History

2023-08-23 19:52:23 +02:00
#!/bin/sh
2024-12-25 21:14:35 +01:00
disableCronJobs() {
crontab -l | sed '2 s/./#&/' | crontab
2023-08-23 19:52:23 +02:00
}
2024-12-25 21:14:35 +01:00
enableCronJobs() {
crontab -l | sed '2s/^.//' | crontab
2023-08-23 19:52:23 +02:00
}
2024-12-25 21:14:35 +01:00
wayland_off() {
start-program wbg ~/pics/wallpapers/spooky_spill.jpg
start-program waybar
2023-08-23 19:52:23 +02:00
}
2024-12-25 21:14:35 +01:00
wayland_on() {
kill-nicely wbg
kill-nicely waybar
2023-08-23 19:52:23 +02:00
}
2024-12-25 21:14:35 +01:00
x11_off() {
start-program picom
# start-program polybar top -r
start-program xmobar ~/.config/xmobar/xmobarrc
# start-program unclutter --timeout 5
toggle-xrandr on
sleep 2
start-program trayer --edge top --align right --widthtype request --padding 6 --iconspacing 7 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x303446 --height 24 -l
2023-08-23 19:52:23 +02:00
}
2024-12-25 21:14:35 +01:00
x11_on() {
kill-nicely picom
# kill-nicely polybar
kill-nicely xmobar
kill-nicely trayer
# kill-nicely unclutter
toggle-xrandr off
2023-08-23 19:52:23 +02:00
}
2023-12-10 18:49:23 +01:00
if [ -f "$HOME"/.cache/gaming.lock ]; then
2024-12-25 21:14:35 +01:00
[ "$XDG_SESSION_TYPE" = "wayland" ] && wayland_off || x11_off
# start-program transmission-daemon
start-program syncthing
rm "$HOME"/.cache/gaming.lock
quick-notify "Gaming Time" "OFF"
2023-08-23 19:52:23 +02:00
else
2024-12-25 21:14:35 +01:00
[ "$XDG_SESSION_TYPE" = "wayland" ] && wayland_on || x11_on
# transmission-remote --exit
syncthing cli operations shutdown
kill-nicely ferdium
touch "$HOME"/.cache/gaming.lock
quick-notify "Gaming Time" "ON"
2023-08-23 19:52:23 +02:00
fi