From 6253aaf99829d4f42b7cfaa6a774ed6e07bf71ea Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Mon, 22 Aug 2022 08:32:36 +0200 Subject: [PATCH] use another project for better profile support. --- dmenu-ryzenadj | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/dmenu-ryzenadj b/dmenu-ryzenadj index abf3505..e5f471c 100755 --- a/dmenu-ryzenadj +++ b/dmenu-ryzenadj @@ -1,22 +1,35 @@ #!/bin/sh -# dmenu script for quickly running specific ryzenadj commands +# dmenu script for quickly setting ryzenadj profiles with my other script easily source $HOME/.config/dmenu/config -current_temp=$(sudo ryzenadj -i | grep 'tctl-temp' | awk '{ print $6 }') -slow_time=$(sudo ryzenadj -i | grep 'slow-time' | awk '{ print $4 }') +get_category () { + category=$( ryzenset list | $DMENU -p "Choose profile category:") -[ "$current_temp" = "60.000" ] && current_mode="normal mode" -[ "$current_temp" = "65.000" ] && current_mode="light gaming" -[ "$current_temp" = "70.000" ] && current_mode="heavy gaming" -[ "$current_temp" = "75.000" ] && current_mode="heavy programs" -[ "$current_temp" = "85.000" ] && current_mode="heavy gaming pro" + [ -z "$category" ] && exit 0 +} -case "$(printf "normal mode\\nlight gaming\\nheavy gaming\\nheavy programs\\nheavy gaming pro" | $DMENU -p "Current: $current_mode")" in - "normal mode") sudo ryzenadj --slow-time=30 --vrmmax-current=30000 --tctl-temp=60 --stapm-limit=10000 --stapm-time=300 --fast-limit=12000 --slow-limit=11000 --max-performance; break ;; - "light gaming") sudo ryzenadj --slow-time=30 --vrmmax-current=35000 --tctl-temp=65 --stapm-limit=10000 --stapm-time=300 --fast-limit=12000 --slow-limit=11000 --max-performance; break ;; - "heavy gaming") sudo ryzenadj --slow-time=60 --vrmmax-current=60000 --tctl-temp=70 --stapm-limit=20000 --stapm-time=1000 --fast-limit=25000 --slow-limit=21000 --max-performance; break ;; - "heavy programs") sudo ryzenadj --slow-time=60 --vrmmax-current=60000 --tctl-temp=75 --stapm-limit=25000 --stapm-time=1000 --fast-limit=30000 --slow-limit=27000 --max-performance; break ;; - "heavy gaming pro") sudo ryzenadj --slow-time=60 --vrmmax-current=70000 --tctl-temp=85 --stapm-limit=35000 --stapm-time=1000 --fast-limit=35000 --slow-limit=35000 --max-performance; break ;; -esac +get_category + +current_temp=$(sudo $HOME/Bin/chad/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 + + profile=$(ryzenset list $category | $DMENU -p "Current: $current_mode:") + + [ -z "$profile" ] && get_category +done + +if ryzenset set "$profile"; then + quick-notify "Ryzenset" "Setting $profile" +else + quick-notify "Ryzenset" "Failed to set $game" +fi