If you are a KDE poweruser, you may already know and use one of KDE’s most useful widgets: the configurable button. If you have never used these you will soon know how and if you apply all of what I am about to present, your experience of KDE will be smoother and more refined than it has ever been — especially if your system (like mine) uses multiple displays.
The first time I ever used the configurable button widget for something was to insert an xrandr
command in one of these buttons. I was amazed at how wonderfully it worked, changing my external monitor’s screen display with just a click. Here it is:
xrandr --output VGA-1 --gamma .45:.50:.66.
On my dual monitor setup, my 13 inch Dell laptop monitor needed to be brightened up considerably. But this made my external monitor way to bright and I needed to tone it down. Every boot, I had to open a Konsole and run that command. Now all I have to do is click the button as soon as the desktop loads.
In this article I will take you way beyond that. I will show you how to use a plasma qdbus command to trigger with a mouse click any Kwin keyboard shortcut. I will even show you how to combine two or more shortcuts together and activate them with a mouse click. The one with three commands is my favorite:
- Move the window to the next monitor.
- Expand the window horizontally to the right.
- Vertically maximize that window. All done with one click.
Now that I have your attention let me show you how easy this is. All you need to know is a couple of qdbus
commands.
First you need to visit the KDE Store, download and install the configurable buttons widget. Just click to install. Then at your desktop click on the menu to add a widget and type “Configurable”. See it? Good. That is what you are going to be doing a lot of.
I am not a programmer. I got the qdbus
commands courtesy of Luis Bocanegra via KDE Discuss. The first command is what you will need to find the names of all the possible Kwin keyboard shortcuts. Here it is:
qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.shortcutNames
Open Konsole and put that command in it. When the huge list is generated, copy it to an editor for future reference.
I my case I was asking Luis how to move a window to the next screen. He replied I could trigger that shortcut by its Kwin shortcut name, inserted into a similar qdbus
command. You do it like this:
qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "Window to Next Screen";0
You can try this one to get you started. I like to add an ;0
at the end of all these, as suggested by the button itself. That is the whole command you put into a configurable window button. There are two places to enter the command. Use them both.