aurora.configwaybarscriptsenvyswitch.sh
| 1 | #!/bin/env bash |
| 2 | |
| 3 | mode="$(printf "Integrated\nHybrid\nNvidia" | fuzzel --dmenu -p "Select the graphics mode:")" |
| 4 | |
| 5 | # Exit if no selection was made |
| 6 | [ -z "$mode" ] && exit 1 |
| 7 | |
| 8 | notify-send "Switching to $mode mode..." |
| 9 | |
| 10 | # Map mode to envycontrol argument |
| 11 | arg=$(echo "$mode" | tr '[:upper:]' '[:lower:]') |
| 12 | |
| 13 | if sudo -A envycontrol -s "$arg"; then |
| 14 | notify-send "Graphics mode set to $mode" |
| 15 | else |
| 16 | notify-send "Failed to set graphics mode to $mode" |
| 17 | fi |