123456789101112131415161718192021222324252627 |
- #!/bin/zsh -f
- if [[ $# -eq 0 ]] ; then
- echo "switch-layout [ name | list | define ]"
- exit
- fi
- LAYOUT=$1
- case ${LAYOUT} in
- define)
- arandr
- ;;
- list)
- for layout in ~/.screenlayout/*.sh ;
- do
- echo " - $(basename -- ${layout} .sh)"
- done
- ;;
- *)
- if [[ -e ~/.screenlayout/${LAYOUT}.sh ]] ; then
- sh ~/.screenlayout/${LAYOUT}.sh
- [[ -e ~/.screenlayout/${LAYOUT}.sh-after ]] && \
- sh ~/.screenlayout/${LAYOUT}.sh-after
- echo Switched to ${LAYOUT} layout
- fi
- esac
|