How-to: Notify-osd to the bottom-right of screen.

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

How-to: Notify-osd to the bottom-right of screen.

Postby optimize me on Sun Aug 09, 2009 5:20 am

I was searching for some way to move the notify-osd bubbles from the top right of my screen to somewhere - anywhere - else. I found gold at this site: http://dagus.org/2009/06/09/ubuntu-noti ... he-bottom/

I've used his patch, and it does work as advertised in Gloria Main. I have noticed that when I get a bubble with a large mount of text, as in an email notification, some of the text is chopped off at the bottom of my screen. I think this is because I don't use Gnome panels at all, and if I'm not mistaken, notify-osd positions its bubbles relative to a panel edge. Someone else can feel free to chime in and correct me on that.

If anybody spots any errors or knows a way to streamline this process, feel free to post here or shoot me a message and I'll make the changes.

This entire process takes place in a terminal. If you're afraid of using a terminal, I'm sorry to hear that, and maybe someone will make a script to automate this process.

Let's get started..

Open a terminal and start with the command
Code: Select all
mkdir notify
Of course, you can name it anything you want. I'll be sticking with the name 'notify' throughout this process.

(You can use the text editor of your choice, gedit or whatever. If you opt for a different text editor, I'll leave it to you to create a file 'patch' and save it in the current directory. Simply skip this next step, and just copy and paste the code for the patch however you see fit. I prefer nano so I can stay right inside the terminal.)

***Enter the command
Code: Select all
touch patch && nano patch
Then paste in the following text by pressing CTRL-SHIFT-V or by right-clicking with your mouse
--- notify-osd-0.9.11/src/defaults.c 2009-05-28 23:18:56.000000000 +0200
+++ defaults.c 2009-05-28 23:14:13.000000000 +0200
@@ -2241,15 +2241,13 @@

/* workarea rectangle */
g_object_get (self, "desktop-left", &rect.x, NULL);
- g_object_get (self, "desktop-top", &rect.y, NULL);
+ g_object_get (self, "desktop-bottom", &rect.y, NULL);
g_object_get (self, "desktop-width", &rect.width, NULL);
g_object_get (self, "desktop-height", &rect.height, NULL);
}

*y = rect.y;
- *y += EM2PIXELS (defaults_get_bubble_vert_gap (self), self)
- - EM2PIXELS (defaults_get_bubble_shadow_size (self), self);
-
+ *y -= EM2PIXELS (defaults_get_bubble_min_height (self), self);
if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_LTR)
{
*x = rect.x + rect.width;
Press CTRL-X to write the changes to the file, and press enter to save it to 'patch', which will save the file and then exit the nano text editor, taking you back to your terminal prompt.

Next, you'll need to grab a couple packages. The instructions at the original web-site use apt-src to download the notify-osd package from the repos, and I had to install that. I'm pretty sure the build-essential package is needed here, too, so grab that while you're at it if you don't already have it.

Install the apt-src package:
Code: Select all
sudo aptitude install build-essential apt-src

Then, use apt-src to download the notify-osd package into the 'notify' directory you created.
Code: Select all
sudo apt-src install notify-osd


Once it's complete, change directories
Code: Select all
cd notify-osd-0.9.11/src/
and apply the patch
Code: Select all
patch < ~/notify/patch


Now you have to build the patched program
Code: Select all
sudo apt-src build notify-osd


Finally, go back up two levels (either by using cd .. twice or just cd ~/notify) and use dpkg to install the patched version of notify-osd
Code: Select all
sudo dpkg -i notify-osd_0.9.11-0ubuntu3_i386.deb


That's it! The changes are instant, and don't require you to restart X or reboot. While you're still in the terminal, you can use notify-send to test it out
Code: Select all
notify-send "This is a test."

If all went well and everything works, you're free to delete the 'notify' directory and it's contents. If you have any problems, post them here and we'll see what we can do to help out.

***EDIT: Here is a link to the files that apt-src downloads, plus the patch, all in one tar.lzma archive. You should be able to pick right up from applying the patch step.
http://rapidshare.com/files/266374718/notify.tar.lzma
Last edited by optimize me on Wed Aug 12, 2009 7:44 am, edited 1 time in total.
AMD Phenom II X6 1045T 2.8GHz 8GB DDR3 RAM ATI Radeon HD6970
User avatar
optimize me
Level 5
Level 5
 
Posts: 639
Joined: Wed Jun 03, 2009 5:25 pm

Linux Mint is funded by ads and donations.
 

Re: How-to: Notify-osd to the bottom-right of screen.

Postby emorrp1 on Mon Aug 10, 2009 2:39 pm

cool, hopefully Ubuntu will improve the rather lovely but rough around the edges notifier for next release, including the ability to customise the positioning.
If you have a question that has been answered and solved, then please edit your original post and put a [SOLVED] at the end of your subject header
Hint - use a google search including the search term site:forums.linuxmint.com
emorrp1
Level 8
Level 8
 
Posts: 2322
Joined: Thu Feb 26, 2009 8:58 pm

Re: How-to: Notify-osd to the bottom-right of screen.

Postby Old Marcus on Tue Aug 11, 2009 4:56 pm

When executing 'sudo apt-src install notify-osd' I get this error:
Code: Select all
Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jaunty_main_source_Sources - open (2 No such file or directory)
E: No such source

I have the source repositories enabled in sources.list and I'm executing the command from the notify directory I created.
Linux Mint 8 RC1 = Nice
'apt install' can be used on Linux Mint as a shortcut for 'sudo apt-get install'. 'apt x' can be used for various other apt commands as well.
When a problem is solved, please add [SOLVED] to your thread title.
User avatar
Old Marcus
Level 4
Level 4
 
Posts: 395
Joined: Sun Jun 08, 2008 4:51 pm
Location: Exeter, UK

Re: How-to: Notify-osd to the bottom-right of screen.

Postby optimize me on Tue Aug 11, 2009 5:09 pm

Old Marcus wrote:When executing 'sudo apt-src install notify-osd' I get this error:
Code: Select all
Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jaunty_main_source_Sources - open (2 No such file or directory)
E: No such source

I have the source repositories enabled in sources.list and I'm executing the command from the notify directory I created.

It's not coming from the source repo, it comes from archive.ubuntu.com/main in the origins tab of Synaptic, but that doesn't explain why you're unable to download it. It could be the repos were down for maintenance for a little while... it happens sometimes.

Try grabbing it right out of Synaptic. Once you've marked a package for installation, I believe the option exists to only download the package and not install it. You would then be able to find it (I'm pretty sure) in /var/cache/apt/archives (if not there then use the locate command to find the files it grabs). Just cp it to the notify folder you created and go from there.

