25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
482 B

  1. #!/usr/bin/env bash
  2. # 0 = Normal/Balanced
  3. # 1 = Boost
  4. # 2 = Silent.
  5. MODELIST=("Balanced" "Boost" "Silent")
  6. INTERFACE="/sys/devices/platform/asus-nb-wmi/throttle_thermal_policy"
  7. CURRENT_MODE=$(cat ${INTERFACE})
  8. MODE=${CURRENT_MODE}
  9. if [[ ! ${1} ]]; then
  10. [[ ${MODE} == 2 ]] && MODE=0 || let MODE+=1
  11. else
  12. MODE=${1}
  13. fi
  14. echo ${MODE} > ${INTERFACE}
  15. CHECK_MODE=$(cat ${INTERFACE})
  16. notify-send "Fan mode changed" "${MODELIST[${CURRENT_MODE}]} -> ${MODELIST[${CHECK_MODE}]}"