dmenu-scripts/dmenu-ryzenadj

47 lines
753 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
2023-11-04 22:03:43 +01:00
load_config() {
. $HOME/.config/dmenu/config
}
2023-11-04 22:03:43 +01:00
get_category() {
category=$(sudo ryzenset list | $DMENU -i -p "Choose profile category:")
2023-11-04 22:03:43 +01:00
[ -z "$category" ] && exit 0
}
2023-11-04 22:03:43 +01:00
get_current_profile() {
current_mode=$(sudo ryzenset get)
}
2023-11-04 22:03:43 +01:00
menu() {
while [ -z "$profile" ]; do
profile=$(sudo ryzenset list $category | $DMENU -i -p "Current: $current_mode:")
2023-11-04 22:03:43 +01:00
[ -z "$profile" ] && get_category
done
}
2023-11-04 22:03:43 +01:00
launch_profile() {
if sudo ryzenset set "$profile"; then
quick-notify "Ryzenset" "Setting $profile"
else
quick-notify "Ryzenset" "Failed to set $game"
fi
}
2023-11-04 22:03:43 +01:00
main() {
load_config
2023-11-04 22:03:43 +01:00
get_category
2023-11-04 22:03:43 +01:00
get_current_profile
2023-11-04 22:03:43 +01:00
menu
2023-11-04 22:03:43 +01:00
launch_profile
}
main $@