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