Corrected buggy quick_action scripts

This commit is contained in:
Michel-FK 2020-07-23 16:46:32 +02:00
parent c1f793be46
commit e391eeaeed
4 changed files with 12 additions and 12 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
STEP_BRIGHTNESS=10
NOTIF_TIME_ON=2
NOTIF_DURATION=2
# Get current value
current_brightness=$(brightness_get)
@ -18,5 +18,5 @@ if [ ${new_brightness} -ne ${current_brightness} ]; then
fi
# Notif
notif_set ${NOTIF_TIME_ON} " BRIGHTNESS: ${new_brightness}%%"
notif_set ${NOTIF_DURATION} " BRIGHTNESS: ${new_brightness}%%"
exit 0

View File

@ -1,13 +1,13 @@
#!/bin/sh
STEP_BRIGHTNESS=10
NOTIF_TIME_ON=2
NOTIF_DURATION=2
# Get current value
current_brightness=$(brightness_get)
# Compute new brightness value
new_brightness=${current_brightness}+${STEP_BRIGHTNESS}
let new_brightness=${current_brightness}+${STEP_BRIGHTNESS}
if [ ${new_brightness} -gt 100 ]; then
new_brightness=100
fi
@ -18,5 +18,5 @@ if [ ${new_brightness} -ne ${current_brightness} ]; then
fi
# Notif
notif_set ${NOTIF_TIME_ON} " BRIGHTNESS: ${new_brightness}%%"
notif_set ${NOTIF_DURATION} " BRIGHTNESS: ${new_brightness}%%"
exit 0

View File

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

View File

@ -1,22 +1,22 @@
#!/bin/sh
STEP_VOLUME=10
NOTIF_TIME_ON=2
NOTIF_DURATION=2
# Get current value
current_volume=$(volume_get)
# Compute new volume value
new_volume=${current_volume}+${STEP_VOLUME}
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
if [ ${new_volume} -ne ${current_volume} ]; then
volume_set ${new_volume}
fi
# Notif
notif_set ${NOTIF_TIME_ON} " VOLUME: ${new_volume}%%"
notif_set ${NOTIF_DURATION} " VOLUME: ${new_volume}%%"
exit 0