dotfiles/.bin/apps/settings
2024-01-08 23:06:28 +01:00

35 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
. $HOME/.bin/_config
SEL=$(printf "BACKLIGHT\nAUDIODEVICE\nVOLUME\nLIDACTION\nSCREEN\nCONFIGFILES" \
| $DMENU_CMD -p Mailbox)
case $SEL in
"BACKLIGHT")
S=$(printf "10\n20\n30\n40\n50\n60\n70\n80\n90\n100" | $DMENU_CMD -p Backlight)
doas wsconsctl display.brightness=$S
;;
"LIDACTION")
A=$(printf "enable\ndisable" | $DMENU_CMD -p Lidaction)
case $A in
"enable") doas sysctl machdep.lidaction=1; ;;
"disable") doas sysctl machdep.lidaction=0; ;;
esac
;;
"VOLUME")
S=$(printf "10\n20\n30\n40\n50\n60\n70\n80\n90\n100" | $DMENU_CMD -p Volume)
sndioctl output.level=$(echo "scale=3;$S/100" | bc)
;;
"CONFIGFILES")
C=$(printf "cwmrc\nvimrc\nkshrc\nvimb\nmuttrc\nspectrwm" | sort | $DMENU_CMD -p File)
case $C in
"cwmrc") texec "vim $HOME/.cwmrc"; ;;
"mailcap") texec "vim $HOME/.mutt/mailcap"; ;;
"muttrc") texec "vim $HOME/.mutt/rc-common $HOME/.mutt/rc-account-*"; ;;
"spectrwm") texec "vim $HOME/.config/spectrwm/spectrwm.conf"; ;;
"vimb") texec "vim $HOME/.config/vimb/config"; ;;
"vimrc") texec "vim $HOME/.vim/vimrc"; ;;
esac
;;
esac