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.

49 lines
1.1KB

  1. #!/bin/zsh
  2. #
  3. # bspwm-session
  4. #
  5. # This script is a session launcher for bspwm.
  6. # It is based on similar scripts included with Openbox.
  7. if [ -n "$1" ]; then
  8. echo "Usage: bspwm-session"
  9. echo
  10. exit 1
  11. fi
  12. # One socket per user
  13. export BSPWM_SOCKET=$HOME/.cache/bspwm-socket
  14. # Trap: make sure everything started in ~/.config/bspwm/autostart is
  15. # signalled when this script exits or dies. Also clean up $state_path.
  16. function on_exit {
  17. for child in $(jobs -p); do
  18. jobs -p | grep -q $child && kill $child
  19. done
  20. # Extra paranoia
  21. [[ -d "${state_path}" && -w "${state_path}" ]] && rm -rf -- "${state_path}"
  22. }
  23. trap on_exit EXIT SIGHUP SIGINT SIGTERM
  24. # Environment and autostart:
  25. source_these=(
  26. "/etc/profile"
  27. "${HOME}/.profile"
  28. "${XDG_CONFIG_HOME:-"$HOME/.config"}/bspwm/autostart"
  29. )
  30. for file in "${source_these[@]}"; do
  31. [ -r "${file}" ] && . "${file}"
  32. done
  33. # Launch sxhkd:
  34. case $HOST in
  35. tablet|hegp-laptop) sxhkd ~/.config/sxhkd/music_home ~/.config/sxhkd/volume ~/.config/sxhkd/music &;;
  36. home) sxhkd ~/.config/sxhkd/volume &;;
  37. hnv-laptop|hegp) sxhkd ~/.config/sxhkd/volume ~/.config/sxhkd/music &;;
  38. esac
  39. # Launch bspwm:
  40. bspwm