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 shaarli instance with this:
|
||||
SHAARLI_INSTANCE="https://links.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
|
||||
}
|
||||
|
||||
# send page to shaarli instance and open the 'post' page to edit it
|
||||
if [ "$#" -gt 0 ]; then
|
||||
BM="$SHAARLI_INSTANCE/?post=$*"
|
||||
|
|
@ -22,6 +32,6 @@ fi
|
|||
if [ -n "$QUTE_FIFO" ]; then
|
||||
echo "open -t -r $BM" >>"$QUTE_FIFO"
|
||||
else
|
||||
xdg-open "$BM"
|
||||
_open "$BM"
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue