diff options
Diffstat (limited to '.config/waybar/scripts/envyswitch.sh')
| -rwxr-xr-x | .config/waybar/scripts/envyswitch.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.config/waybar/scripts/envyswitch.sh b/.config/waybar/scripts/envyswitch.sh new file mode 100755 index 0000000..60c09a4 --- /dev/null +++ b/.config/waybar/scripts/envyswitch.sh @@ -0,0 +1,17 @@ +#!/bin/env bash + +mode="$(printf "Integrated\nHybrid\nNvidia" | rofi -dmenu -case-smart -matching "fuzzy" -p "Select the graphics mode:")" + +# Exit if no selection was made +[ -z "$mode" ] && exit 1 + +notify-send "Switching to $mode mode..." + +# Map mode to envycontrol argument +arg=$(echo "$mode" | tr '[:upper:]' '[:lower:]') + +if sudo -A envycontrol -s "$arg"; then + notify-send "Graphics mode set to $mode" +else + notify-send "Failed to set graphics mode to $mode" +fi |
