diff options
| -rwxr-xr-x | bin/guiscripts/vrec | 2 | ||||
| -rwxr-xr-x | bin/menuscripts/mpower | 26 |
2 files changed, 20 insertions, 8 deletions
diff --git a/bin/guiscripts/vrec b/bin/guiscripts/vrec index d7baecf..4927f8d 100755 --- a/bin/guiscripts/vrec +++ b/bin/guiscripts/vrec @@ -43,6 +43,7 @@ record_cmd() printf '%s\n' "$5/$6.mp4" herbe "vrec" "started recording." # use notification to know when recording started + w=$(($3 + $3 % 2)) h=$(($4 + $4 % 2)) ffmpeg $audio \ @@ -113,7 +114,6 @@ case "$option" in pid="$(pgrep ffmpeg | xargs ps | grep 'x11grab' | awk '{print $1}')" [ "$pid" ] && kill -TERM $pid rm -f "$lock" - herbe "vrec" "stopped recording." & ;; last) file="$(find "$dir" -type f -iname '*.mp4' -printf '%Ts %p\n' | sort -n -r | head -n 1 | cut -f 2- -d' ')" diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index d96e09a..4c5d5e5 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -5,31 +5,43 @@ then choice="$1" else choice="$( - cat <<EOF | commander -c -w 1 -y 8 + cat <<EOF | commander -c -w 1 -y 9 poweroff suspend reboot firmware hibernate windows +bwindows EOF )" fi >&2 printf 'choice: %s\n' "$choice" -# Same on both -case "$choice" in - "windows") - NextBoot="$(efibootmgr -u | grep 'Windows' | grep '^Boot[0-9]\{4\}' | cut -c 5-8)" - expect -f - <<EOF +windows() +{ + NextBoot="$(efibootmgr -u | grep 'Windows' | grep '^Boot[0-9]\{4\}' | cut -c 5-8)" + expect -f - <<EOF set pw [exec pass show aluc] spawn doas efibootmgr --bootnext "$NextBoot" -u expect "password:" send "\$pw\r" expect eof EOF - choice="reboot" ;; + +} + +# Same on both +case "$choice" in + "bwindows") + windows + choice="hibernate" + ;; + "windows") + windows + choice="reboot" + ;; "firmware") rebootfw; exit ;; esac |
