Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Setting key fails when fish shell is user's default shell #5

Open
radomirbosak opened this issue Jun 27, 2017 · 2 comments
Open

Setting key fails when fish shell is user's default shell #5

radomirbosak opened this issue Jun 27, 2017 · 2 comments

Comments

@radomirbosak
Copy link

When I try to run task like this:

- name: new termnial shortcut
  gsetting:
    user: me
    key: "org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/.name"
    value: "New terminal"

I get this error:

TASK [gnome : apply new term] ************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Password: su: Authentication failure\nTraceback (most recent call last):\n  File \"/tmp/ansible_g501K0/ansible_module_gsetting.py\", line 81, in <module>\n    main()\n  File \"/tmp/ansible_g501K0/ansible_module_gsetting.py\", line 68, in main\n    old_value = _get_value(user, key)\n  File \"/tmp/ansible_g501K0/ansible_module_gsetting.py\", line 47, in _get_value\n    'su', '-', user , '-c', command\n  File \"/usr/lib64/python2.7/subprocess.py\", line 219, in check_output\n    raise CalledProcessError(retcode, cmd, output=output)\nsubprocess.CalledProcessError: Command '['su', '-', 'me', '-c', 'export `/usr/bin/dbus-launch` ; /usr/bin/gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name ; kill $DBUS_SESSION_BUS_PID &> /dev/null']' returned non-zero exit status 1\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}

The important part is this:

subprocess.CalledProcessError:
Command 
'['su', '-', 'me', '-c', 'export `/usr/bin/dbus-launch` ;
/usr/bin/gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name ;
kill $DBUS_SESSION_BUS_PID &> /dev/null']' returned non-zero exit status 1

and this is because fish shell doesn't support backticks (they come up in export `/usr/bin/dbus-launch` )

@Yannik
Copy link
Contributor

Yannik commented Mar 10, 2018

does export $(/usr/bin/dbus-launch) work with your shell?

@mrmeszaros
Copy link

@Yannik fish is not compatible with other common shells (bash,zsh,ksh, etc.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants