Skip to content

Instantly share code, notes, and snippets.

@pkillnine
Created January 5, 2017 18:07
Show Gist options
  • Save pkillnine/7396149ccf4166057cea91517d4dbeb7 to your computer and use it in GitHub Desktop.
Save pkillnine/7396149ccf4166057cea91517d4dbeb7 to your computer and use it in GitHub Desktop.
#!/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