From a6517fe3af876f794727dc6ff2728d7509a71e46 Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 18 Apr 2022 11:50:45 +0100 Subject: [PATCH] initial commit --- qutesesh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 qutesesh diff --git a/qutesesh b/qutesesh new file mode 100755 index 0000000..b6a71c3 --- /dev/null +++ b/qutesesh @@ -0,0 +1,23 @@ +#!/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\nTEMP\nMEDIA\n%s" "$_session_list" | dmenu $DMENU_OPTIONS -l 20 -i -p "Session :") +[ -z "$_session" ] && exit 5; + +if [ "$_session" = 'NONE' ] ; then + qutebrowser -R +elif [ "$_session" = 'TEMP' ] ; then + qutebrowser --temp-basedir --config-py "$HOME/.config/qutebrowser/config.py" +elif [ "$_session" = 'TEMP' ] ; then + qutebrowser --basedir ~/.config/qutebrowser-media/ --config-py ~/.config/qutebrowser-media/config.py +else + qutebrowser -r "$_session_dir/$_session.yml" +fi