FunKey-OS/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_volume_down

23 lines
416 B
Bash
Executable File

#!/bin/sh
STEP_VOLUME=10
NOTIF_DURATION=2
# Get current value
current_volume=$(volume_get)
# Compute new volume value
new_volume=0
if [ ${current_volume} -gt ${STEP_VOLUME} ]; then
let new_volume=${current_volume}-${STEP_VOLUME}
fi
# Change volume
if [ ${new_volume} -ne ${current_volume} ]; then
volume_set ${new_volume}
fi
# Notif
notif_set ${NOTIF_DURATION} " VOLUME: ${new_volume}%%"
exit 0