Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

22 lines
559 B

  1. #!/bin/sh
  2. if [ ! -d "$XDG_CONFIG_HOME/sessions" ]; then
  3. mkdir -p "$XDG_CONFIG_HOME/sessions"
  4. fi
  5. list=""
  6. for i in $(ls -1 "$XDG_CONFIG_HOME/sessions/"); do
  7. list="${list}${i} : $(head -n 1 "$XDG_CONFIG_HOME/sessions/$i" | sed 's/# //g')\n"
  8. done
  9. selection=$(printf "$list" | dmenu -l 4 | sed 's/ :.*//g')
  10. echo "$selection"
  11. if [ ! -f "$XDG_CONFIG_HOME/sessions/$selection" ]; then
  12. touch "$XDG_CONFIG_HOME/sessions/$selection"
  13. st -c vim -n vim -e "$EDITOR" "$XDG_CONFIG_HOME/sessions/$selection"
  14. else
  15. bash "$XDG_CONFIG_HOME/sessions/$selection"
  16. fi