qutebrowser: Make xdg-utils optional
Replace all hard-coded instances of using xdg-open with at least one non-xdg alternative. Mostly falling back to either mimeo or a custom open script.
This commit is contained in:
parent
ff2ae79878
commit
d69a0f40e1
5 changed files with 41 additions and 8 deletions
|
|
@ -12,6 +12,16 @@
|
|||
# Configure your wallabag instance with this:
|
||||
WALLABAG_INSTANCE="https://read.martyoeh.me"
|
||||
|
||||
_open() {
|
||||
if command -v open >/dev/null 2>&1; then
|
||||
open "$1" &
|
||||
elif command -v mimeo >/dev/null 2>&1; then
|
||||
mimeo "$1" &
|
||||
else
|
||||
xdg-open "$1" &
|
||||
fi
|
||||
}
|
||||
|
||||
# only works for wallabag v2.*
|
||||
if [ "$#" -gt 0 ]; then
|
||||
BM="$WALLABAG_INSTANCE/bookmarklet?url=$*"
|
||||
|
|
@ -22,5 +32,5 @@ fi
|
|||
if [ -n "$QUTE_FIFO" ]; then
|
||||
echo "open -b -r $BM" >>"$QUTE_FIFO"
|
||||
else
|
||||
xdg-open "$BM"
|
||||
_open "$BM"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue