You are not logged in.

#1 2012-09-02 09:56:23

steabert
Member
Registered: 2011-04-18
Posts: 78

awesome window manager client rule for "GtkFileChooserDialog"

Hi,

I've set up my current awesome wm so that the web browser (chromium) always opens on tag 2 of screen 1.

When I have an external screen however, I soemtimes like to move the web browser to the external screen.
The problem with my setup is that when I want to e.g. download something, the file chooser dialog opens (of course)
on tag 2 of screen 1, instead of the current tag and screen of the main window of my web browser.

Is there a way to set a rule for clients that are dialog windows to appear floating on the same tag and screen
as the window that started the dialog?

When I wanted to make a rule for this, the first problem I encountered is that the class and name of the dialog or the same as the main window.
So I wondered if I can use other properties of windows besides name, class or instance.

The second problem is that I do not know how to get the screen and tag of the window that opened the dialog?

xprop of main window:

_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_USER_TIME(CARDINAL) = 1953613
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
		Initial state is Normal State.
		bitmap id # to use for icon: 0x100004d
		bitmap id # of mask for icon: 0x100004e
		window id # of group leader: 0x1000001
_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED(CARDINAL) = 1
XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
_NET_WM_ICON(CARDINAL) = 	Icon (64 x 64):
 ... (deleted icons) ...
WM_WINDOW_ROLE(STRING) = "browser"
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 16777288
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1000047
WM_CLIENT_LEADER(WINDOW): window id # 0x1000001
_NET_WM_PID(CARDINAL) = 1164
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "arch"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified minimum size: 266 by 63
		window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "chromium", "Chromium"
WM_ICON_NAME(STRING) = "Post new topic / Arch Linux Forums - Chromium"
_NET_WM_ICON_NAME(UTF8_STRING) = "Post new topic / Arch Linux Forums - Chromium"
WM_NAME(STRING) = "Post new topic / Arch Linux Forums - Chromium"
_NET_WM_NAME(UTF8_STRING) = "Post new topic / Arch Linux Forums - Chromium"

xprop of dialog:

WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MODAL
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
		Initial state is Normal State.
		bitmap id # to use for icon: 0x100004d
		bitmap id # of mask for icon: 0x100004e
		window id # of group leader: 0x1000001
XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
_NET_WM_ICON(CARDINAL) = 	Icon (64 x 64):
 ... (deleted icons) ...
WM_WINDOW_ROLE(STRING) = "GtkFileChooserDialog"
WM_TRANSIENT_FOR(WINDOW): window id # 0x1000046
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 16796216
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG
_NET_WM_USER_TIME(CARDINAL) = 1703990
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1004a37
WM_CLIENT_LEADER(WINDOW): window id # 0x1000001
_NET_WM_PID(CARDINAL) = 1164
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "arch"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified location: 0, 0
		program specified minimum size: 545 by 294
		window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "chromium", "Chromium"
WM_ICON_NAME(STRING) = "Save File"
_NET_WM_ICON_NAME(UTF8_STRING) = "Save File"
WM_NAME(STRING) = "Save File"
_NET_WM_NAME(UTF8_STRING) = "Save File"

So, something like:

{ rule = {window_role = "GtkFileChooserDialog"}, properties = {tag = mainwindow.tag, screen = mainwindow.screen} }

(apologies for the limited pseudo lua-code)

Any kind of help would be much appreciated smile

grtz

Offline

#2 2014-12-01 12:14:04

lauriro
Member
Registered: 2013-04-13
Posts: 2

Re: awesome window manager client rule for "GtkFileChooserDialog"

{ rule = { role = "GtkFileChooserDialog" },
    properties = { floating = true, ontop = true },
    callback = function (c)
        awful.placement.centered(c, nil)
        awful.client.movetotag(tags[mouse.screen][awful.tag.getidx()], c)
    end
}

Offline

Board footer

Powered by FluxBB