academo / ww-run-raise

CLI tool to run or raise applications in KDE.
52 stars 11 forks source link

Find from classname #3

Closed ilkerhk closed 1 year ago

ilkerhk commented 1 year ago

Hi,

Thanks for the script. Two questions :

  1. I am wondering if it is possible to search the window using the classname (not the processname).
    (Example usage is chrome apps, the process names are all same but each has a different classname).

  2. This is a small feature request. When activating the window the desktop switches to the desktop of the window. This could be optional with the other option being bringing the window to the current desktop ( I mean something like client.desktop = workspace.currentDesktop; )

PS. I wrote a similar script using xdotool+wmctrl in Xorg which served me 10+ years. But now I moved to Wayland it had to retire. But interestingly my script has almost exactly have the same parameters and functionality with yours :)

academo commented 1 year ago

Hey there. My excuses for such a long time to reply I only now see this.

  1. ww already allows you to search the window with the classname. that is the -f option for it. But maybe you mean the command to check if the window is running?

The problem is that I couldn't find sufficient documentation of how to communicate with kwin scripts via dbus. So I can't run a kwin script and get its output (if any). Ideally the script should first try to raise the window itself and if not then invoke the command instead of try to check if the program is running and then try to raise. If you find a solution for that let me know.

  1. that sounds pretty doable. Feel free to open a PR for it I might not get to work on it until some time later when I need myself new features in the script.