Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 03-05-2010, 08:21 AM   #1
Registered: Jan 2004
Posts: 43

Rep: Reputation: 15
Question Using notify-send with multiple lines in body

Hey all,

I'm trying to setup a hotkey in KDE that will popup a notification with the current playlist I have running in an xmms2 server.

I currently have some hotkeys such as the following actions, which work fine:

xmms2 prev; notify-send "Currently Playing" "`xmms2 current`"
xmms2 next; notify-send "Currently Playing" "`xmms2 current`"
That works fine. However, if I want to popup the current playlist, I would want to do something like the following:

notify-send "Current Playlist" "`xmms2 list`"
But the playlist has newline characters, which apparently notify-send doesn't I've been looking for a way to clear out the newline characters - and ideally replace them with something notify-send can display as newlines (e.g., HTML with <br> tags?).

I've tried using sed to do this, but I don't know enough about it. From what I can tell, the following has no effect on the output (nor do any variations I have tried thus far):

xmms2 list | sed '{s/\n/<br>/g}'
I've searched around online, but there are far too many examples of what I don't want to do that are drowning out what I do want to do. I'm pretty sure I've even asked something very similar myself, but can't find where that was.

Anyone have any recommendations?
Old 03-06-2010, 07:53 PM   #2
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
I think xmms2 has configuration options to modify the output of the list command, maybe it has an html/xml option
Old 03-10-2010, 04:09 AM   #3
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
I've never seen any problem when dealing with notify-send in this regard.

Can you test something simple like this and see if it works?

$ notify-send foo "bar


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Libnotify and notify-send problems J_Humphrey Slackware 8 07-27-2010 04:43 PM
Due to the animosity to undescriptive subject lines, little now is left for the body mark_alfred LQ Suggestions & Feedback 12 08-16-2009 01:01 PM
using notify-send ashikahamed Ubuntu 0 05-02-2008 06:09 AM
can some body send me the linux video classes satishchilur Linux - Server 8 04-30-2008 05:31 AM
log send, sendrec, recv and notify system calls xeon123 Other *NIX 1 02-04-2008 05:26 PM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:22 AM.

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