Is there a DBus command to toggle auto-hide on a KDE Plasma panel?

8

2

Is there a DBus command (or some other way from the command line) to toggle auto-hide on a panel in KDE Plasma? (I'm running KDE 4.6.)

I have a game I run in WINE that doesn't work right if it's autohidden and it would be nice to run it from a script that takes care of that for me.

Patches

Posted 2011-03-05T04:51:12.153

Reputation: 14 078

Answers

2

You can do it easily through plasma desktop scripts, like this:

auto-hide on:

var panel = panelById(panelIds[0])
panel.hiding = 'autohide';

auto-hide off:

var panel = panelById(panelIds[0])
panel.hiding = 'none';

The bad news is there is no way to programatically run the script when you want it except perhaps for some kind of keyboard+mouse automation.

The closest you can get (per this discussion on KDE forum) is open the script in desktop console via

qdbus org.kde.plasma-desktop /MainApplication \
    loadScriptInInteractiveConsole /path/to/js/file

There is bug #238817 in KDE Bugzilla filed on this.

che

Posted 2011-03-05T04:51:12.153

Reputation: 266

Hi, the above code is not working for me. For instance, if I run panel.height=30, it responds and changes accordingly. However, changing panel.hiding gives me no response.

Also, to run it programmatically, why does something like @dufferZafar's answer work?

I am running KDE Plasma 5.15.5 – Ekanshdeep Gupta – 2019-07-04T23:46:48.493

Yeah, scripting is pretty useless if you can't execute them! Accepting for now. (BTW, I voted for your RFE bug. :-) – Patches – 2011-06-16T04:36:25.947

2

As of July 2018, the answer suggested by @che doesn't work.

Here is something that does work though:

qdbus org.kde.plasmashell /PlasmaShell evaluateScript "p = panelById(panelIds[0]); p.height = 32 - p.height;"    

32 is the height I like. Set that to a different number as you like.

Relevant KDE Bug: https://bugs.kde.org/show_bug.cgi?id=396796

dufferZafar

Posted 2011-03-05T04:51:12.153

Reputation: 21

0

There is a kwin script that toggle panel

https://www.opendesktop.org/p/1266534/

and

https://www.opendesktop.org/p/1269113/

We can also add more feature to a panel by setting it up in (KDE System Settings - Window Manager - Window Rules - New - Detect Window Properties "And select your pannel"

intika

Posted 2011-03-05T04:51:12.153

Reputation: 839

-1

I think you should check Re: Documentation for the dbus methods for plasma and for some example of how to use dbus Lauching K menu with DBus.

If a method is present it will easy to find.

dvd

Posted 2011-03-05T04:51:12.153

Reputation: 212

I've been looking through qdbusviewer properties of krunner, kwin, and especially plasma-desktop, but there was nothing that seemed related to the Plasma panel :( There was no item for plasma itself. – che – 2011-06-04T19:34:03.000

Tried to chat with some kde-geek? Forum, irc and mailing list of kde project can help. That problem of no item for plasma is really odd. – dvd – 2011-06-05T06:43:51.320

I was hoping to get around this kind of research by asking the question here :-) – che – 2011-06-05T13:37:42.353