l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2002 Sep 10 13:56

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] cdcd
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] cdcd

I've been listening to CDs a lot at work lately (for the past two years,
I pretty much never did for some reason)

Anyway, I installed a little tiny CD player applet into one of my gnome panels,
but have found that I always forget to pause before I lock my screen...
and that if I need to pause (or do anything else), I have to use the mouse.

"So?" you might be asking.  Well, I almost NEVER use the mouse at work.

If I want a terminal, I hit F1.  Need a new Netscape window? F2.
Minimize a window?  Keypad-Minus.
Vertically maximize my terminal?  Keypad-PgUp.
Lock my screen?  Pause.

Heck, I can even slide windows around using the Keypad-Arrow keys! :)

This is all thanks to the SawFish window manager, and its nifty keybinding
("Shortcuts") feature.

So, I decided I'd figure out how to control my CD player with keys
(since I don't have one of those ridiculous "internet keyboards" with
dozens of buttons at the top).

I poked around dselect until I noticed "cdcd", a command-line and console
CD player.

It has just what I need!  I can run the command:

  cdcd pause

...and it'll pause the track.  Or:

  cdcd resume

...and it'll unpause.  And so forth.

Since I didn't see any obvious "toggle pause/unpause" option,
I decided to whip up the following little Perl script, which I now
have bound to my "Break" key (Shift+Pause; so if I want to walk away
from my computer, I can just hit Shift+Pause, Pause, and it'll pause my
CD and lock my screen):

--------------------------------------------- toggle_cd.pl ----------------

my $i=`cdcd status`;

if ($i =~ m/^Playing /)
  system "cdcd pause";
elsif ($i =~ m/^Stopped/)
  system "cdcd play";
elsif ($i =~ m/^Paused /)
  system "cdcd resume";

For changing tracks, I just bound the commands "cdcd next" and "cdcd prev"
to Shift+Keypad-Right and Shift+Keypad-Left.

Anyway, thought I'd share it with everyone, cuz it's pretty nifty,
and doesn't need any bloated apps like XMMS.  (Just a bloated windowmanager ;)

("cdcd" was an approx. 86K download via apt-get)

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!