Skip to content

How to modify a window based on its role #4719

Answered by elParaguayo
lyndhurst asked this question in Q&A
Discussion options

You must be logged in to vote

The client_managed hook is probably the way to go here.

However, there is a misunderstanding in your post: the client object gives you much more than just the name and you can access the role.

You should therefore be able to do something like:

@hook.subscribe.client_managed
def resize_dialog(client):
    if client.get_wm_role() != "GtkFileChooserDialog":
        return

    client.set_size_floating(new_width, new_height)

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@lyndhurst
Comment options

@elParaguayo
Comment options

Answer selected by lyndhurst
Comment options

You must be logged in to vote
4 replies
@elParaguayo
Comment options

@lyndhurst
Comment options

@elParaguayo
Comment options

@lyndhurst
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants