summary refs log tree commit diff stats
path: root/bin/qtb-load-session
blob: 67e142361c4aefda2575dd14f866ef9787454c0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

#
# This script opens a session in qutebrowser. There is a problem, that if one session is already open,
#   the new selected session is 'empty'. To avoid this problem, all qutebrowser windows are killed before
#       opening the new session.
#

sessions_path=$(realpath ~/.local/share/qutebrowser/sessions)

rm ~/.local/share/qutebrowser/sessions/_autosave.yml

sel=$(find $sessions_path -iname "*.yml" -not -name "*sync-conflict*" -exec basename {} .yml ";" | sort -u | dmenu)

if [ $? -ne 0 ]; then
    exit 1
fi

ps -A | grep 'qutebrowser' && qutebrowser :wq

qutebrowser -r $sel