Controlling your media player

In my previous post, I promised I’d show how to control your media player to skip to the next song when you press a combination of keys. Admittedly, I should’ve posted this earlier (especially since it’s not that big a post), but better late than never, isn’t it?

The basic idea is that you can run a command with so-called arguments. Most (if not all) media players on Linux also take arguments to skip to the previous or next song in your playlist, or to play/pause the current track. This is extremely useful if you just want to listen to music without the program you use to play it bothering you.

You know how to find the command of your media player (I explained it in Your wish is Xubuntu’s command). My media player is Exaile, the command of which is “exaile”. This is what I’ll be using in this post, but you can replace it by the command of your preferred media player.

To find out which arguments a program takes, you have to resort to a terminal window (Applications->Accessories->Terminal). From there, you can read a program’s manual by typing man <command>, so I’d use man exaile:
Exaile's man page
You can read through it by using the arrow keys and exit the manual by pressing “q” (so “Esc” won’t work!).

Some programs don’t have a manual, but if they don’t, they mostly take the --help argument, which gives you an overview of all other arguments available. I’d use exaile --help:
exaile --help

As you see, Exaile supports both of these commands. It doesn’t really matter which I use, both tell me I can skip to the next song with the --next argument (or -n), to the previous one with --prev (or -p), and play/pause (depending on its current state) with --play-pause (or -t, from toggle).

Knowing that, I opened up the Keyboard Settings (Applications->Settings->Keyboard Settings) and in the Shortcuts-tab I set the commands exaile --prev, exaile --play-pause and exaile --next to some keyboard shortcuts. I could then control Exaile using my keyboard! Now, every time I start Exaile I minimize it to the system tray so that it would just be an icon in my panel. Using the “LibNotify Plugin” I get a notification which song I skip to, making my media player as unobtrusive as possible:

Xubuntu Feisty just installed - Cool, integration!

Customisations like this are the reason I love using Xubuntu – it adapts to you instead of the other way around. It are these little things that makes using a computer just that extra bit more pleasant.

10 Responses to “Controlling your media player”


  1. 1 n2j3 16 June 2007 at 12:46 pm

    Nice post there Vincent! Here’s some commands for those of us that use Quod Libet as their audio player – http://www.sacredchao.net/quodlibet/
    quodlibet --previous
    quodlibet --play
    quodlibet --play-pause
    quodlibet --pause
    quodlibet --next
    I think they’re self-explantory. QuodLibet has the ‘advantage’ of automatically starting minimised, so all you need is another shortcut for firing it up , further reducing mouse movement, clickedy clicks etc.

  2. 2 Vincent 16 June 2007 at 12:52 pm

    Thanks n2j3. And I suppose you don’t need another shortcut for firing it up, because if you run e.g. quodlibet --play-pause while Quod Libet is not running, it will automatically start Quod Libet. Same goes for Exaile.

    Anyone else have any commands you’d like to share?

  3. 3 n2j3 16 June 2007 at 3:32 pm

    Nope, I realise that what you’re suggesting’s more intuitive but --play-pause doesn’t start QL:/

  4. 4 Vincent 16 June 2007 at 3:38 pm

    Wow… You even keep track of the comments?😛

    /me installs Quod Libet…

    Ah, you’re right. Well, doesn’t matter that much, really. There are more than enough key combinations on a keyboard😉

  5. 5 moa 8 August 2007 at 11:55 am

    “quodlibet –start-playing” just works fine🙂

  6. 6 Claudio 3 June 2008 at 6:54 pm

    Hi.. I’m a blender user, and i switched from ubuntu to xubunto for his lightness…
    Now, bleder uses a very important shortcut for selecting edges loops, alt+rbm … Do you know ho to disable it? I tried both from keyboard preferences, and from window manager.. without any results..
    any idea?

  7. 7 Vincent 3 June 2008 at 7:05 pm

    Hi Claudio,

    Unfortunately, I wouldn’t know how to. You might find help at the Xfce mailinglist though. If you’d like, I could forward your question.

    Blender’s a very good application though, I like your 3D work🙂

  8. 8 Claudio 3 June 2008 at 8:33 pm

    Hi, thank you for your helpful reply… I tried to post on the mailing list hoping that someone there will be able to help….

    i found this page, but it doesn’t seems working, at least for me…

  9. 10 Me 9 November 2010 at 3:26 am

    Ah ! Thank you SO much !! This was extremelly useful !


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




a


%d bloggers like this: