Add comprehensive documentation for Lenovo ThinkPad Gentoo Linux setup including: - Complete system configuration guides (power, Bluetooth, WiFi, audio) - Hardware setup documentation (touchpad, touchscreen, DisplayLink) - Management scripts with ZSH completions - Kernel configuration (6.12.41-gentoo-x86_64) - Lid automation and monitor management - Battery conservation system - User guides and troubleshooting Repository includes .gitignore to exclude logs, temporary files, and secrets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
77 lines
2.7 KiB
Plaintext
77 lines
2.7 KiB
Plaintext
#compdef audio-setup
|
|
|
|
# ZSH completion for audio-setup
|
|
# Install to: /usr/local/share/zsh/site-functions/_audio-setup
|
|
|
|
_audio-setup() {
|
|
local -a commands
|
|
commands=(
|
|
'status:Show current audio status'
|
|
'list-outputs:List all output devices'
|
|
'list-inputs:List all input devices'
|
|
'output:Switch to output device'
|
|
'input:Switch to input device'
|
|
'volume:Set volume (0-100)'
|
|
'mute:Mute output'
|
|
'unmute:Unmute output'
|
|
'mute-input:Mute input'
|
|
'unmute-input:Unmute input'
|
|
'help:Show help message'
|
|
)
|
|
|
|
local curcontext="$curcontext" state line
|
|
typeset -A opt_args
|
|
|
|
_arguments -C \
|
|
'1: :->command' \
|
|
'2: :->argument'
|
|
|
|
case $state in
|
|
command)
|
|
_describe 'command' commands
|
|
;;
|
|
argument)
|
|
case $line[1] in
|
|
output|set-output)
|
|
# Complete with output device numbers
|
|
local -a outputs
|
|
local index=1
|
|
while IFS= read -r sink; do
|
|
local sink_name=$(echo "$sink" | awk '{print $2}')
|
|
local description=$(pactl list sinks 2>/dev/null | grep -A 1 "Name: $sink_name" | grep "Description:" | cut -d: -f2- | sed 's/^[[:space:]]*//')
|
|
outputs+=("$index:$description")
|
|
((index++))
|
|
done < <(pactl list short sinks 2>/dev/null)
|
|
_describe 'output device' outputs
|
|
;;
|
|
input|set-input)
|
|
# Complete with input device numbers
|
|
local -a inputs
|
|
local index=1
|
|
while IFS= read -r source; do
|
|
local source_name=$(echo "$source" | awk '{print $2}')
|
|
local description=$(pactl list sources 2>/dev/null | grep -A 1 "Name: $source_name" | grep "Description:" | cut -d: -f2- | sed 's/^[[:space:]]*//')
|
|
inputs+=("$index:$description")
|
|
((index++))
|
|
done < <(pactl list short sources 2>/dev/null | grep -v "\.monitor$")
|
|
_describe 'input device' inputs
|
|
;;
|
|
volume|vol)
|
|
# Suggest common volume levels
|
|
local -a volumes
|
|
volumes=(
|
|
'0:Mute'
|
|
'25:25%'
|
|
'50:50%'
|
|
'75:75%'
|
|
'100:100%'
|
|
)
|
|
_describe 'volume level' volumes
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
}
|
|
|
|
_audio-setup "$@"
|