KDE's Virtual Desktops Workflow & Usability Reimagined
Open, Needs TriagePublic

Description

Glossary of Topics:

  • Virtual Desktops
  • Desktop Grid
  • Pager widget
  • Discoverability
  • Virtual Desktops Shortcuts
  • Future Ideal Workflow Concept

Virtual Desktops

Virtual Desktops (aka Workspaces in other Linux based DEs) are great but have very low discoverability in Plasma and when you do initiate their usage you run into a lot of clunky defaults that mostly just get in the way.

The current default setting for amount of virtual desktops in Plasma is just one (1) and I suggest it be changed to four (4).

This would result in a unfortunate side effect with the Desktop Grid & the Pager widget however, I have addressed both of these in their own sections below.

Desktop Grid

Desktop Grid is the Desktop Effect that manages the display of Plasma's Virtual Desktop visualization. The defaults for this effect are quite unfortunate in multiple ways.

The current Layout Mode is set as *Pager* and this means it is locked to whatever the setting is inside of the Pager widget. The Pager widget by default has the layout as 1 Row + X Columns where X is defined by the amount of virtual desktops resulting in a single horizontal row regardless of desktop count. This is ideal for shortcut navigation but not for the desktop grid, more on the navigation in the Shortcuts section.

I suggest changing this setting to "*Automatic*" because this will decouple the display of the grid from the Pager making it actually a grid. This is also alleviate the mandatory manual user interaction for a good looking grid layout.

The shortcut to activate this feature is Ctrl+F8 and that's unfortunate due to its awkward finger positioning and zero discoverability. I have addressed this below in a separate section.

Pager Widget

The Pager widget is the widget on the Plasma Panel that gives quick interaction for virtual desktops from the panel. This widget is unintuitive and creates more hassle / clunk than value.

KDE Plasma starts with the Pager widget in the default layout of the Plasma Panel. The Pager widget is dormant and unused when there is only 1 virtual desktop and since Plasma starts with only 1 virtual desktop, at the moment, this means that by default the Pager widget does not display and provides no default value.

When you add more virtual desktops in Plasma, you also initiate the usage of the Pager widget that effectively feels to come out of nowhere. The value of quick interaction is only present for those who already know the functionality is there due to its hidden unintuitive nature.

In my opinion, this widget should be removed from the Plasma Panel defaults and relegated to only being used when users choose to add it themselves because it does not offer any value by default and when initiated it takes up an excessive amount of panel space depending on the layout of the desktops the user chose.

This would create another problem due to no elements on the Panel related to virtual desktops, I have addressed this below in the Discoverability section.

Discoverability

Discoverability is very important for a feature such as this and therefore it should have a high priority. I have reimagined this as well and have a solution that I feel is both efficient and appealing in its discoverability as it uses the "it just works and gets out of the way" mindset as the basis.

I suggest adding a new single button that represents virtual desktops and when clicked activates the desktop grid effect. I also have addressed the visual aspect and functionality of this button.

Visual:

  • use the existing symbolic icon of virtual-desktops available in Breeze Icons.
  • create alternates if preferred but with the same vibe

Functionality:

  • activating this with a button is already available with a command so set the button to initiate the command and that's it.
  • command needed to activate is:
    • qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut ShowDesktopGrid

This will create intrigue of interest for what the button does and introduce the Virtual Desktops as a cool effect with a clean predefined layout of 4 in a 2x2 grid.

Virtual Desktops Shortcuts

Keyboard Shortcuts can be a wonderful time saver and usability value, however at this time, this is not the case for Virtual Desktops in KDE Plasma. My reimagining of the virtual desktops entails essentially a total revamp of the shortcuts which I believe to be a more ideal workflow.

I have used @thiagosueto's Shortcut Guidelines as the basis for my revamping of the structure as I feel this set of guidelines and testing is well-thought out and fits seamlessly in my workflow structure concept.

Reference: Meta = Windows key on PC keyboards

