summaryrefslogtreecommitdiff
path: root/bin/menuscripts
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-01-21 23:05:03 +0100
committerRaymaekers Luca <luca@spacehb.net>2025-01-21 23:05:03 +0100
commita5d21a49ccdc6141790085d4bd26b667b8d5618d (patch)
treec952cf834458da4938dfca837abe6323283d2bb8 /bin/menuscripts
parentefcd2b7cdb03a354bd4311bac75953738ec34e4f (diff)
checkpoint
Diffstat (limited to 'bin/menuscripts')
-rwxr-xr-xbin/menuscripts/mpower9
-rwxr-xr-xbin/menuscripts/pomo12
2 files changed, 16 insertions, 5 deletions
diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower
index b4b8640..fb7249d 100755
--- a/bin/menuscripts/mpower
+++ b/bin/menuscripts/mpower
@@ -9,6 +9,15 @@ hibernate
EOF
)"
+if [ "$(hostname)" = "winter" ]; then
+ if [ "$choice" = "firmware" ]; then
+ systemctl reboot --firmware-setup
+ exit
+ fi
+ systemctl "$choice"
+ exit
+fi
+
case "$choice" in
"suspend") doas /usr/sbin/zzz ;;
"poweroff") doas /usr/sbin/poweroff ;;
diff --git a/bin/menuscripts/pomo b/bin/menuscripts/pomo
index 07db166..5b52ebd 100755
--- a/bin/menuscripts/pomo
+++ b/bin/menuscripts/pomo
@@ -1,7 +1,9 @@
#!/bin/sh
-# time in minutes of one pomodoro
+# time in minutes
[ "$SLEEP_TIME" ] || SLEEP_TIME=25
+[ "$BREAK_TIME" ] || BREAK_TIME=5
+[ "$GIGA_BREAK_TIME" ] || GIGA_BREAK_TIME=20
### FUNCTIONS
notif() {
@@ -25,7 +27,7 @@ player_command() {
# $1: time in minutes
# $2: msg for notification
ring_ring() {
- printf >&2 '%s B %s\n' "$(date '+%R')" "$round"
+ printf >&2 '%s %s [%s]\n' "$(date '+%R')" "Break" "$round"
player_command
herbe "pomo" "$2" &
sleep "${1}m"
@@ -62,13 +64,13 @@ done
while true; do
notif "*START"
- printf >&2 '%s S %s\n' "$(date '+%R')" "$round"
+ printf >&2 '%s %s [%s]\n' "$(date '+%R')" "Start" "$round"
sleep "${SLEEP_TIME}m"
if [ "$round" -eq 3 ]; then
- ring_ring 20 "*GIGA BREAK TIME"
+ ring_ring "$GIGA_BREAK_TIME" "*GIGA BREAK TIME"
round=0
else
- ring_ring 5 "*BREAK TIME"
+ ring_ring "$BREAK_TIME" "*BREAK TIME"
round=$((round + 1))
fi
done