aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/envyswitch
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/envyswitch')
-rwxr-xr-x.local/bin/envyswitch17
1 files changed, 17 insertions, 0 deletions
diff --git a/.local/bin/envyswitch b/.local/bin/envyswitch
new file mode 100755
index 0000000..e1d9933
--- /dev/null
+++ b/.local/bin/envyswitch
@@ -0,0 +1,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