fork download
  1. #!/bin/bash
  2. NO_ARGS=0
  3. E_OPTERROR=85
  4.  
  5. if [ $# -eq "$NO_ARGS" ] # Script invoked with no command-line args?
  6. then
  7. echo "Usage: `basename $0` options (-ms)"
  8. echo "-m multi desktop (laptop with external monitor)"
  9. echo "-s single desktop (no external monitor)"
  10. exit $E_OPTERROR # Exit and explain usage.
  11. # Usage: scriptname -options
  12. # Note: dash (-) necessary
  13. fi
  14. getopts ":ms" Option
  15. case $Option in
  16. m ) echo "copying multi display config";sudo cp ~/Documents/xorg.dual.conf /etc/X11/xorg.conf;sudo cp ~/Documents/monitors.dual.xml ~/.config/monitors.xml;;
  17. s ) echo "copying single display config";sudo cp ~/Documents/xorg.single.conf /etc/X11/xorg.conf;sudo cp ~/Documents/monitors.single.xml ~/.config/monitors.xml;;
  18. * ) echo "Unimplemented option chosen.";; # Default.
  19. esac
  20. exit $?
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty