This is more of a how to use command line instruction question more than how to add items to the Unity notification panel.
I have to have a one line CLI to add a new item to com.canonical.Unity.Panel systray-whitelist.
Standard procedure for doing so is:
sudo gsettings get com.canonical.Unity.Panel systray-whitelist
We get
['JavaEmbeddedFrame', 'Wine', 'Skype']
Then we do the second command
sudo gsettings set com.canonical.Unity.Panel systray-whitelist "['JavaEmbeddedFrame', 'Wine', 'Skype', 'shutter']"
While that's great and all, it requires people to copy and paste the result from the first line, and for a script i am writing I want to do it in one command.
So far this is what I have:
sudo gsettings set com.canonical.Unity.Panel systray-whitelist | gsettings get com.canonical.Unity.Panel systray-whitelist | sed -e "s/']$/,'shutter']/" | awk 'NF{print "\"" $0 "\""}'
I think I am missing something.
Firstly, I am not sure if I am piping the string into gsettings set function correctly. Secondly, while I think I am parsing the output from gsettings get function correctly, I wouldn't figure out a way to add the " " around the modified result using sed, so I had to pipe another awk command into this mess.
Thanks to anyone that helps.
try this one, replace yourapp with what you need.
– hansioux Jun 15 '12 at 09:22