pekwm_ws_menu.sh 554 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. #
  3. # Copyright © 2009 the pekwm development team
  4. #
  5. if test "${1}" = "send"; then
  6. action="SendToWorkspace"
  7. elif test "${1}" = "goto"; then
  8. action="GotoWorkspace"
  9. else
  10. echo "usage: $0 goto|send dynamic"
  11. exit 1
  12. fi
  13. if test "${2}" = "dynamic"; then
  14. echo "Dynamic {"
  15. fi
  16. num_workspaces="$(xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{ print $3 }')"
  17. i=1;
  18. while test "${i}" -le "${num_workspaces}"; do
  19. echo "Entry = \"Workspace $i\" { Actions = \"${action} ${i}\" }"
  20. i=$(($i + 1))
  21. done
  22. if test "${2}" = "dynamic"; then
  23. echo "}"
  24. fi