]> git.immae.eu Git - perso/Immae/Config/Ansible.git/blame - roles/tools/files/gio_unwrapper.sh
Fix GIO unwrapper when called from lxpanelctl
[perso/Immae/Config/Ansible.git] / roles / tools / files / gio_unwrapper.sh
CommitLineData
1a48017d
IB
1#!/bin/bash
2
3# gio is the replacement for xdg-open in gnome (and gtk) applications,
4# including for instance Firefox. It makes two problems:
5# First, it searches for terminals in a fixed list (which does not
6# include lxterminal)
7# Second, it will not use the configuration that was set using pcmanfm.
8
9# This unwrapper will be called by gio (in place of gio-launch-desktop)
10# thanks to the GIO_LAUNCH_DESKTOP variable, will try to find the opened
11# file in the arguments, and use xdg-open to open it (beware, xdg-open
12# might reuse gio in turn to open the file, for instance in gnome
13# environments)
14
8bd99501
IB
15if [ -n "$GIO_LAUNCHED_DESKTOP_FILE" ]; then
16 while [ -n "$1" -a "${1:0:1}" != "/" -a ! -f "$1" ]; do
17 shift
18 done
19 xdg-open "$1"
20else
21 exec "$@"
22fi