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

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