Shortcut Mapping:

  • Desktop Grid
    • Meta+Ctrl+D = activate the Desktop Grid
      • exiting this effect:
        • same shortcut as activation
        • Escape
        • via mouse click on a desktop
        • Note: this would happen automatically as it already works this way
      • Arrows to easily navigate when inside of the effect
        • Note: already works this way
  • Navigation of Virtual Desktops
    • Meta+Ctrl+Left Arrow / Right Arrow = move between Previous & Next Desktops with a Left & Right paradigm
      • No Default Exists at this time
      • provides consistent modifier value
      • process is simple to understand for most with Right = Next and Left = Previous.
    • Meta+Ctrl+Shift+Left Arrow / Right Arrow = move windows to the Previous & Next Desktops
      • No Default Exists at this time
      • provides consistent modifier value
      • process is simple to understand = simply adding Shift to the existing Left & Right paradigm
    • Meta+Ctrl+[1-9/0] = switch directly to a designated virtual desktop
      • Current Defaults are Ctrl+F1 - Ctrl+F4
        • has awkward uncomfortable finger positioning
        • is locked to no more than 6 because Ctrl+F7 - Ctrl+F12 are used for other things
          • side note: all of the Ctrl+F7 - Ctrl+F12 need fixing too (partial exception of Ctrl+F12 having been addressed)
      • provides consistent modifier value
      • provides quick direct access to a specific desktop
      • process is simple to understand, consistent modifiers plus the number of the desktop you want.
      • allows for direct acces up to 10 virtual desktops
    • Meta+Ctrl+Shift+[1-9/0] = move windows to a designated virtual desktop
      • No Default Exists at this time
      • provides consistent modifier value
      • process is simple to understand = simply adding Shift to the designated virtual desktop paradigm
    • Meta+Ctrl+Tab & Meta+Ctrl+Shift+Tab = for walking through virtual desktops
      • No Default Exists at this time
      • provides consistent modifier value
      • process is simple to understand as it functions similar to Alt+Tab paradigm
      • can be done in parallel with the Left & Right arrow paradigm
      • provides discoverability for those who assume existence from Alt+Tab paradigm expectation

Future Ideal Workflow Concept

The above reimagining of the workflow requires no additional work to be done on the development side in order to accomplish this structure, everything is available through configuration changes exclusively. The only slight effort would be to create the button on the panel with the command I provided to activate the Desktop Grid, though a simple .desktop file should accomplish this.

With the above said, I think there still is a lot of room for improvement and that this would be essential *Phase 1*. This can be expanded on to an amazing amount of value if developers joined in to take the workflow to awesome levels. For example, Virtual Desktops could be combined with Present Windows and Activities to create an awesome UX workflow that integrates so much value all in one interface.

Here are two great paradigm concepts to consider for the potential of where it could go.

I think another great thing of this reimagining for the virtual desktops workflow is that it has built in transitional value. If Phase 2 becomes something that people want to pursue then practically everything in this new workflow structure would seamlessly transition to the next phase.


What are your thoughts?

ngompa added a subscriber: ngompa.Sep 7 2020, 8:33 PM
ndavis added a subscriber: ndavis.EditedNov 9 2020, 3:13 PM

Kind of a shame that this extensive write-up has sat around for 2 months with no comments, but unfortunately, I don't have much to add. I don't really use virtual desktops or activities much and haven't seen a great need to, so it's hard for me to really see how they should work. I have tried them and they have been somewhat useful, but I never really stick with them. It's just easier for me to control everything with the task manager. I'm not saying your reasons for liking Virtual Desktops aren't valid, but perhaps one of the reasons why nothing moved forward is that a lot of people don't understand them, including KDE developers and designers like myself?

alex-l added a comment.Nov 9 2020, 3:31 PM

It's not that Virtual Desktops and Activities are not useful but they are just presented in a way that doesn't make obvious how to use them. I wrote some blog posts in Planet KDE years ago explaining (creative) way to use Activities. But in fact if you need to explain intended workflows with blog posts you have a UI/UX problem.

