There is no scripting interface to set a panels "Visibility" option. Additionally, if this option (for my test it was [PlasmaViews][Panel 173]panelVisibility in ~/plasmashellrc) is changed in a script or with kwriteconfig5, calling the panel's reloadConfig() method does not reload this option. To me the issue appears to partially stem from this particular option not being saved in the same file and group as other panel options, so I think reloadConfig() does not catch the change. As far as visibility not being scriptable, I'm not surprised it hasn't been caught because it's probably not common, I came across this with a pretty obscure use-case. Anyway, it looks like this other bug is related: https://bugs.kde.org/show_bug.cgi?id=396796 , bug id #396796 In my personal case, I want to toggle between panelVisibility 0 and 3 which are "Always Visible" and "Windows Can Cover." I can get the same functionality I need by going another route, but I think it would be better if I could do it with plasma scripting. To be clear, I would expect that the Panel object in the scripting interface would have a method to change the visibility option. Additionally, if this option gets changed, the reloadConfig() method should reflect the changed option.
panel.hiding = "windowscover"; should do the trick. Other values are "windowsbelow", "autohide", and "none".
(In reply to Kai Uwe Broulik from comment #1) > panel.hiding = "windowscover"; should do the trick. Other values are > "windowsbelow", "autohide", and "none". Strangely enough, when I do it this way, it stores that value, and I can recover it between plasma sessions, but the value has no effect, and it is not reflected in the relevant configuration key. I'll try this with a fresh user, and I'll also try it with only a single monitor, since I have seen some bugs be related to my multiple monitor configuration.
(In reply to Kai Uwe Broulik from comment #1) > panel.hiding = "windowscover"; should do the trick. Other values are > "windowsbelow", "autohide", and "none". It works on my laptop, so I'll try to narrow down what is different from my PC