LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-19-2010, 12:47 AM   #1
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
XMMS2 not working properly?


Hello all. I am currently trying to make a front-end (client) for xmms2. However, I have run into a road block. I need to get the current number of seconds of the current playing song, so one would think to use:

Code:
xmms2 current "${playtime}"
However, all this does is return a blank line. Infact, if I try to do any "formatting" for the "current" command like the man page suggests, I just get a blank line. Does anyone know why this is?

I can't use:

Code:
xmms2 status
Because it is a non-stopping loop.

By the way, why is xmms2 so completely un-documented? I have never in my life seen a piece of software with less documentation and on-line community.
 
Old 01-19-2010, 08:05 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Buster (Fluxbox WM)
Posts: 1,390
Blog Entries: 52

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
You need to single quote the format argument, so that the shell doesn't try to expand it first, eg:
Code:
xmms2 current '${duration}'
My version of xmms2 doesn't have the playtime parameter, so I can't test that here, but the duration parameter worked.
 
Old 01-19-2010, 09:41 PM   #3
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Original Poster
Rep: Reputation: 32
Thank you so much! That worked great.

I am just curious though... what is the difference? Could you explain and make me a little smarter?
 
Old 01-19-2010, 10:23 PM   #4
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Buster (Fluxbox WM)
Posts: 1,390
Blog Entries: 52

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
The '$' sign is used to indicate a format for xmms2. However, it also has a meaning in the shell. Because the shell sees the '$' first, it expands it out. There is no value 'playtime' in the shell, so it expands to an empty string. That empty string then gets passed in to xmms2, which sees an empty format string, and so it prints an empty line.

Using single quotes tells the shell not to expand anything inside the quotes. The whole string then gets passed in to xmms2, which is able to interpret it.
 
Old 01-19-2010, 10:29 PM   #5
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Original Poster
Rep: Reputation: 32
Cool! Thanks for the lesson... do you have any idea how to get the elapsed time in xmms2? I can get "${minutes}", "${seconds}", and "${duration}" but I have yet to find out how to get the elapsed time. Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xmms2 question Strahan Linux - Software 3 05-26-2009 12:22 AM
Sound not working properly grassblade Linux - Newbie 1 04-03-2007 05:33 PM
CUPS! cannot get ti working properly!! ukpete1969 Linux - Networking 1 10-03-2006 10:36 AM
yum not working properly or I think so. raxxal Fedora 1 04-06-2005 11:22 AM
X not working properly. MylesCLin Linux - Software 1 09-15-2004 11:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration