X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=roles%2Ftools%2Ffiles%2Fgio_unwrapper.sh;fp=roles%2Ftools%2Ffiles%2Fgio_unwrapper.sh;h=bfddc49d6fc8e7f14c38ad52e5f0efe6bf87dcb4;hb=1a48017dde54325c5619f45f925478e7c3143ba8;hp=0000000000000000000000000000000000000000;hpb=0c9e64e112318249a00a33315a127aa70787165c;p=perso%2FImmae%2FConfig%2FAnsible.git diff --git a/roles/tools/files/gio_unwrapper.sh b/roles/tools/files/gio_unwrapper.sh new file mode 100755 index 0000000..bfddc49 --- /dev/null +++ b/roles/tools/files/gio_unwrapper.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# gio is the replacement for xdg-open in gnome (and gtk) applications, +# including for instance Firefox. It makes two problems: +# First, it searches for terminals in a fixed list (which does not +# include lxterminal) +# Second, it will not use the configuration that was set using pcmanfm. + +# This unwrapper will be called by gio (in place of gio-launch-desktop) +# thanks to the GIO_LAUNCH_DESKTOP variable, will try to find the opened +# file in the arguments, and use xdg-open to open it (beware, xdg-open +# might reuse gio in turn to open the file, for instance in gnome +# environments) + +while [ -n "$1" -a "${1:0:1}" != "/" -a ! -f "$1" ]; do + shift +done +xdg-open "$1"