Pug*_* Se 10 linux kde kubuntu kwin kde-plasma-5
我有一个使用 更改我的桌面布局的脚本xrandr,但我也想移动我的面板。
到目前为止,我玩过 kwinscripts,使用
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.showInteractiveConsole
如果我使用鼠标移动它,panel.screen 在 0 和 2 之间变化,但脚本行panel.screen = 2没有将它设置为 2,它保持不变,但panel.location='bottom'工作正常。
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);
Run Code Online (Sandbox Code Playgroud)
为什么不panel.screen=2;工作?,我还能做些什么来移动它?
小智 0
panel.screen 值可能是只读的,无法通过 kwinscripts 方法更改。您可以尝试使用 qdbus 命令来移动面板:
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);'
Run Code Online (Sandbox Code Playgroud)
此命令将面板的几何形状设置为与屏幕 2 的宽度相匹配,从而有效地将其移动到屏幕的底部。您可以调整 QRect() 函数中的值,将面板移动到屏幕上的不同位置。
| 归档时间: |
|
| 查看次数: |
2344 次 |
| 最近记录: |