A variety of simple automation scripts and enhancements to Sway and i3.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
693B

  1. #!/bin/bash
  2. LAYOUT=`cat ~/.config/screenlayout/i3.current`
  3. MIDDLE="eDP-1"
  4. if [[ $LAYOUT == 'home' ]]; then
  5. RIGHT="DP-2-2"
  6. LEFT="DP-2-1"
  7. elif [[ $LAYOUT == 'work' ]]; then
  8. RIGHT="DP-2-2"
  9. LEFT="DP-2-1"
  10. elif [[ $LAYOUT == '3' ]]; then
  11. MIDDLE="DP-2-2"
  12. LEFT="DP-2-1"
  13. RIGHT="eDP-1"
  14. else
  15. echo "No external displays connected"
  16. fi
  17. if [[ $1 == 'right' ]]; then
  18. i3 move workspace to output $RIGHT
  19. elif [[ $1 == 'middle' ]]; then
  20. i3 move workspace to output $MIDDLE
  21. elif [[ $1 == 'left' ]]; then
  22. i3 move workspace to output $LEFT
  23. else
  24. echo "Invalid direction. Requires either 'up', 'left', or 'middle'"
  25. fi