tinywm-session 739 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. export XDG_SESSION_DESKTOP=TINYWM
  3. xdgrun(){
  4. file="$XDG_DIR/$1"
  5. if cat $file | grep "NotShowIn" | grep "$XDG_SESSION_DESKTOP" &>/dev/null; then
  6. echo -ne "Skip: $1"
  7. elif cat $file | grep "OnlyShowIn" &>/dev/null ; then
  8. if cat $file | grep "OnlyShowIn" | grep "$XDG_SESSION_DESKTOP" &>/dev/null; then
  9. echo "Starting: $1"
  10. $(cat $file | grep "Exec=" | sed "s/^Exec=//g") &
  11. fi
  12. else
  13. echo "Starting: $1"
  14. $(cat $file | grep "^Exec=" | sed "s/^Exec=//g") &
  15. fi
  16. }
  17. #Run autostart
  18. ls /etc/xdg/autostart | while read name
  19. do
  20. XDG_DIR="/etc/xdg/autostart" xdgrun $name
  21. done
  22. #Run user autostart
  23. ls $HOME/.local/share/autostart/ | while read name
  24. do
  25. XDG_DIR="$HOME/.local/share/autostart/" xdgrun $name
  26. done
  27. exec tinywm