My mockup mentioned by OP is supposed to make more obvious how to use Activities but I know it wouldn't be enough. In the meanwhile, here there is what I copy-paste on social networks when someone asks how to use Activities:

  • I have files and folders associated to each Activity and desktops set to Folder View to show them.
  • different plasmoids on each Activity, in particular notes
  • different panels on each Activity thanks to Latte Dock (I use it only and no native Plasma panels)
  • I have different favourite apps on each Activity
  • I take andvantage of "freezing" some apps when I stop an Activity. For example I usually have multiple Dolphin, Kate and Okular windows on many virtual desktops; I can stop the Activity and all apps are closed and if I restart the Activity I get those windows in the same position and with the same documents (Kate and Okular) and paths (Dolphin) as before
  • I have a Firefox profile on each Activity with different favourites, history etc.
  • I use pytivity to start apps when an Activity start
  • again with pytivity I set an Activity that start/stop Docker when the Activity start/stop. I also have on that Activity a plasmoid that indicates Docker is running or not, running containers and available images.
  • I use Plasma Vault with Activities to mount encrypted folders
  • I have an Activity that start KDE Neon in a Docker container and show it in a full screen window. When I stop the Activity the container stop. It's better than Virtualbox for my use case
  • a gaming Activity that stop messaging apps that are eventually running and restart them when the Activity stop
ngraham added a subscriber: ngraham.Nov 9 2020, 4:55 PM

Personally I've had the same experience as Noah: I find it easier to manage my workspace with just the task manager and Alt+Tab and whenever I try out Activities or Virtual Desktops, I don't stick with them. This goes for other platforms too which also implement these features, FWIW.

Even though I don't use Activities, I feel like the concept makes sense and I can envision myself using them for "Work" and "Home" activities. Unfortunately I always get stuck on the fact that my email client (Thunderbird) and web browser (Firefox) can't have per-activity settings, so I don't have the ability to set up the Home activity with only my home email address in Thunderbird and no work-related tabs in Firefox.

@alex-l You said:

I have a Firefox profile on each Activity with different favourites, history etc.

How did you do that? Does it let you have different sets of tabs per activity too?

alex-l added a comment.EditedNov 9 2020, 5:27 PM

@alex-l You said:

I have a Firefox profile on each Activity with different favourites, history etc.

How did you do that? Does it let you have different sets of tabs per activity too?

Firefox can be launched with different profiles with a CLI argument. Different profiles also mean a different set of tabs is restored at startup, if you have that option enabled, and this is the main reason I do the following. Of course one can manually create a different .desktop launcher and pin it in the related Activity to launch Firefox with a specific profile.

I automated this with a simple script that is launched by my .desktop launcher for Firefox. This check if there is a folder named like current Activity ID in Firefox's profiles folder. If there is, it start Firefox using as profile the one contained by that folder. If there isn't, it creates one with current Activity ID as name and place in it some symlinks to my default Firefox profile folder (because I want history, fav etc to be shared, it's optional, but this introduces issues when I run multiple Firefox instanced with different profiles, but I'm OK with eventually keep one Firefox instance and close the others). Of course I have set this script as default browser so that when I click a URL in an app it starts Firefox in the current Activity with the right profile.

