12

I Have a script that change my desktop layout using xrandr, but I also want to move my Panel.

So far I played round with kwinscripts, using
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.showInteractiveConsole

If i move it using the mouse, the panel.screen changes between 0 and 2, but the script row panel.screen = 2 don't set it to 2, it stays, but panel.location='bottom' works fine.

var panel = panelById(panelIds[0])
print('before, panel.screen: ');
print(panel.screen);
panel.screen=2;
//panel.location='top';
panel.location='bottom';
print('after, panel.screen: ');
print(panel.screen);

Why isn't panel.screen=2; working?, and what else can I do to move it?

4
  • Having the same issue here... Did you find any solution to this?
    – Nobwyn
    Commented Aug 19, 2016 at 6:14
  • @Laimoncijus: not a good one, as long as i have all 3 monitors connected, I can still move it using the mouse, and when I move my laptop, I can add an extra default panel on an active monitor.
    – Puggan Se
    Commented Aug 24, 2016 at 10:04
  • Looking for the same... I use i3wm as my WM + plasmashell, when I disconnect the monitor where the panel is, I cannot restore on the laptop monitor... Quite frustrating
    – tmow
    Commented Aug 23, 2019 at 7:08
  • Found this reddit.com/r/kde/comments/9d10na/… that is a quite useful workaround. cc @PugganSe
    – tmow
    Commented Aug 23, 2019 at 8:58

1 Answer 1

0

It's possible that the panel.screen value is read-only and cannot be changed via the kwinscripts method. You could try using the qdbus command to move the panel instead:

qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var panel = panelById(panelIds[0]); panel.geometry = QRect(0, 0, screenGeometry(2).width, panel.preferredSize.height);'

This command sets the panel's geometry to match the width of screen 2, effectively moving it to the bottom of the screen. You can adjust the values in the QRect() function to move the panel to a different location on the screen.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .