compton_openbox 746 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. # Adapted from script by Philip Newborough (aka corenominal) <mail@philipnewborough.co.uk>
  3. if [ "$1" = "--toggle" ]; then
  4. if [ ! "$(pidof compton)" ]; then
  5. compton
  6. else
  7. killall compton
  8. fi
  9. exit 0
  10. fi
  11. if [ ! "$(pidof compton)" ]; then
  12. cat << EOXML
  13. <openbox_pipe_menu>
  14. <item label="Enable Compositing">
  15. <action name="Execute">
  16. <execute>
  17. compton_openbox --toggle
  18. </execute>
  19. </action>
  20. </item>
  21. </openbox_pipe_menu>
  22. EOXML
  23. else
  24. cat << EOXML
  25. <openbox_pipe_menu>
  26. <item label="Disable Compositing">
  27. <action name="Execute">
  28. <execute>
  29. compton_openbox --toggle
  30. </execute>
  31. </action>
  32. </item>
  33. </openbox_pipe_menu>
  34. EOXML
  35. fi
  36. exit 0