does anyone know, if there is a way to create a general window rule wich could be applied to any window in focus by linking it to a keyboard-shortcut?
For example:
When I open a file-manager, that is placed in the middle of the screen and has maybe a size of 500x500.
Then I would like to have a shortcut to place it in position 40,32 with a size of 1.542x1.048.
And I would like to be able to use this on any window in focus, not just one specific.
Thenā¦ydotool I guess. Iām not sure how you can ( if itās even possible) to add that as a windowrule for an active window. I mean, you can add the position , size and shortcut to all. But to get is a the active window onlyā¦that I donāt know.
I searched for xdotool in my repository and was suggested kdotool
kdotool.x86_64 : Xdotool-like tool to manipulate windows on KDE Wayland
And I could use your xdotool-code with it, and it works perfectly Thanks!
Maybe ydotool would have done the same, and it also was suggested on the github-page of kdotool for additional funtionality. But for me kdotool is fine.
I made the script like you suggested, put it into my .local/bin and assigned a key-shortcut to it.
Now I can maximize any window on my desktop, without hiding my conky on the right
I have just this one conky. It is the same one I use from when I started using it, about 14 years ago. And it always has the same space.
And now with KDE (I used Unity and Gnome since 2022) I have placed a plasmoid under it for taking notes and above my conky are two ābuttonsā (ārun commandā plasmoids), that zoom in and out by clicking it.
So, this left space is always covered. So I use all applications only to this space (for example my browser is never fully maximized until I watch a video in fullscreen).
And now, with the kdotool-script I donāt even need to drag the size of the windows to the right space, in case I want to. I almost never needed to do this, because the most windows I use are still smaller, and the browser did open in the right place. But itās good to have.
By the way, it could be done even easier, by adding just the command in the shortcut settings of kde. The script in ./local/bin or elsewhere is not needed.
Yes, I know.A script as such is not really needed, no. Not in this case. More elaborate xdotool/kdotool stuff does. For example, I have a script which minimizes all windows except the active one and places it centered on the screen. A bit like the shake function. You canāt put that thing in the shortcut section. But in this case itās just a oneliner soā¦
In realizing that I donāt need a real script for this simple commands solved another problem that I had with kscreen-doctor.
When I switched to wayland I had some issues to switch between monitors and didnāt know how to solve it. The only thing that fairly worked was to write the commands into a script and start them as a application. I donāt know why, but using regular commands either didnāt work or I didnāt set them up right.
But with the monitor-switch as applications I sometimes had trouble with one of the two monitors. Now, that I run the commands as regular commands there are no problems anymore.
And regarding x11, I wouldnāt have switched to wayland in the first place, but one day a nvidia update somehow broke exactly this ability, to switch monitors with xrandr.