waybar: add envyswitch script
This commit is contained in:
parent
f835448ed5
commit
31eb6f0171
|
|
@ -85,6 +85,7 @@
|
|||
"exec": "~/.config/waybar/scripts/gpu_mode.sh",
|
||||
"format": "{}",
|
||||
"interval": "once",
|
||||
"on-click": "~/.config/waybar/scripts/envyswitch.sh",
|
||||
},
|
||||
"cpu": {
|
||||
"format": " {usage:2}%",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/env bash
|
||||
|
||||
mode="$(printf "Integrated\nHybrid\nNvidia" | rofi -dmenu -case-smart -matching "fuzzy" -p "Select the graphics mode:")"
|
||||
printf $mode
|
||||
|
||||
|
||||
case "$mode" in
|
||||
Integrated)
|
||||
sudo -A envycontrol -s integrated && notify-send "Graphics mode set to integrated"
|
||||
;;
|
||||
Hybrid)
|
||||
sudo -A envcontrol -s hybrid && notify-send "Graphics mode set to hybrid"
|
||||
;;
|
||||
Nvidia)
|
||||
sudo -A envycontrol -s nvidia && notify-send "Graphics mode set to nvidia"
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
@ -3,11 +3,11 @@
|
|||
# The famous "get a menu of emojis to copy" script.
|
||||
|
||||
# Get user selection via dmenu from emoji file.
|
||||
chosen=$(cut -d ';' -f1 ~/.local/share/chars/* | dmenu -i -l 30 | sed "s/ .*//")
|
||||
chosen=$(cut -d ';' -f1 ~/.local/share/chars/* | rofi -dmenu -i -l 30 | sed "s/ .*//")
|
||||
|
||||
# Exit if none chosen.
|
||||
[ -z "$chosen" ] && exit
|
||||
|
||||
xdotool type "$chosen"
|
||||
printf "$chosen" | xclip -selection clipboard
|
||||
wtype "$chosen"
|
||||
printf "$chosen" | wl-copy
|
||||
notify-send "'$chosen' copied to clipboard." &
|
||||
Loading…
Reference in New Issue