From 34ab214c3994ce13b21a4717a48b6bfaed347cfc Mon Sep 17 00:00:00 2001 From: Quad Date: Sun, 23 May 2021 12:28:49 +0200 Subject: [PATCH] Remove some gunk and fix indent --- scripts/tdp | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/scripts/tdp b/scripts/tdp index 67547dc..98c66ad 100755 --- a/scripts/tdp +++ b/scripts/tdp @@ -171,9 +171,9 @@ check_tdp () { local pl1=$(uw_to_w $(get_pl 1)) local pl2=$(uw_to_w $(get_pl 2)) - echo "PL1 is ${pl1}W" # Placeholder + echo "PL1 is ${pl1}W" if ( is_detailed $@ ); then - echo "PL2 is ${pl2}W" # Placeholder + echo "PL2 is ${pl2}W" fi elif ( is_help $@ ); then @@ -244,35 +244,34 @@ gui_handler() { case $gui_action in "check") - gui_msg "$($command_name check --detail)" + gui_msg "$($command_name check --detail)" ;; "preset") - gui_tdp=$( - zenity --list --title "${gui_name}" --width=400 --height=350 $gui_options --text="Chose TDP to set:" --hide-column=1 --column="" --column="Wattage" \ - 8 "`printf "\n 8W (Ultra-low, for simple 2D games)\n "`" \ - 12 "`printf "\n 12W (Low power)\n "`" \ - 15 "`printf "\n 15W (Balanced)\n "`" \ - 20 "`printf "\n 20W (High power)\n "`" \ - 28 "`printf "\n 28W (Max power / Docked)\n "`" - ) - echo $gui_tdp - if ! [ -z $gui_tdp ]; then - gui_msg "$(tdp set $gui_tdp --detail)" - fi + gui_tdp=$( + zenity --list --title "${gui_name}" --width=400 --height=350 $gui_options --text="Chose TDP to set:" --hide-column=1 --column="" --column="Wattage" \ + 8 "`printf "\n 8W (Ultra-low, for simple 2D games)\n "`" \ + 12 "`printf "\n 12W (Low power)\n "`" \ + 15 "`printf "\n 15W (Balanced)\n "`" \ + 20 "`printf "\n 20W (High power)\n "`" \ + 28 "`printf "\n 28W (Max power / Docked)\n "`" + ) + if ! [ -z $gui_tdp ]; then + gui_msg "$(tdp set $gui_tdp --detail)" + fi ;; "set") - gui_tdp=$(gui_read "Please enter TDP") - - if ! [ -z $gui_tdp ]; then - if $(gui_ask "Should PL2 be set to the same wattage?\nIf unsure, answer No."); then - gui_msg "$(tdp set $gui_tdp --same --detail)" - else - gui_msg "$(tdp set $gui_tdp --detail)" + gui_tdp=$(gui_read "Please enter TDP") + + if ! [ -z $gui_tdp ]; then + if $(gui_ask "Should PL2 be set to the same wattage?\nIf unsure, answer No."); then + gui_msg "$(tdp set $gui_tdp --same --detail)" + else + gui_msg "$(tdp set $gui_tdp --detail)" + fi + gui_tdp="" fi - gui_tdp="" - fi ;; *)