distribution/packages/jelos/sources/scripts/volume
fewtarius 788a398aab
* Add support for changing the merged storage target between the internal and external card.
* Since JELOS creates the games directory structure it is possible that the overlay will hide games if you switch targets as it will consider them removed.  Delete the empty directories and reboot to resolve.
    * Ex: find /storage/games-internal -type d -empty -delete && find /storage/games-external -type d -empty -delete && reboot
  * Merged storage can now be disabled persistently.
  * A new directory structure is required to enable switching:
    * /storage/games-internal/roms
    * /storage/games-external/roms
    * The target /storage/roms has not changed.
* Lowers clocks to powersave for RK3566 devices.
2023-12-03 13:04:06 +00:00

40 lines
744 B
Bash
Executable file

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
# Source minimal predefined functions and variables
# to ensure as much performance as possible.
. /etc/profile.d/001-functions
VOLUME=$(get_setting "audio.volume")
MAX_VOLUME=100
MIN_VOLUME=0
STEP=10
case ${1} in
"+"|"up")
VOLUME=$(( ${VOLUME} + ${STEP} ))
;;
"-"|"down")
VOLUME=$(( ${VOLUME} - ${STEP} ))
;;
*)
VOLUME=${1}
;;
esac
if (( ${VOLUME} < ${MIN_VOLUME} ))
then
VOLUME=${MIN_VOLUME}
elif (( ${VOLUME} > ${MAX_VOLUME} ))
then
VOLUME=${MAX_VOLUME}
elif [ -z "${VOLUME}" ]
then
VOLUME=60
fi
pactl -- set-sink-volume @DEFAULT_SINK@ ${VOLUME}%
set_setting "audio.volume" ${VOLUME}