You are not logged in.

#1 2012-02-05 21:19:45

chimeracoder
Member
From: New York
Registered: 2010-10-24
Posts: 73

Prevent notify-send from grabbing focus in xmonad

I just started using xmonad, and I've got most of the wrinkles ironed out, but this one still bugs me. I use pidgin + libnotify, and whenever a notification pops up, it grabs focus, meaning I can't type anything for a minute (unless I move my mouse and close it). This is particularly annoying when I'm having a chat back-and-forth, and I get notifications from that window/another chat window.

(I know I can turn off the notifications when the window is currently open, but it doesn't solve the larger problem of notifications grabbing focus when I'm typing in a separate screen).

Offline

#2 2012-02-05 21:42:20

Raynman
Member
Registered: 2011-10-22
Posts: 1,093

Re: Prevent notify-send from grabbing focus in xmonad

What do you use to handle the notifications? I have no focus-grabbing issues with notification-daemon.

Online

#3 2012-02-05 21:46:49

chimeracoder
Member
From: New York
Registered: 2010-10-24
Posts: 73

Re: Prevent notify-send from grabbing focus in xmonad

Hmm, I thought I used that as well, but seems like it's not installed, on second thought. Here's what I do have, though:

$  pacman -Q | grep notif
haskell-hinotify 0.3.2-1
libnotify 0.7.4-1
pidgin-libnotify 0.14-4
python-notify 0.1.1-10
startup-notification 0.12-2
xfce4-notifyd 0.2.2-2

pidgin-libnotify is the plugin that I've enabled (within pidgin) to send the notifications. But the problem is not just there, since I have the same issue when I run $ notify-send "foo".

Last edited by chimeracoder (2012-02-05 21:46:59)

Offline

#4 2012-02-05 21:55:24

Raynman
Member
Registered: 2011-10-22
Posts: 1,093

Re: Prevent notify-send from grabbing focus in xmonad

You have xfce4-notifyd. If that wasn't a conscious choice, you can switch to notification-daemon. Otherwise, you'll have to figure out if you can get the xfce thing to behave better (very quick google search turns up some similar problems, no clear solution).

Online

#5 2012-02-05 22:17:49

chimeracoder
Member
From: New York
Registered: 2010-10-24
Posts: 73

Re: Prevent notify-send from grabbing focus in xmonad

That was not a conscious choice; I just switched from xfce, so that makes sense.

I uninstalled xfce4-notifyd, installed notification-daemon, and reinstalled pidgin-libnotify (for good measure). The notifications still work, so I'm assuming notification-daemon is working properly, but the focus still gets grabbed.

Do you use pidgin as well, or just notification-daemon? I still get the same issue when I do notify-send, which makes me believe it's not pidgin's problem, but maybe not.


This website seems to imply that it's an xmonad configuration issue, but I'm not that familiar with Haskell/xmonad's configurations. Is it possible to alter this behavior *only* for notify-send events, but not anything else that might display an urgent window?

Offline

#6 2012-02-06 21:55:30

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

Re: Prevent notify-send from grabbing focus in xmonad

Yeah it's probably a problem with your window manager. I had this with xfwm and xfce4-notifyd with some particular settings of xfwm that had to do with focus stealing prevention (enabling it caused the focus stealing, go figure.) I unfortunately can't help with xmonad's configuration...

Offline

#7 2012-02-24 18:31:45

mobius
Member
Registered: 2012-02-24
Posts: 1

Re: Prevent notify-send from grabbing focus in xmonad

Ah-hah! Here is the solution that worked for me.

My xmonad.hs has a section that looks like this....

myManageHook :: ManageHook

myManageHook = composeAll [
    className =? "Xfce4-notifyd" --> doF W.focusDown
    ]

This returns the focus to where it was before. My other problem with Xfce4-notifyd is that the notification only appeared on the workspace I was using. To make it appear on all workspaces, modify the above line so that it also does a "copyToAll".

className =? "Xfce4-notifyd" --> doF W.focusDown <+> doF copyToAll

Be sure to include this import if you don't have it already.

import XMonad.Actions.CopyWindow

Offline

#8 2012-02-27 16:08:31

frep45
Member
Registered: 2012-02-27
Posts: 1

Re: Prevent notify-send from grabbing focus in xmonad

mobius wrote:

doF W.focusDown <+> doF copyToAll

I found that using "doIgnore" instead will both avoid stealing of focus, and leave it visible on all workspaces.

Offline

#9 2012-02-29 14:02:28

Wilco
Member
Registered: 2008-11-09
Posts: 431

Re: Prevent notify-send from grabbing focus in xmonad

Haven't found a way to do this in Icewm. The ubuntu osd notifier does not work very well because you cannot set the display time. So I just stick with conky to display my current settings.

Offline

Board footer

Powered by FluxBB