add qutebrowser open session script

This commit is contained in:
Ray Elliott 2020-03-26 15:53:41 +00:00
parent 439f8111c8
commit d122e22dc7
1 changed files with 18 additions and 0 deletions

18
src/qutesh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
_session_dir="$HOME/.local/share/qutebrowser/sessions"
_dmenu_config="$HOME/.config/dmenu/dmenurc"
if [ -f "$_dmenu_config" ] ; then
# dmenu options will now be stored in $DMENU_OPTIONS
. "$_dmenu_config"
fi
_session_list=$(ls -t "$_session_dir" | sed 's/\.yml//')
_session=$(printf "NONE\n%s" "$_session_list" | dmenu $DMENU_OPTIONS -i -p "Session :")
if [ "$_session" = 'NONE' ] ; then
qutebrowser -R
else
qutebrowser -r "$_session_dir/$_session.yml"
fi