I changed my wallpaper and theme yesterday and was quite happy with it, until one of those cool new notifications popped up in it's default white-on-black color scheme. I couldn't find a way to change it's colors, so I downloaded the source, poked around, and hacked this together. Check the attached screenshots for final results.
default.png - this is what your notifications look like now.
blueish.png, uglyred.png - these are some changed colors using the following howto.
this code is not supported by the notify-osd authors at all. But it's a pretty small hack
Follow these steps to build a version of notify-osd that allows you to change the background color/opacity and text color/opacity. Note that this is only tested on the current Ubuntu Jaunty version, 0.9.11
1. download & install dependencies
install basic development tools:
Code:
sudo apt-get install build-essential libnotify-bin
get the required libraries to build notify-osd:
Code:
sudo apt-get build-dep notify-osd
2. download notify-osd source including any ubuntu patches
note that you should not use 'sudo' for this next command. I am doing this in my '/tmp' directory, but you can do it wherever you please. If you do it elsewhere, make sure wherever you see /tmp below you use your directory.
Get the source:
Code:
cd /tmp
apt-get source notify-osd
You should now have a folder named 'notify-osd-0.9.11'
3. download and apply the attached patch file
right click on the attached .patch.txt file. choose to save it in the same directory you fetched the source (in my case, /tmp).
Apply the patch:
Code:
cd /tmp
cd notify-osd-0.9.11/src
patch < ../../notify-color-hack.patch.txt
There should not be any errors.
4. build a new notify-osd
Configure and build notify-osd:
Code:
cd /tmp/notify-osd-0.9.11
./configure --prefix=/usr
make
There should not be any errors.
5. Test that it works
save the following file as ".notify-osd" in your home directory:
Code:
bubble-background-color = 6D84B4
bubble-background-opacity = .85
text-title-color = ffffff
text-title-opacity = 1.0
text-body-color = ffffff
text-body-opacity = 1.0
stop the current notify-osd:
start our new notify-osd:
Code:
cd /tmp/notify-osd-0.9.11/src
./notify-osd
You should see the following:
reading settings from '/home/<youruser>/.notify-osd'
And the program should stay open. If it says:
** (notify-osd:5373): WARNING **: Another instance has already registered org.freedesktop.Notifications
Then go back to the 'killall' step and try again.
Now, do something to cause a notification. In a new terminal window enter:
Code:
notify-send "test" "this is a test"
You should (hopefully) see your notification in white text on a dark blue background.
You can now kill the notify-osd we started earlier by hitting control+C in it's terminal window.
6. Install our new notify-osd
Install our new notify-osd over the current install:
Code:
cd /tmp/notify-osd-0.9.11
sudo make install
Now make sure our version is the running version:
Code:
killall notify-osd
notify-send "test" "this is a test"
7. Customizing the colors
edit the file ~/.notify-osd to edit the colors. Because this is a quick hack, make sure that each line follows the format "key = value" including the spaces around the equals sign. It's lame, I know.
*-color entries change the color of that item. For example, bubble-background-color changes the notification window color. The value for these entries is a html-style color without the leading "#". E.g,
Code:
bubble-background-color = c0c0c0
will give you a light gray window.
*-opacity entries change the opacity (transparency) of that item when compiz is enabled. "1.0" means entirely opaque. "0.0" means entirely transparent (invisible). E.g,
Code:
bubble-background-opacity = 0.75
Will give you a window that is 75% opaque.
If you make changes to the configuration file you must kill the current running notify-osd process ('killall notify-osd') before you will see the changes. You don't need to restart it as it will restart automatically next time it is needed.
Hope this is useful for someone!
Bookmarks