dotfiles-x1131eb6f0
waybar: add envyswitch script
+25 −3
3 files changed
- M .config/waybar/config.jsonc +1 −0
- A .config/waybar/scripts/envyswitch.sh +21 −0
- R .local/bin/dmenuunicode → .local/bin/rofiunicode +3 −3
| @@ -85,6 +85,7 @@ | |||
| 85 | 85 | "exec": "~/.config/waybar/scripts/gpu_mode.sh", | |
| 86 | 86 | "format": "{}", | |
| 87 | 87 | "interval": "once", | |
| 88 | + | "on-click": "~/.config/waybar/scripts/envyswitch.sh", | |
| 88 | 89 | }, | |
| 89 | 90 | "cpu": { | |
| 90 | 91 | "format": " {usage:2}%", | |
| @@ -0,0 +1,21 @@ | |||
| 1 | + | #!/bin/env bash | |
| 2 | + | ||
| 3 | + | mode="$(printf "Integrated\nHybrid\nNvidia" | rofi -dmenu -case-smart -matching "fuzzy" -p "Select the graphics mode:")" | |
| 4 | + | printf $mode | |
| 5 | + | ||
| 6 | + | ||
| 7 | + | case "$mode" in | |
| 8 | + | Integrated) | |
| 9 | + | sudo -A envycontrol -s integrated && notify-send "Graphics mode set to integrated" | |
| 10 | + | ;; | |
| 11 | + | Hybrid) | |
| 12 | + | sudo -A envcontrol -s hybrid && notify-send "Graphics mode set to hybrid" | |
| 13 | + | ;; | |
| 14 | + | Nvidia) | |
| 15 | + | sudo -A envycontrol -s nvidia && notify-send "Graphics mode set to nvidia" | |
| 16 | + | ;; | |
| 17 | + | *) | |
| 18 | + | exit 1 | |
| 19 | + | ;; | |
| 20 | + | esac | |
| 21 | + | ||
| @@ -3,11 +3,11 @@ | |||
| 3 | 3 | # The famous "get a menu of emojis to copy" script. | |
| 4 | 4 | ||
| 5 | 5 | # Get user selection via dmenu from emoji file. | |
| 6 | − | chosen=$(cut -d ';' -f1 ~/.local/share/chars/* | dmenu -i -l 30 | sed "s/ .*//") | |
| 6 | + | chosen=$(cut -d ';' -f1 ~/.local/share/chars/* | rofi -dmenu -i -l 30 | sed "s/ .*//") | |
| 7 | 7 | ||
| 8 | 8 | # Exit if none chosen. | |
| 9 | 9 | [ -z "$chosen" ] && exit | |
| 10 | 10 | ||
| 11 | − | xdotool type "$chosen" | |
| 12 | − | printf "$chosen" | xclip -selection clipboard | |
| 11 | + | wtype "$chosen" | |
| 12 | + | printf "$chosen" | wl-copy | |
| 13 | 13 | notify-send "'$chosen' copied to clipboard." & | |