EDIT: I just looked up the error you were getting in Google. Are you sure you're set to download software from the internet and not from the install cd? Please check your sources.list file and make sure.
AMD Phenom II X6 1045T 2.8GHz 8GB DDR3 RAM ATI Radeon HD6970
User avatar
optimize me
Level 5
Level 5
 
Posts: 639
Joined: Wed Jun 03, 2009 5:25 pm

Re: How-to: Notify-osd to the bottom-right of screen.

Postby Old Marcus on Tue Aug 11, 2009 6:52 pm

If I was set to install software from the install cd, I wouldn't have installed anything, since I haven't had it in since I installed Gloria. I don't believe it is default, anyway. But no, I am set to download from the internet.

Looking in synaptic, see no option to download source. How do I go about this? I've found the package, but cannot download it, or it's source.
Linux Mint 8 RC1 = Nice
'apt install' can be used on Linux Mint as a shortcut for 'sudo apt-get install'. 'apt x' can be used for various other apt commands as well.
When a problem is solved, please add [SOLVED] to your thread title.
User avatar
Old Marcus
Level 4
Level 4
 
Posts: 395
Joined: Sun Jun 08, 2008 4:51 pm
Location: Exeter, UK

Re: How-to: Notify-osd to the bottom-right of screen.

Postby optimize me on Tue Aug 11, 2009 8:11 pm

Old Marcus wrote:Looking in synaptic, see no option to download source. How do I go about this? I've found the package, but cannot download it, or it's source.

I think you just hit the apply button and in the confirmation window is a checkbox to just download (not install) the package.

I'm not sure that will work, though. There were a couple other things that came with it.

Tell you what: I'm not really sure why apt-src isn't working for you. To be honest, the first time I heard about it was when I followed this tutorial from the web page - I installed it with aptitude and it worked straight away for me.

I just downloaded the source packages into a folder, and along with the patch, placed it into a tar.lzma archive. Even with the high compression ratio lzma gives, it still comes in at 825KB. I don't know if the forums want to host a file that size, so here's a rapidshare link: http://rapidshare.com/files/266374718/notify.tar.lzma

Download it and extract it to your desktop. You should be able to pick up from where the patch is applied. Let me know if you have any other problems.
AMD Phenom II X6 1045T 2.8GHz 8GB DDR3 RAM ATI Radeon HD6970
User avatar
optimize me
Level 5
Level 5
 
Posts: 639
Joined: Wed Jun 03, 2009 5:25 pm

Re: How-to: Notify-osd to the bottom-right of screen.

Postby emorrp1 on Wed Aug 12, 2009 3:15 am

rather than apt-src, you could use the more standard apt sources, any one of the following should work (no need for sudo):
Code: Select all
apt source notify-osd
aptitude source notify-osd
apt-get source notify-osd
If you have a question that has been answered and solved, then please edit your original post and put a [SOLVED] at the end of your subject header
Hint - use a google search including the search term site:forums.linuxmint.com
emorrp1
Level 8
Level 8
 
Posts: 2322
Joined: Thu Feb 26, 2009 8:58 pm

Re: How-to: Notify-osd to the bottom-right of screen.

Postby Old Marcus on Wed Aug 12, 2009 8:58 pm

I'm at the point of patching the program, but I keep getting this error when trying to run 'patch < ~/notify/patch':
Code: Select all
patching file defaults.c
patch: **** malformed patch at line 5: /* workarea rectangle */

I edited the patch file and deleted that line, but I just got another malformed patch error.
Linux Mint 8 RC1 = Nice
'apt install' can be used on Linux Mint as a shortcut for 'sudo apt-get install'. 'apt x' can be used for various other apt commands as well.
When a problem is solved, please add [SOLVED] to your thread title.
User avatar
Old Marcus
Level 4
Level 4
 
Posts: 395
Joined: Sun Jun 08, 2008 4:51 pm
Location: Exeter, UK

Linux Mint is funded by ads and donations.
 

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 6 guests