You are not logged in.

#1 2011-02-04 09:23:21

mohtasham1983
Member
Registered: 2008-12-15
Posts: 85

Adding system wide shortcut to ncmpcpp

Hi,

After using Amarok for a long time, I got really tired of its bugs and the amount of resources it uses. That's why I decided to use mpd and ncmpcpp to listen to my music and I'm pretty happy with it so far. The only thing I'm missing is not being able to control music using system wide shortcut keys.

My keyboard has multimedia keys for controlling music, but I cannot find anywhere in ncmpcpp config file to assign them to certain behaviors.

Any idea how I can create those shortcut keys?

Thanks in advance.

Offline

#2 2011-02-04 10:46:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Adding system wide shortcut to ncmpcpp

Please search before asking - the wiki has a ncmpcpp page, and there are various relevant threads here too.

Offline

#3 2011-02-05 00:05:35

mohtasham1983
Member
Registered: 2008-12-15
Posts: 85

Re: Adding system wide shortcut to ncmpcpp

The Wiki page just shows how you can remap shortcut keys, but it doesn't say how you can make them system wide. I want to control my music playback without when my ncmcpp window is not focused as well.

I cannot find any thread on Arch Forum related to this, either. Would be glad if you send me some links.

Thanks

Offline

#4 2011-02-05 00:25:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Adding system wide shortcut to ncmpcpp

ncmpcpp wiki page wrote:

ncmpcpp/mpd work together in a client/server relationship.

If you want system-wide control, you are looking to control the server, not the client...

Almost all of the wm-specific threads on the boards have examples of people binding multi-media keys to volume and playback controls.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2011-02-05 10:19:19

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Adding system wide shortcut to ncmpcpp

mohtasham1983 wrote:

The Wiki page just shows how you can remap shortcut keys, but it doesn't say how you can make them system wide. I want to control my music playback without when my ncmcpp window is not focused as well.

I cannot find any thread on Arch Forum related to this, either. Would be glad if you send me some links.

Thanks

ncmpcpp has cli switches. "e.g. ncmpcpp play". just create hotkeys for those commands. if you want a bit more power for your hotkeys use mpc instead.


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#6 2011-02-06 00:05:10

mohtasham1983
Member
Registered: 2008-12-15
Posts: 85

Re: Adding system wide shortcut to ncmpcpp

Well, I finally figured it out how to do that under gnome.

I installed mpc first. Then added shortcut keys to gnome shortcut key manager. The corresponding commands for each shortcut key would be something like mpc stop, mpc toggle, mpc prev, mpc next and so on.

Thanks a lot for the help.

Offline

Board footer

Powered by FluxBB