diff options
| author | krolxon <krolyxon@tutanota.com> | 2025-08-16 20:49:05 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2025-08-16 20:49:05 +0530 |
| commit | f3bdd21020b8e618433a06c1efc1cc665cb6839d (patch) | |
| tree | 32427d47c079637b670a20b62e0339df0e248641 /.config/waybar/scripts | |
first commit using stow
Diffstat (limited to '.config/waybar/scripts')
| -rwxr-xr-x | .config/waybar/scripts/envyswitch.sh | 17 | ||||
| -rwxr-xr-x | .config/waybar/scripts/gpu_mode.sh | 19 |
2 files changed, 36 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 diff --git a/.config/waybar/scripts/gpu_mode.sh b/.config/waybar/scripts/gpu_mode.sh new file mode 100755 index 0000000..365e6be --- /dev/null +++ b/.config/waybar/scripts/gpu_mode.sh @@ -0,0 +1,19 @@ +#!/bin/bash +mode=$(envycontrol -q | awk '{print $NF}') + +case "$mode" in + integrated) + icon="" + ;; + hybrid) + icon="" + ;; + nvidia) + icon="" + ;; + *) + icon="" + ;; +esac + +echo "$icon $mode" |
