Files
Arch-R/scripts/current_volume
Douglas Teles 68b9ff798a Audio card working, LD_PRELOAD fix, volume/brightness hotkey fixes
Audio (3-iteration DTS fix chain):
- Removed duplicate pinctrl from codec node (pin conflict)
- Fixed sound-dai to reference &rk817_codec (MFD of_node mismatch)
- Removed DAPM routing/widgets (BSP codec has no DAPM widgets)
- Added 7 missing battery BSP properties

Runtime fixes:
- unset_preload.so prevents gl4es LD_PRELOAD inheritance to subprocesses
- ES Patch 5: getShOutput() null safety for popen() failure
- Volume hotkeys: use 'DAC Playback Volume' (not enum 'Playback')
- Brightness: 5% minimum clamp, persistence across reboots
- current_volume: reads correct ALSA control
- perfmax/perfnorm: guard DMC writes with file existence check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 21:07:37 -03:00

21 lines
547 B
Bash

#!/bin/bash
# Arch R - Current volume level for ES info bar
# Returns volume percentage string
# rk817 BSP codec uses "DAC Playback Volume" (not "Master" or "Playback")
# Try DAC Playback Volume (rk817 BSP codec)
vol=$(amixer sget 'DAC Playback Volume' 2>/dev/null | grep -o '\[.*%\]' | head -1 | tr -d '[]')
if [ -n "$vol" ]; then
echo "$vol"
exit 0
fi
# Fallback: Master control (other codecs)
vol=$(amixer sget Master 2>/dev/null | awk -F'[][]' '/Left:/ { print $2 }')
if [ -n "$vol" ]; then
echo "$vol"
exit 0
fi
echo "N/A"