aboutsummaryrefslogtreecommitdiff
path: root/.config/waybar/scripts/envyswitch.sh
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2025-08-16 20:49:05 +0530
committerkrolxon <krolyxon@tutanota.com>2025-08-16 20:49:05 +0530
commitf3bdd21020b8e618433a06c1efc1cc665cb6839d (patch)
tree32427d47c079637b670a20b62e0339df0e248641 /.config/waybar/scripts/envyswitch.sh
first commit using stow
Diffstat (limited to '.config/waybar/scripts/envyswitch.sh')
-rwxr-xr-x.config/waybar/scripts/envyswitch.sh17
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