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

23 lines
403 B
Bash
Executable File

#!/bin/sh
STEP_VOLUME=10
NOTIF_DURATION=2
# Get current value
current_volume=$(volume_get)
# Compute new volume value
let new_volume=${current_volume}+${STEP_VOLUME}
if [ ${new_volume} -gt 100 ]; then
new_volume=100
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