Created
January 5, 2017 18:07
-
-
Save pkillnine/7396149ccf4166057cea91517d4dbeb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if (( $# < 1 )); then | |
BASECMD="qutebrowser --backend webengine" | |
elif (( $# >= 1 )); then | |
BASECMD="$@" | |
fi | |
TMPBASEDIR=`mktemp -dt qutebrowser-tmp-session-XXX` | |
QBCONFIGDIR="$HOME/.config/qutebrowser" | |
QBDATADIR="$HOME/.local/share/qutebrowser" | |
function qbcommand { | |
echo Executing: $BASECMD --basedir $TMPBASEDIR ':set ui window-title-format "[P] {perc}{title}{title_sep}Qutebrowser"' ':set tabs title-format "[P] {index}: {title}"' | |
$BASECMD --basedir $TMPBASEDIR ':set ui window-title-format "[P] {perc}{title}{title_sep}Qutebrowser"' ':set tabs title-format "[P] {index}: {title}"' | |
} | |
function cleanup { | |
echo Removing "$TMPBASEDIR" | |
rm -rf "$TMPBASEDIR" | |
} | |
mkdir -p "$TMPBASEDIR/config" | |
cp -r $QBCONFIGDIR/* "$TMPBASEDIR/config" | |
cat $QBDATADIR/blocked-hosts >> "$TMPBASEDIR/config/blocked-hosts" | |
qbcommand | |
trap cleanup EXIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment