Merge pull request #394 from fewtarius/dev

Dev
This commit is contained in:
fewtarius 2022-08-31 07:04:39 -04:00 committed by GitHub
commit c51d7422c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 19 deletions

View file

@ -0,0 +1,5 @@
alias snd-card-0 snd-usb-audio
alias snd-card-1 snd-hda-intel
options snd-usb-audio index=0
options snd-hda-intel index=1,2

View file

@ -7,7 +7,7 @@ pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:2,0"
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096

View file

@ -4,6 +4,8 @@
. /etc/profile
BRIGHTNESS_DEV="$(ls /sys/class/backlight)"
### Variables may need to be device specific here.
BRIGHTNESS=$(get_setting system.brightness)
if [[ ! "${BRIGHTNESS}" =~ [0-9] ]]
@ -17,10 +19,10 @@ then
BRIGHTNESS=3
fi
BRIGHTNESS=$(printf "%.0f" ${BRIGHTNESS})
if [ "$(cat /sys/class/backlight/backlight/max_brightness)" = 255 ]
if [ "$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/max_brightness)" = 255 ]
then
printf "%.0f" $(echo "${BRIGHTNESS} * 2.56" | bc) > /sys/class/backlight/backlight/brightness
printf "%.0f" $(echo "${BRIGHTNESS} * 2.56" | bc) > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
else
printf "%.0f" $(echo "${BRIGHTNESS}") > /sys/class/backlight/backlight/brightness
printf "%.0f" $(echo "${BRIGHTNESS}") > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
fi
set_setting system.brightness ${BRIGHTNESS}

View file

@ -2,9 +2,10 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2020-present Fewtarius
BRIGHTNESS_DEV="$(ls /sys/class/backlight)"
MIN=1
MAX=$(cat /sys/class/backlight/backlight/max_brightness)
MAX=$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/max_brightness)
if [ "${MAX}" = 255 ]
then
STEP=17
@ -22,7 +23,7 @@ then
source /etc/profile
fi
if [ ! -f /sys/class/backlight/backlight/brightness ]
if [ ! -f /sys/class/backlight/${BRIGHTNESS_DEV}/brightness ]
then
echo "ERROR: There is no BRIGHTNESS object to manage."
exit 1
@ -36,7 +37,7 @@ stepUp() {
then
NEWBRIGHTNESS=${MAX}
fi
echo "${NEWBRIGHTNESS}" > /sys/class/backlight/backlight/brightness
echo "${NEWBRIGHTNESS}" > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
set_setting system.brightness ${NEWBRIGHTNESS}
}
@ -48,11 +49,11 @@ stepDown() {
then
NEWBRIGHTNESS=${MIN}
fi
echo "${NEWBRIGHTNESS}" > /sys/class/backlight/backlight/brightness
echo "${NEWBRIGHTNESS}" > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
set_setting system.brightness ${NEWBRIGHTNESS}
}
getBrightness() {
local BRIGHTNESS=$(cat /sys/class/backlight/backlight/brightness)
local BRIGHTNESS=$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/brightness)
return ${BRIGHTNESS}
}

View file

@ -1,6 +1,11 @@
DEVICE_VOLUMECTL=true
DEVICE_AUDIO_MIXER="Playback"
DEVICE_VOLUME_DEV="/dev/event4"
DEVICE_AUDIO_MIXER="PCM"
DEVICE_VOLUME_DEV="/dev/input/event4"
### Do all of this better
DEVICE_VOL_MODIFIER="BTN_SELECT"
DEVICE_CONTROLLER_DEV="/dev/input/event14"
DEVICE_BRIGHTNESS="100"
SPLASH_LOADER="imagemagick"

View file

@ -66,8 +66,9 @@ MINVOL=0
if [ "${1}" == "bright" ]; then
STEPS="5"
CURRENTBRIGHT=$(cat /sys/class/backlight/backlight/brightness)
MAXBRIGHT="100" #$(cat /sys/class/backlight/backlight/max_brightness)
BRIGHTNESS_DEV="$(ls /sys/class/backlight)"
CURRENTBRIGHT=$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/brightness)
MAXBRIGHT="100" #$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/max_brightness)
MINBRIGHT="2"
if [ "${2}" == "+" ]; then
STEPBRIGHT=$(($CURRENTBRIGHT+$STEPS))
@ -79,8 +80,8 @@ MINBRIGHT="2"
[ "$STEPBRIGHT" -ge "$MAXBRIGHT" ] && STEPBRIGHT="$MAXBRIGHT"
[ "$STEPBRIGHT" -le "$MINBRIGHT" ] && STEPBRIGHT="$MINBRIGHT"
#echo "Setting bright to $STEPBRIGHT"
echo "${STEPBRIGHT}" > /sys/class/backlight/backlight/brightness
set_setting "system.brightness" $(cat /sys/class/backlight/backlight/brightness)
echo "${STEPBRIGHT}" > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
set_setting "system.brightness" $(cat /sys/class/backlight/${BRIGHTNESS_DEV}/brightness)
fi

View file

@ -66,8 +66,9 @@ MINVOL=0
if [ "${1}" == "bright" ]; then
STEPS="5"
CURRENTBRIGHT=$(cat /sys/class/backlight/backlight/brightness)
MAXBRIGHT="100" #$(cat /sys/class/backlight/backlight/max_brightness)
BRIGHTNESS_DEV="$(ls /sys/class/backlight)"
CURRENTBRIGHT=$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/brightness)
MAXBRIGHT="100" #$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/max_brightness)
MINBRIGHT="2"
if [ "${2}" == "+" ]; then
STEPBRIGHT=$(($CURRENTBRIGHT+$STEPS))
@ -79,8 +80,8 @@ MINBRIGHT="2"
[ "$STEPBRIGHT" -ge "$MAXBRIGHT" ] && STEPBRIGHT="$MAXBRIGHT"
[ "$STEPBRIGHT" -le "$MINBRIGHT" ] && STEPBRIGHT="$MINBRIGHT"
#echo "Setting bright to $STEPBRIGHT"
echo "${STEPBRIGHT}" > /sys/class/backlight/backlight/brightness
set_setting "system.brightness" $(cat /sys/class/backlight/backlight/brightness)
echo "${STEPBRIGHT}" > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
set_setting "system.brightness" $(cat /sys/class/backlight/${BRIGHTNESS_DEV}/brightness)
fi