diff options
-rw-r--r-- | roles/init/templates/pam_environment.j2 | 3 | ||||
-rwxr-xr-x | roles/tools/files/gio_unwrapper.sh | 18 | ||||
-rw-r--r-- | roles/tools/tasks/main.yml | 9 |
3 files changed, 30 insertions, 0 deletions
diff --git a/roles/init/templates/pam_environment.j2 b/roles/init/templates/pam_environment.j2 index 65b92e7..5bb8895 100644 --- a/roles/init/templates/pam_environment.j2 +++ b/roles/init/templates/pam_environment.j2 | |||
@@ -16,6 +16,9 @@ VISUAL DEFAULT="vim" | |||
16 | PAGER DEFAULT="less" | 16 | PAGER DEFAULT="less" |
17 | BROWSER DEFAULT="firefox" | 17 | BROWSER DEFAULT="firefox" |
18 | 18 | ||
19 | # replace GIO with xdg-open, see tools/files/gio_unwrapper.sh | ||
20 | GIO_LAUNCH_DESKTOP DEFAULT=gio_unwrapper | ||
21 | |||
19 | # Ansible | 22 | # Ansible |
20 | ANSIBLE_CONFIG DEFAULT="${XDG_CONFIG_HOME}/ansible/ansible.cfg" | 23 | ANSIBLE_CONFIG DEFAULT="${XDG_CONFIG_HOME}/ansible/ansible.cfg" |
21 | 24 | ||
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 @@ | |||
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 | |||
15 | while [ -n "$1" -a "${1:0:1}" != "/" -a ! -f "$1" ]; do | ||
16 | shift | ||
17 | done | ||
18 | xdg-open "$1" | ||
diff --git a/roles/tools/tasks/main.yml b/roles/tools/tasks/main.yml index 1aef012..d8ce64f 100644 --- a/roles/tools/tasks/main.yml +++ b/roles/tools/tasks/main.yml | |||
@@ -144,3 +144,12 @@ | |||
144 | template: | 144 | template: |
145 | src: ssh_config.j2 | 145 | src: ssh_config.j2 |
146 | dest: $HOME/.ssh/config | 146 | dest: $HOME/.ssh/config |
147 | - name: bin dir | ||
148 | file: | ||
149 | state: directory | ||
150 | path: "$HOME/.local/bin" | ||
151 | - name: add gio unwrapper | ||
152 | copy: | ||
153 | src: gio_unwrapper.sh | ||
154 | dest: $HOME/.local/bin/gio_unwrapper | ||
155 | mode: 0755 | ||