The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

Some key bindings do not work reliably when also using gnome-settings-daemon

asked 2014-12-17 13:47:32 +0000

kviktor gravatar image

updated 2014-12-18 14:01:22 +0000

Adaephon gravatar image

I have a shell script in my home directory that lets me control spotify and I'm trying to use it with these lines in my i3 config.

bindsym X86AudioPlay exec sh /home/kviktor/spotify-control play
bindsym X86AudioNext exec sh /home/kviktor/spotify-control next
bindsym X86AudioPrev exec sh /home/kviktor/spotify-control prev

(The script can be found on GitHub)

The commands work reliably, when started from a shell. However they do not always work when using the key bindings. Sometimes this image pops and nothing else happens: image description

I'm on Ubuntu 12.04 and i3 version 4.7.2 (2014-01-23, branch "tags/4.7.2"). Spotify is started with exec from my i3 configuration. I also have gnome-settings-daemon running.

edit retag flag offensive close merge delete

Comments

This window is definitely not from *i3*, so I'd guess that it is an issue with spotify-control. So the question is: does that also happen when you call it from a shell?

Adaephon gravatar imageAdaephon ( 2014-12-17 14:03:16 +0000 )edit

`exec sh /home/kviktor/spotify-control play` into my shell works like a charm. It seems like the script is not even ran.

kviktor gravatar imagekviktor ( 2014-12-17 15:22:24 +0000 )edit

While `exec` is also a valid shell command, here it is a *i3* command and **not** part of the actual command, which in this case starts with `sh`. Could you post a link to the source of that script or, if it is not too long, add it to the question?

Adaephon gravatar imageAdaephon ( 2014-12-17 20:55:24 +0000 )edit
1

Ok, so the script only sends messages to spotify via DBus and nothing else. That only leaves the Spotify as creator of the image. I would say that `bindsym` works just fine, as indeed *something* is happening, just not the expected thing. There may be an issue with Spotify itself.

Adaephon gravatar imageAdaephon ( 2014-12-17 21:52:19 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-12-18 12:03:09 +0000

Adaephon gravatar image

gnome-settings-daemon is interfering with your key bindings. The keys X86AudioPlay, X86AudioPrev and X86AudioNext are also bound to functions gnome-settings-daemon and depending on whether i3 or gnome-settings-daemon grab the keys first, your i3 key bindings work or you get the image.

It should be possible to solve the issue by removing the key bindings from the gnome settings.

It may be possible to do this from within the Gnome Control Center or you can use the gsettings tool. You can retrieve the current media-key settings with

gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys

By default these keys are bound to the play, previous and next functions and you can unset them with:

gsettings set org.gnome.settings-daemon.plugins.media-keys next ''
gsettings set org.gnome.settings-daemon.plugins.media-keys play ''
gesttings set org.gnome.settings-daemon.plugins.media-keys previous ''

Alternatively, if you do not have gsettings, you can use dconf:

dconf write /org/gnome/settings-daemon/plugins/media-keys/next "''"
dconf write /org/gnome/settings-daemon/plugins/media-keys/play "''"
dconf write /org/gnome/settings-daemon/plugins/media-keys/previous "''"

You can view bindings that have changed from the default configuration with

dconf dump /org/gnome/settings-daemon/plugins/media-keys/
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-12-17 13:47:32 +0000

Seen: 2,038 times

Last updated: Dec 18 '14