]> git.immae.eu Git - perso/Immae/Config/Ansible.git/commitdiff
Add gio unwrapper
authorIsmaël Bouya <ismael.bouya@fretlink.com>
Sun, 18 Nov 2018 12:11:53 +0000 (13:11 +0100)
committerIsmaël Bouya <ismael.bouya@fretlink.com>
Sun, 18 Nov 2018 12:20:49 +0000 (13:20 +0100)
roles/init/templates/pam_environment.j2
roles/tools/files/gio_unwrapper.sh [new file with mode: 0755]
roles/tools/tasks/main.yml

index 65b92e7d428edfbf416d72a25441546f60c4ac2c..5bb88950c0ab69916286c96f8e9ccc84ea82e253 100644 (file)
@@ -16,6 +16,9 @@ VISUAL                                DEFAULT="vim"
 PAGER                          DEFAULT="less"
 BROWSER                                DEFAULT="firefox"
 
+# replace GIO with xdg-open, see tools/files/gio_unwrapper.sh
+GIO_LAUNCH_DESKTOP             DEFAULT=gio_unwrapper
+
 # Ansible
 ANSIBLE_CONFIG                 DEFAULT="${XDG_CONFIG_HOME}/ansible/ansible.cfg"
 
diff --git a/roles/tools/files/gio_unwrapper.sh b/roles/tools/files/gio_unwrapper.sh
new file mode 100755 (executable)
index 0000000..bfddc49
--- /dev/null
@@ -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"
index 1aef012e728dfdc2efd4e9d4491e0137355702a9..d8ce64fdd2aaf594d4f9b0b619da1b856e379304 100644 (file)
   template:
     src: ssh_config.j2
     dest: $HOME/.ssh/config
+- name: bin dir
+  file:
+    state: directory
+    path: "$HOME/.local/bin"
+- name: add gio unwrapper
+  copy:
+    src: gio_unwrapper.sh
+    dest: $HOME/.local/bin/gio_unwrapper
+    mode: 0755