chore: initialize gentoo-setup documentation repository
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>
This commit is contained in:
59
scripts/bluetooth-setup/_bluetooth-setup
Normal file
59
scripts/bluetooth-setup/_bluetooth-setup
Normal file
@@ -0,0 +1,59 @@
|
||||
#compdef bluetooth-setup
|
||||
|
||||
# ZSH completion for bluetooth-setup
|
||||
# Place this file in /usr/local/share/zsh/site-functions/_bluetooth-setup
|
||||
|
||||
_bluetooth-setup() {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
'1: :->command' \
|
||||
'2: :->arg' \
|
||||
&& return 0
|
||||
|
||||
case $state in
|
||||
command)
|
||||
local -a commands
|
||||
commands=(
|
||||
'scan:Scan for nearby Bluetooth devices'
|
||||
'pair:Pair with a device'
|
||||
'connect:Connect to a paired device'
|
||||
'disconnect:Disconnect from device(s)'
|
||||
'remove:Remove/forget a paired device'
|
||||
'status:Show Bluetooth status'
|
||||
'list-paired:List paired devices'
|
||||
'list:List paired devices'
|
||||
'power:Enable or disable Bluetooth'
|
||||
'help:Show help information'
|
||||
)
|
||||
_describe -t commands 'bluetooth-setup command' commands
|
||||
;;
|
||||
arg)
|
||||
case $line[1] in
|
||||
pair)
|
||||
# Complete with discovered devices (MAC addresses)
|
||||
local -a devices
|
||||
devices=(${(f)"$(bluetoothctl devices 2>/dev/null | awk '{print $2":"$3}' | sed 's/:$//')"})
|
||||
_describe -t devices 'available devices' devices
|
||||
;;
|
||||
connect|disconnect|remove|forget)
|
||||
# Complete with paired devices (MAC addresses)
|
||||
local -a paired
|
||||
paired=(${(f)"$(bluetoothctl paired-devices 2>/dev/null | awk '{print $2":"substr($0, index($0,$3))}')"})
|
||||
_describe -t paired 'paired devices' paired
|
||||
;;
|
||||
power)
|
||||
# Complete with on/off
|
||||
local -a power_states
|
||||
power_states=('on:Enable Bluetooth' 'off:Disable Bluetooth')
|
||||
_describe -t power_states 'power state' power_states
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
_bluetooth-setup "$@"
|
||||
Reference in New Issue
Block a user