[EDIT: Please don't introduce something like this in Plasma, the right way to do this is using Plasma Browser Integration to replace Firefox built-in session restoring with one that is aware of current Activity and restore tabs associated with it]

The script is the following:

#!/bin/bash

# ~~~~~~~~~~~~~~~ F I R E F O X - A C T I V I T I E S ~~~~~~~~~~~~~~~~#


# This script start Firefox with different session (different set of
# restored tabs) according to current Plasma Activity.
#
# Usage: ff URL
# License: CC-00
# Author: alexl@disr.it


#~~~~~~~~~~~~~~~~~~~~~~~~ P A R A M E T E R S ~~~~~~~~~~~~~~~~~~~~~~~~#


# Firefox profiles folder:
profiles='.mozilla/firefox'

# Firefox execution command:
firefox='env MOZ_USE_XINPUT2=1 GTK_USE_PORTAL=1 firefox'

# Base profile folder:
base='4qst6lze.default' # <-- IMPORTANT: replace with yours


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ S T A R T ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#


# Get current Activity ID
current=`kactivities-cli --current-activity | cut -d' ' -f2`

# Check if there is a profile folder named with current Activity ID
if [[ -d "$HOME/$profiles/$current" ]]
then
    # YES - Check if there is an URL as argument
    if [ $# -eq 0 ]
    then
        # YES - Start Firefox
        $firefox --profile "$HOME/$profiles/$current"
    else
        $firefox --profile "$HOME/$profiles/$current" "$1"
    fi
else
    # NO - Move to the folder containing the profiles
    cd "$HOME/$profiles/"
    
    # Create the folder
    mkdir "$current"
    
    # Link all the files from base profile folder to the new one
    for i in "$HOME/$profiles/$base/*"
    do
        ln -s $i "$HOME/$profiles/$current/"
    done
    
    # Remove session files
    mv "$HOME/$profiles/$current/sessionstore.jsonlz4" "$HOME/$profiles/$current/sessionstore.jsonlz4.bak"
    mv "$HOME/$profiles/$current/sessionstore-backups" "$HOME/$profiles/$current/sessionstore-backups.bak"
    
    # Remove favorites and favicons database for compatibility,
    # they will be recreated from respective backup folders
    mv "$HOME/$profiles/$current/favicons.sqlite" "$HOME/$profiles/$current/favicons.sqlite.bak"
    mv "$HOME/$profiles/$current/places.sqlite" "$HOME/$profiles/$current/places.sqlite.bak"
    
    # Start Firefox
    if [ $# -eq 0 ]
    then
        $firefox --profile "$HOME/$profiles/$current"
    else
        $firefox --profile "$HOME/$profiles/$current" "$1"
    fi
fi

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E N D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

Wow. Impressive.

This kind of leads me to what I consider the Achilles heel of activities: every individual app needs to be made activity-aware. That seems hard enough for KDE software over which we have total control, due to disagreements about the scope of what set of the app's settings should be activity-aware. But since 3rd-party apps don't support activities at all, the concept just breaks down if you want or need to use 3rd-party apps. :( 5 out of 11 of my pinned apps are non-KDE apps.

alexde added a subscriber: alexde.

Wow. Impressive.

This kind of leads me to what I consider the Achilles heel of activities: every individual app needs to be made activity-aware. That seems hard enough for KDE software over which we have total control, due to disagreements about the scope of what set of the app's settings should be activity-aware. But since 3rd-party apps don't support activities at all, the concept just breaks down if you want or need to use 3rd-party apps. :( 5 out of 11 of my pinned apps are non-KDE apps.

Third party apps don't need to support Activities or anything Plasma-specific at all but just XSMP (X Session Management Protocol), that is what let Plasma restoring the session after the login. Actually, Plasma's implementation of XSMP treats each Activity as a single session, this is what powers Activities restoring feature. If an app restores its session after login it would do so also when activating the Activity it is in.

Firefox never supported XSMP and this is a shame. Mozilla doesn't care of Linux/Freedesktop at all. At least one of the KDE browsers (Konqueror, Rekonq and Qupzilla/Falkon) supported it though. It happened that when I had to switch to Firefox because WebKit is crap I wanted to keep the restoring capability.

XSMP of course is X-specific but AFAIK some are working on a Wayland extension for this. GNOME will support it and for sure Plasma too if it wants to keep restoring session at login.

Third party apps don't need to support Activities or anything Plasma-specific at all but just XSMP (X Session Management Protocol),

Gotcha. That's pretty clever.

Unfortunately the point still stands since tons of apps sadly don't support it. It's not just Firefox; Thunderbird, LibreOffice, and all Electron apps also don't seem to support it. I'm sure there are more too.

Third party apps don't need to support Activities or anything Plasma-specific at all but just XSMP (X Session Management Protocol),

Gotcha. That's pretty clever.

Unfortunately the point still stands since tons of apps sadly don't support it. It's not just Firefox; Thunderbird, LibreOffice, and all Electron apps also don't seem to support it. I'm sure there are more too.

And so? Plasma restores windows for every app and for some of them it restores their state (tabs, open documents etc). This is already very good. The lack of integration of the apps you mentioned is on a different level, they don't support color schemes, open/save file dialogs etc.

Also KDE already has most apps that can take advantage of session restoring, namely file managers, text editor, document viewers, web browsers and so on. LibreOffice doesn't even have tabs, right? And most Electron apps are small utilities so there is not even a state that makes sense to restore.

For reference xdg-session-management protocol is the work-in-progress replacement for XSMP in Wayland: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/18

So in future it should be possible to:

  1. Implement xdg-session-management in Plasma and KDE applications to provide session restoring after login
  2. Ensure session restoring works also when restarting an Activity
  3. Ask to third party applications and frameworks to support it (Firefox, Chromium, Electron, VS Code and so on)

This makes me think that Activities could be renamed Sessions to advertise session restoring as the main feature since basically nobody knows that now on X11 restarting an Activity is like restoring a session after login.