#!/usr/bin/env bash # 0 = Normal/Balanced # 1 = Boost # 2 = Silent. MODELIST=("Balanced" "Boost" "Silent") INTERFACE="/sys/devices/platform/asus-nb-wmi/throttle_thermal_policy" CURRENT_MODE=$(cat ${INTERFACE}) MODE=${CURRENT_MODE} if [[ ! ${1} ]]; then [[ ${MODE} == 2 ]] && MODE=0 || let MODE+=1 else MODE=${1} fi echo ${MODE} > ${INTERFACE} CHECK_MODE=$(cat ${INTERFACE}) notify-send "Fan mode changed" "${MODELIST[${CURRENT_MODE}]} -> ${MODELIST[${CHECK_MODE}]}"