2022-04-05 16:59:13 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-08-22 08:32:36 +02:00
|
|
|
# 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
|
2022-11-04 14:54:08 +01:00
|
|
|
}
|
2022-07-09 19:13:31 +02:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
get_category() {
|
|
|
|
category=$(sudo ryzenset list | $DMENU -i -p "Choose profile category:")
|
2022-08-22 08:32:36 +02:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
[ -z "$category" ] && exit 0
|
2022-08-22 08:32:36 +02:00
|
|
|
}
|
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
get_current_profile() {
|
|
|
|
current_mode=$(sudo ryzenset get)
|
2022-11-04 14:54:08 +01:00
|
|
|
}
|
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
menu() {
|
|
|
|
while [ -z "$profile" ]; do
|
|
|
|
profile=$(sudo ryzenset list $category | $DMENU -i -p "Current: $current_mode:")
|
2022-08-22 08:32:36 +02:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
[ -z "$profile" ] && get_category
|
|
|
|
done
|
2022-11-04 14:54:08 +01:00
|
|
|
}
|
|
|
|
|
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
|
2022-11-04 14:54:08 +01:00
|
|
|
}
|
2022-08-22 08:32:36 +02:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
main() {
|
|
|
|
load_config
|
2022-08-22 08:32:36 +02:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
get_category
|
2022-08-22 08:32:36 +02:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
get_current_profile
|
2022-08-22 08:32:36 +02:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
menu
|
2022-11-04 14:54:08 +01:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
launch_profile
|
2022-11-04 14:54:08 +01:00
|
|
|
}
|
2022-08-22 08:32:36 +02:00
|
|
|
|
2022-11-04 14:54:08 +01:00
|
|
|
main $@
|