dmenu-scripts/dmenu-ryzenadj

36 lines
903 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
2022-04-05 16:59:13 +02:00
source $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_category
2022-10-04 20:00:31 +02:00
current_temp=$(sudo get-tctl-limit)
[ "$current_temp" = "60" ] && current_mode="normal mode"
[ "$current_temp" = "65" ] && current_mode="light gaming"
[ "$current_temp" = "70" ] && current_mode="heavy gaming"
[ "$current_temp" = "75" ] && current_mode="heavy programs"
[ "$current_temp" = "85" ] && current_mode="heavy gaming pro"
while [ -z "$profile" ]
do
2022-10-04 20:00:31 +02:00
profile=$(sudo ryzenset list $category | $DMENU -p "Current: $current_mode:")
[ -z "$profile" ] && get_category
done
2022-10-04 20:00:31 +02:00
if sudo ryzenset set "$profile"; then
quick-notify "Ryzenset" "Setting $profile"
else
quick-notify "Ryzenset" "Failed to set $game"
fi