aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/envyswitch
blob: e1d9933768ff329c52aeb564f16a118d41faaa9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/env bash

mode="$(printf "Integrated\nHybrid\nNvidia" | fuzzel --dmenu  -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