dmenu-scripts/dmenu-ryzenadj

48 lines
823 B
Plaintext
Raw Normal View History

2022-04-05 16:59:13 +02:00
#!/bin/sh
# dmenu script for quickly setting ryzenadj profiles with my other script easily
load_config () {
. $HOME/.config/dmenu/config
}
get_category () {
2022-10-04 20:00:31 +02:00
category=$( sudo ryzenset list | $DMENU -p "Choose profile category:")
[ -z "$category" ] && exit 0
}
get_current_profile () {
current_mode=$(sudo ryzenset get)
}
menu () {
while [ -z "$profile" ]
do
profile=$(sudo ryzenset list $category | $DMENU -p "Current: $current_mode:")
[ -z "$profile" ] && get_category
done
}
launch_profile () {
if sudo ryzenset set "$profile"; then
quick-notify "Ryzenset" "Setting $profile"
else
quick-notify "Ryzenset" "Failed to set $game"
fi
}
main () {
load_config
get_category
get_current_profile
menu
launch_profile
}
main $@