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

switch activities Keyboard shortcut not working

Tags: None
(comma "," separated)
Germaineman
Registered Member
Posts
12
Karma
0
OS
My system: MauiLinux 2.1 clean installation. Plasma v 5.8.3 KDE apps v 16.08.2 Frameworks v 5.27.0 Qt v 5.7.0 Kernel 4.4.0-53-generic

I click on the activities settings icon in the top-left corner of my screen -the one that looks like a small cogwheel-
Click on ... Activities
Click on + create activity
in the window Create a New Activity -- Plasma General tab I enter a name and description for the activity
In the tab Other I go to Shortcut for switching to this activity: and click in the box
I press Shift Ctrl D
Click on Create
Now press Shift Ctrl D ... Nothing happens

Shutdown and restart the system to my default acivity, not the one I created in the step above
Now press Shift Ctrl D ... Nothing happens

Go to System Settings > Global Shortcuts > Plasma
Here I find an entry: switch-to-activity-e623eae7-b968-4052-bf75-fae88f8e57f2 > Ctrl+Shift+D >

So there seems to be a shortcut, but pressing the keys on the keyboard produces no result
What am I doing wrong, can anybody tell me please?
Germaineman
Registered Member
Posts
12
Karma
0
OS
Sorry to receive zero replies.
It is now 2017-07-17 and I have upgraded to Linux Mint 18.2 KDE Plasma 5.8.7 KDE frameworks version 5.36.0 Qt version 5.6.1
Still if I make a new activity and give it a keyboard shortcut. The name I have given does not show in system settings. My activities are shown by a long string of seemingly random characters. The keyboard shortcut is shown. But throuout the system it is not possible to switch activities using a keyboard shortcut.
Everything works fine using mouseclicks
alavarre
Registered Member
Posts
5
Karma
0
OS
Yes, this is frustrating, but I figured a workaround:

We find that Alt+Q brings up the Activities Manager with a search box, so you can start typing the activity name until it shrinks to the one you want.

You should be able to click on the settings for each activity in the Activity Manager and set a shortcut to go to that [Activity]. But they don't work. We also tried setting them with Kicker. But they don't stick:
Bug 342186 - Global shortcuts do not work to control activity switching: https://bugs.kde.org/show_bug.cgi?id=342186
→ marked as fixed but as the comments told it is broken

Bug 362774 - KDE Activities do not have a well-defined ordering: https://bugs.kde.org/show_bug.cgi?id=362774


However we found a solution:
[url] https://blog.hanschen.org/2011/05/20/sw ... shortcuts/
[/url]
Each activity has a globally unique identifier (GUID) which is a 32-character hexadecimal string. To get the GUID of the current activity, run the following command:

Code: Select all
           qdbus org.kde.ActivityManager /ActivityManager/Activities CurrentActivity
                739788af-c322-4139-9b83-82d8109720ba    (Devel)

You can also get a list of all activity GUIDs with
Code: Select all
            qdbus org.kde.ActivityManager /ActivityManager/Activities ListActivities


The list is ordered in the same way as the activities in the activity manager (at the time the command was invoked!).

You can invoke each of these with the command
Code: Select all
                qdbus org.kde.ActivityManager /ActivityManager/Activities SetCurrentActivity [GUID]


Create keyboard shortcuts
Now you have everything you need to create a keyboard shortcut for an activity.
1. Go to System Settings → Common Appearance and Behavior → Shortcuts and Gestures → Custom Shortcuts.
2. Click on Edit → New → Global Shortcut → D-Bus Command.
3. Enter a name for the shortcut. In the Trigger tab, click on the button that says None and press the shortcut you want to use (e.g. Meta+F1).
Code: Select all
        4. Action:
            org.kde.ActivityManager
        • Remote object:
            /ActivityManager/Activities
        • Function:
            SetCurrentActivity
        • Arguments: The GUID from the first step, e.g. a589200e-1983-4825-8275-50de36c223e5

• Click on Apply.
Germaineman
Registered Member
Posts
12
Karma
0
OS
Thank you very much Your workaround solution works great!
Solved :)
User avatar
diggy
Moderator
Posts
9
Karma
0
OS
This works wonderfully. Thank you.


Dimitrios T Tanis
whoopsdecade
Registered Member
Posts
16
Karma
0
alavarre wrote:Yes, this is frustrating, but I figured a workaround:

We find that Alt+Q brings up the Activities Manager with a search box, so you can start typing the activity name until it shrinks to the one you want.

You should be able to click on the settings for each activity in the Activity Manager and set a shortcut to go to that [Activity]. But they don't work. We also tried setting them with Kicker. But they don't stick:
Bug 342186 - Global shortcuts do not work to control activity switching: https://bugs.kde.org/show_bug.cgi?id=342186
→ marked as fixed but as the comments told it is broken

Bug 362774 - KDE Activities do not have a well-defined ordering: https://bugs.kde.org/show_bug.cgi?id=362774


However we found a solution:
[url] https://blog.hanschen.org/2011/05/20/sw ... shortcuts/
[/url]
Each activity has a globally unique identifier (GUID) which is a 32-character hexadecimal string. To get the GUID of the current activity, run the following command:

Code: Select all
           qdbus org.kde.ActivityManager /ActivityManager/Activities CurrentActivity
                739788af-c322-4139-9b83-82d8109720ba    (Devel)

You can also get a list of all activity GUIDs with
Code: Select all
            qdbus org.kde.ActivityManager /ActivityManager/Activities ListActivities


The list is ordered in the same way as the activities in the activity manager (at the time the command was invoked!).

You can invoke each of these with the command
Code: Select all
                qdbus org.kde.ActivityManager /ActivityManager/Activities SetCurrentActivity [GUID]


Create keyboard shortcuts
Now you have everything you need to create a keyboard shortcut for an activity.
1. Go to System Settings → Common Appearance and Behavior → Shortcuts and Gestures → Custom Shortcuts.
2. Click on Edit → New → Global Shortcut → D-Bus Command.
3. Enter a name for the shortcut. In the Trigger tab, click on the button that says None and press the shortcut you want to use (e.g. Meta+F1).
Code: Select all
        4. Action:
            org.kde.ActivityManager
        • Remote object:
            /ActivityManager/Activities
        • Function:
            SetCurrentActivity
        • Arguments: The GUID from the first step, e.g. a589200e-1983-4825-8275-50de36c223e5

• Click on Apply.


Does not seem to work anymore.
airdrik
Registered Member
Posts
1854
Karma
5
OS
Please provide more details about what isn't working, and what changes you made between when it was working and isn't working (particularly the OS and KDE Plasma versions you are using)


airdrik, proud to be a member of KDE forums since 2008-Dec.
alexgarbarev
Registered Member
Posts
1
Karma
0
The solution with custom shortcut is working great! Thanks! :)
The only thing changed is custom shortcut location in settings, it's now (I'm on KDE neon 5.17):
Settings -> (Workspace) Shortcuts -> Custom Shortcuts, then Edit -> New -> Global Shortcut -> D-Bus Command.

Btw what I love in KDE is that you can workaround many things easily!
User avatar
josephj
Registered Member
Posts
35
Karma
0
OS
alavarre's solution still works in 2020! I just used it on kubuntu 18.04. :)


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]