Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Wayland replacements for xdotool, wmctrl, devilspie2

  1. #1
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,266
    Distro
    Ubuntu

    Post Wayland replacements for xdotool, wmctrl, devilspie2

    For my own purposes, I've been documenting Wayland replacements for xdotool, wmctrl and devilspie2, all of which I use extensively (Ubuntu 22.04, running X.Org instead of Wayland).

    I've created a table, which I'll add to when (if!) replacements become available, or if someone posts suitable replacements in the comments.

    For now, this table is mostly empty, meaning that I still cannot use Wayland without considerable inconvenience. I have to stick to X.Org for now.


    X.Org tool Wayland equivalent
    xdotool --clearmodifiers Unavailable
    xdotool type [pattern] ydotool type [pattern]
    Comments:
    ydotool (for now) needs to be manually installed, configured and enabled.
    The one in the standard repositories (22.04) is badly out of date.
    xdotool key [key]
    E.g.
    xdotool key super+F1
    ydotool key [key]:1 [key]:0
    E.g.
    ydotool key 125:1 59:1 59:0 125:0
    Comments:
    ydotool uses key codes instead of symbolic names.
    Get the codes from file /usr/include/linux/input-event-codes.h
    You usually have to be precise about key-down (:1) and key-up (:0).
    xdotool search --pid=[pid]
    xdotool search --name [name]
    xdotool search --onlyvisible
    Unavailable
    xdotool getwindowfocus
    xdotool getwindowfocus getwindowname
    xdotool getactivewindow
    xdotool windowfocus
    xdotool windowraise
    xdotool windowmove
    [window ID][edge]% y
    Unavailable
    wmctrl -d
    wmctrl -i -a
    [window ID]
    wmctrl -i -r
    [window ID] -b add,maximized_vert
    wmctrl -i -r
    [window ID] -b add,skip_taskbar
    wmctrl -i -r
    [window ID] -t [desktop]
    Unavailable
    devilspie2 Unavailable


    This is a pretty poor show, unfortunately. I hope that it improves massively before X11 finally sees its final deprecation. It has served us well, and will deserve its retirement.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    X11 isn't going anywhere. I haven't seen any solution for UNIX or BSD that is ready.

    Don't know if you saw that a serious X11 bug was uncovered a few days ago that has been around a long time. Just another reason why X11 needs to have all remove connections go through ssh tunnels, not direct.

  3. #3
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,266
    Distro
    Ubuntu

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    Quote Originally Posted by TheFu View Post
    X11 isn't going anywhere. I haven't seen any solution for UNIX or BSD that is ready.
    Thanks. Do you know if people are working on solutions? ydotool isn't even half-baked compared to xdotool.
    Quote Originally Posted by TheFu View Post
    Don't know if you saw that a serious X11 bug was uncovered a few days ago that has been around a long time. Just another reason why X11 needs to have all remove connections go through ssh tunnels, not direct.
    I didn't see that. (I presume that you meant "remote", not "remove"?) I have read many items on the 'net talking of X11's security flaws in general.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    There will never be 100% replacements for all those listed desires. That's because many of the things that X11 allows are possible due to poor security. Wayland would need to write specialized code to allow many of them, while not violating DRM agreements. Seeks that support for DRM video is more important than usability. An argument each way is possible. In general, better security is best for all of us, right?

  5. #5
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,266
    Distro
    Ubuntu

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    Quote Originally Posted by TheFu View Post
    There will never be 100% replacements for all those listed desires. That's because many of the things that X11 allows are possible due to poor security. Wayland would need to write specialized code to allow many of them, while not violating DRM agreements. Seeks that support for DRM video is more important than usability. An argument each way is possible. In general, better security is best for all of us, right?
    Of course, I would agree with that.

    And yet, ydotool is able to emulate typing and pressing other keys, as well as emulating the mouse. Is it too much to ask to be able to manipulate windows as well? Simple things that make my life massively easier, such as automatically positioning my Gedit window when I open it, because it never remembers where I put it. Or automatically sizing my Gnome terminal to maximum height, because it loves to make itself shorter and shorter as I open and close tabs.

    A system that makes life harder than the older system is less secure than the older one, for the same reason why forcing people to change their password every two months is less secure than letting them keep their password. In other words, I'm not going to change to Wayland until it's usable for me.

    Luckily, some apps still work, such as my password manager (KeepassXC). But that's not enough, by any means.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  6. #6
    Join Date
    Apr 2007
    Beans
    3,120
    Distro
    Ubuntu

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    One of the issues is that Wayland is fragmenting. While tools for Xorg would work on any desktop, each Wayland compositor has its own set of protocols.

    Following items are valid for Gnome Desktop only.

    The extension "Run or raise" by e2rd covers for the tool "jumpapp", a bash script that relies on "wmctrl" to implement run or raise style shortcut keys, i.e., a shortcut combination that brings the application in the foreground if it is already running, or otherwise starts it up.

    Functionality to automatically move a window to a specific workspace (one of the possibilities of devilspie) is provided by the extension Auto Move Windows by fmuellner.

    Other extensions open possibilities for custom scripting. (Window Calls by domandoman and Window Calls Extended by hseliger) expose dbus calls in Gnome Shell that allow to manipulate windows from the command line (resize, move to another workspace, etc). The extension Activate Window By Title by lucaswerkmeister allows to activate a window, whereas the extension Focused Window D-Bus by flexagoon allows to retrieve the title an class of the currently active window.

    For me, having ydotool and wl-clipboard for expanding text snippets, and run-or-raise for launching/switching to applications, has been enough to make the move to Wayland. I am lacking window manipulation facilities, but I can live with that. I mostly use applications full screen, and most do remember that position. Evince annoyingly cannot automatically maximized when launching new PDFs. I used devilspie to correct that. I now rely on an ugly workaround, which is OK for practical purposes.

  7. #7
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,266
    Distro
    Ubuntu

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    Quote Originally Posted by vanadium View Post
    One of the issues is that Wayland is fragmenting. While tools for Xorg would work on any desktop, each Wayland compositor has its own set of protocols. …
    That is disappointing indeed!

    Thanks for the information. I'll have to add those to my notes and test them.

    It's a bit depressing, really, as I don't have the time any more to look at these.

    Oh well.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  8. #8
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    Evince has become an abomination because it doesn't work with window decorations. I want/need all windows to have a similar border like all the others, under the control of the WM, not the app. I'd like the title, buttons, colors, scrollbar, and resizing to all work the same across all windows, regardless of where they are running (I run about 80% of my GUI programs on remote systems).

    Someone needs to tell the Wayland people - just because MS-Windows does it that way, it doesn't make it a good idea.

  9. #9
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    Quote Originally Posted by TheFu View Post
    Evince has become an abomination because it doesn't work with window decorations. I want/need all windows to have a similar border like all the others, under the control of the WM, not the app. I'd like the title, buttons, colors, scrollbar, and resizing to all work the same across all windows, regardless of where they are running (I run about 80% of my GUI programs on remote systems).

    Someone needs to tell the Wayland people - just because MS-Windows does it that way, it doesn't make it a good idea.
    I totally agree!

    In fact I'd go further and say that many of the dedicated gnome applications have become abominations as far as their GUI is concerned, eg nautilus (files), gthumb, etc.

  10. #10
    Join Date
    Nov 2012
    Beans
    5

    Re: Wayland replacements for xdotool, wmctrl, devilspie2

    I like KDE Plasma but dropped it for XFCE when I saw that only wayland would be supported with Plasma 6. This has since been proven incorrect and I've been keeping an eye on functionality that might support my X11 activities. There's a new tool, kdotool, that handles the input and window management side using kwin scripts and dbus interfaces. Also I prefer dotool to ydotool. So I'll probably move to kde again and use wayland once 6 is stable and widely supported.



    X.Org tool Wayland equivalent
    xdotool --clearmodifiers Unavailable
    xdotool type [pattern] echo [pattern] | dotool
    Comments:
    Your user needs to be in group, input.
    xdotool key [key]
    E.g.
    xdotool key super+F1
    echo key shift+1 x:exclam shift+k:2 | dotool
    xdotool search --pid=[pid]
    xdotool search --name [name]
    xdotool search --onlyvisible
    kdotool search [name]
    you could search names and check the pids with getwindowpid
    onlyvisible is missing in kwin
    xdotool getwindowfocus
    xdotool getwindowfocus getwindowname
    xdotool getactivewindow
    xdotool windowfocus
    xdotool windowraise
    xdotool windowmove
    [window ID][edge]% y
    kdotool getactivewindow
    kdotool getactivewindow getwindowname
    windowstate can return above, below, skip_taskbar, skip_pager, fullscreen, shaded, demands_attention
    windowactivate, windowraise and windowmove all work
    wmctrl -d
    wmctrl -i -a
    [window ID]
    wmctrl -i -r
    [window ID] -b add,maximized_vert
    wmctrl -i -r
    [window ID] -b add,skip_taskbar
    wmctrl -i -r
    [window ID] -t [desktop]
    kwin is quite powerful allowing some of the functions directly and some from kdotool
    devilspie2 kwin is quite powerful allowing some of the functions directly and some from kdotool.
    I was disappointed with devilspie's abilities compared to kwin but your use may be
    different.
    Last edited by kiwi9; 4 Weeks Ago at 11:46 PM.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •