This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Is there a script for adding/deleting a virtual desktop?

Tags: None
(comma "," separated)
annyone
Registered Member
Posts
6
Karma
0
I sometimes want to add an additional virtual desktop for a short time only. Of course, I could do this using the mouse on the control bar, but I would prefer to have a key shortcut for this. Is there a script which would accomplish this? I then could assign it to a key combination.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Hi!

There is no script, but you can use the DBUS-system to create a new virtual desktop:
Code: Select all
qdbus org.kde.KWin /VirtualDesktopManager org.kde.KWin.VirtualDesktopManager.createDesktop 99 shorty
will create a desktop named shorty with ID 99
annyone
Registered Member
Posts
6
Karma
0
Your suggestion makes me hopeful, but i get the answer
Code: Select all
$ qdbus org.kde.KWin /VirtualDesktopManager org.kde.KWin.VirtualDesktopManager.createDesktop 99 shorty
Cannot find 'org.kde.KWin.VirtualDesktopManager.createDesktop' in object /VirtualDesktopManager at org.kde.KWin

Can you help me further?
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
I can try, but you have to provide some information. At first: on which operating system are you trying to achieve this? What is your used plasma and kde-framework version? How did you install it? What is the output of
Code: Select all
qdbus org.kde.KWin /VirtualDesktopManager
annyone
Registered Member
Posts
6
Karma
0
Here is some info about my setup:
Code: Select all
$ inxi -Gv1
System:    Host: Trisentis Kernel: 4.12.14-lp151.28.48-default x86_64 bits: 64 Desktop: KDE Plasma 5.12.8
           Distro: openSUSE Leap 15.1
CPU:       Quad Core: Intel Core i7-3770 type: MT MCP speed: 2762 MHz min/max: 1600/3900 MHz
Graphics:  Device-1: NVIDIA GK208B [GeForce GT 710] driver: nvidia v: 340.108
           Display: x11 server: X.Org 1.20.3 driver: nvidia resolution: 2560x1440~60Hz
           OpenGL: renderer: Graphics Device/PCIe/SSE2 v: 4.4.0 NVIDIA 340.108
Drives:    Local Storage: total: 1.14 TiB used: 303.16 GiB (25.9%)
Info:      Processes: 346 Uptime: 14:56:44  up 4 days 20:36,  3 users,  load average: 1.47, 0.77, 0.57
           Memory: 15.57 GiB used: 3.56 GiB (22.8%) Shell: bash inxi: 3.1.00
/u/cl> qdbus org.kde.KWin /VirtualDesktopManager
Error: org.freedesktop.DBus.Error.UnknownObject
No such object path '/VirtualDesktopManager'
$ qdbus org.kde.KWin /VirtualDesktopManager
Error: org.freedesktop.DBus.Error.UnknownObject
No such object path '/VirtualDesktopManager'
annyone
Registered Member
Posts
6
Karma
0
Some more info:
Code: Select all
$ qdbus org.kde.plasmanetworkmanagement
/
/KAppMenu
/Layouts
/MainApplication
/StatusNotifierWatcher
/Tablet
/kbuildsycoca
/kded
/modules
/modules/StatusNotifierWatcher
/modules/accounts
/modules/appmenu
/modules/baloosearchmodule
/modules/colorcorrectlocationupdater
/modules/desktopnotifier
/modules/device_automounter
/modules/freespacenotifier
/modules/kded_printmanager
/modules/keyboard
/modules/khotkeys
/modules/kscreen
/modules/ksysguard
/modules/ktimezoned
/modules/networkmanagement
/modules/networkstatus
/modules/proxyscout
/modules/remotenotifier
/modules/solidautoeject
/modules/soliduiserver
/modules/statusnotifierwatcher
/modules/touchpad
/modules/wacomtablet
/org
/org/kde
/org/kde/kded5
/org/kde/plasmanetworkmanagement
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
What windowmanager do you use? Seems like there is no kwin available, but I really do not know openSuse. My last experience with it was with KDE3.X :)
annyone
Registered Member
Posts
6
Karma
0
"What windowmanager do you use?" - Interesting question!
Code: Select all
$ wmctrl -m
Name: KWin
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: N/A

OpenSuse writes somewhere "KWin is the window manager of the K desktop environment. Version 4.11.22 Size 2.9 MB openSUSE Leap 15.1"
but then again
Code: Select all
$ zypper info kwin
Repository-Daten werden geladen...
Installierte Pakete werden gelesen...
Informationen zu Paket kwin:
----------------------------
Repository         : Main Repository                         
Name               : kwin                                   
Version            : 4.11.22-lp151.9.5                       
Arch               : x86_64                                 
Anbieter           : openSUSE                               
Installierte Größe : 10,9 MiB                               
Installiert        : Nein                                   
Status             : nicht installiert                       
Quellpaket         : kdebase4-workspace-4.11.22-lp151.9.5.src
Zusammenfassung    : KDE Window Manager                     
Beschreibung       :                                         
    KWin is the window manager of the K desktop environment.

Do I have no window manager running? I am confused.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Probably you don't have KWin. KDE also supports openbox as window manager. Then have a look at openbox wiki.
annyone
Registered Member
Posts
6
Karma
0
I do have kwin5 as a window manager (version 5.12), not kwin. No idea why wmctrl does not recognize it.

But with wmctrl I could solve my problem:
wmctrl -n <nr of desktops>

sets the number of desktops to the wanted value.
It only takes absolute values, but since one can find out the actual number of desktops with wmctrl -d, this is no problem.

Thanks for your help!


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]