Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions projects/ROCKNIX/packages/rocknix/sources/scripts/brightness
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ _write_brightness() {
stepUp() {
local current_percent
current_percent="$(get_setting "${CURRENT_SETTING_KEY}")"
brightness_step="$(getBrightnessStep)"

local next_percent=$((current_percent + 5))
local next_percent=$((current_percent + ${brightness_step}))
if (("${next_percent}" > 100)); then
next_percent=100
fi
Expand All @@ -103,8 +104,9 @@ stepUp() {
stepDown() {
local current_percent
current_percent="$(get_setting "${CURRENT_SETTING_KEY}")"
brightness_step="$(getBrightnessStep)"

local next_percent=$((current_percent - 5))
local next_percent=$((current_percent - ${brightness_step}))

if (("${next_percent}" < 5)); then
next_percent=5
Expand Down Expand Up @@ -139,6 +141,19 @@ getBrightnessValue() {
cat "${CURRENT_DEV_PATH}"
}

getBrightnessStep() {
local step="$(get_setting display.brightness_step)"
if [ -z "${step}" ]
then
step=5
fi
if (( ${step} <= 0 ))
then
step=5
fi
echo "$step"
}

# Helper: apply an action to all detected screens
_apply_all() {
local action="$1"
Expand Down
10 changes: 9 additions & 1 deletion projects/ROCKNIX/packages/rocknix/sources/scripts/volume
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
VOLUME=$(get_setting "audio.volume")
MAX_VOLUME=100
MIN_VOLUME=0
STEP=5
STEP=$(get_setting "audio.volume_step")
if [ -z "${STEP}" ]
then
STEP=5
fi
if (( ${STEP} <= 0 ))
then
STEP=5
fi

case ${1} in
"+"|"up")
Expand Down