I'm using zenity
to post a simple notification when my spam-filter daemon filters a group of messages. Currently this message is posted to the middle of the screen, which is obtrusive. I want to post it to the upper left corner. However, zenity
does not honor the -geometry
option which is supposed to be standard for all X applications, and its documentation gives options for controlling window height and width, but not placement.
Is there a way to control the (x,y) coordinate at which a zenity
window is posted?
If not, is there a way to solve this problem by tinkering with X resources or the window manager (I'm using the fvwm
)?
EDIT: The following do not work in ~/.fvwm2rc
(fvwm
version 2.5.26):
Style "Information" PositionPlacement -0 -0
Style "Zenity" PositionPlacement -0 -0
They also don't work with the -0 -0
dropped, as suggested in the man page.
(The window title for zenity --info
is "Information".)
Interestingly, zenity
was ignoring my earlier window-manager directive that windows should be placed manually by default.
EDIT:
Among many other fascinating pieces of information, xprop(1)
reports this about the zenity
window:
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified location: 0, 0
program specified minimum size: 307 by 128
program specified maximum size: 307 by 128
window gravity: NorthWest
WM_CLASS(STRING) = "zenity", "Zenity"
WM_ICON_NAME(STRING) = "Information"
WM_NAME(STRING) = "Information"
Despite this apparently encouraging report, the window is not in fact posted at the location 0,0 :-(
I know the Style
command is taking effect because I added the !Borders
option, and sure enough the zenity
window posts without borders... but still in the center of the damn screen!
I do it by using
wmctrl
in a subshell. Example:First
wmctrl
moves zenity to upper left, second moves it to current workspace. See a full example.You can use
wmctrl
to get the windowid, thenxdotool
to place it wherever you want. Simple and adaptable to many types of environments.E.g.
$> move_win $(pidof zenity) 0 0
Yes, it is definitely possible with the proper help from window manager. For example, with xmonad it would be one line of code...
My fvwm is little rusty, but it seems like something along the lines of:
in your fvwm2rc should do the trick.
EDIT: Notice the lowercase "zenity" since, according to the docs, it should match not only window title, but window class as well (which you can find out using "xprop" utility: launch it and point to window in question).
According to xprop, zenity window has two interesting properties:
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG
, indicating that it is a dialog windowWM_TRANSIENT_FOR(WINDOW): window id # <some window id here>
, indicating the main window for which it is a dialog (in my case - xterm window)So, if my suggestion does not work, then it is almost certainly because fvwm handles dialogs in a special way - either due to configuration or due to hardcoded behavoir.
You can try adding "
EWMHIgnoreWindowType
" to the style of zenity windows, which should hopefuly made fvwm ignore those hintsYou could try using the "old" way of doing this, using FvwmEvent.
If this still doesn't work (or you are determined to get it working using PositionPlacement) you could try
Fvwm will then write debugging output to it's logfile (or to the console, depending on your setup) explaining how it is placing windows (and why it is doing so).
Also just fyi, if you want to get information about a window you can use the FvwmIdent module to get this information (instead of xprop, though both work fine).
Try devilspie: http://burtonini.com/blog/computers/devilspie/