dotfiles/.bin/apps/settings

35 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-12-06 08:01:44 +01:00
#!/bin/sh
. $HOME/.bin/_config
SEL=$(printf "BACKLIGHT\nAUDIODEVICE\nVOLUME\nLIDACTION\nSCREEN\nCONFIGFILES" \
2022-12-06 08:01:44 +01:00
| $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)
;;
2022-12-06 08:01:44 +01:00
"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