Dedicated function to start qutebrowser

This commit is contained in:
Jeremy Gardais 2020-12-02 10:19:27 +01:00
parent 93525a62a6
commit 472fa7e563
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 16 additions and 6 deletions

22
qb
View File

@ -46,30 +46,40 @@ debug_message() { # {{{
return 0
}
# }}}
main() { # {{{
launch_qutebrowser() { # {{{
# Version with user's venv
if [ -f ~/src/qutebrowser-venv/bin/python3 ]; then
debug_message "launch_qutebrowser \
Start qutebrowser from ${RED}venv${COLOR_DEBUG}."
~/src/qutebrowser-venv/bin/python3 -m qutebrowser
exit 0
fi
# Version from APT package
if dpkg -l | grep -q qutebrowser ; then
debug_message "launch_qutebrowser \
Start qutebrowser from ${RED}package${COLOR_DEBUG}."
command qutebrowser
exit 0
fi
# Version from Git repository
if [ -f ~/repos/qutebrowser/qutebrowser.py ]; then
~/repos/qutebrowser/qutebrowser.py --backend webengine "$@"
exit 0
debug_message "launch_qutebrowser \
Start qutebrowser from ${RED}Git repository${COLOR_DEBUG}."
~/repos/qutebrowser/qutebrowser.py --backend webengine
fi
}
# }}}
main() { # {{{
launch_qutebrowser \
&& exit 0
}
# }}}
# Manage arguments # {{{
## If there is argument(s)