summarylogtreecommitdiffstats
path: root/throttlectl
diff options
context:
space:
mode:
authorQue Quotion2022-02-20 04:36:50 +0900
committerQue Quotion2022-02-20 04:36:50 +0900
commitded4bdf7f398a1d65bc733d9e235848327dcf2d7 (patch)
treebce3363548e0061407ff91c93e6ee25cebaab89b /throttlectl
parent9b2e7d0738e6805387f5d7dafc4b903de4d1a085 (diff)
downloadaur-ded4bdf7f398a1d65bc733d9e235848327dcf2d7.tar.gz
Get NVPM working again
Diffstat (limited to 'throttlectl')
-rwxr-xr-xthrottlectl6
1 files changed, 3 insertions, 3 deletions
diff --git a/throttlectl b/throttlectl
index 3aa8461e197b..1bd613f8fdc8 100755
--- a/throttlectl
+++ b/throttlectl
@@ -77,7 +77,8 @@ check_backlight() {
}
throttle_nvpm() {
- printf "nvidia-settings not found; only nvidia currently supported" || \
+ [[ -z "$(command -v nvidia-settings)" ]] && \
+ printf "nvidia-settings not found; only nvidia currently supported" || \
DISPLAY=":0.0" nvidia-settings -a [gpu:0]/GPUPowerMizerMode="${NVPM}" > /dev/null &
}
@@ -269,8 +270,7 @@ while (( "$#" )); do
cut|off|powersave|start) NVPM="0"; SHIFT="2" ;; \
full|on|performance|stop) NVPM="1"; SHIFT="2" ;; \
check|status) check_nvpm; SHIFT="2" ;; esac
- [[ -n "${NVPM}" ]] && [[ -z "$(command -v nvidia-settings)" ]] && \
- throttle_nvpm
+ [[ -n "${NVPM}" ]] && throttle_nvpm
[[ -n "${SHIFT}" ]] && shift "${SHIFT}" || shift
unset NVPM SHIFT
;;