The clutter problem
You have a browser with twelve tabs, a terminal running a long build, an email client, and a PDF open. You want to switch to your personal workspace to check messages or watch a video, but every window is fighting for screen real estate. Alt-tab becomes a guessing game. You need separation. KDE Plasma on Fedora gives you two tools for this: Virtual Desktops and Activities. They sound similar, but they solve different problems.
What is actually happening under the hood
Virtual desktops are window containers. They keep your open applications grouped, but they share the same session state. The wallpaper, panel layout, system tray icons, and global keyboard shortcuts remain identical across every desktop. Think of virtual desktops as drawers in a single desk. You pull out different sets of tools, but you are still sitting at the same workstation.
Activities are full context switches. Each activity maintains its own wallpaper, panel configuration, pinned applications, and window rules. When you switch activities, Plasma can hide windows from other activities, change the desktop background, and even load different widgets. Think of activities as separate desks in different rooms. You walk into the work room, see only work tools, and the personal room stays untouched behind a closed door.
The separation exists because the window manager and the desktop shell track state differently. KWin, the Plasma window manager, handles virtual desktops as a simple array of window lists. The Activity Manager daemon handles activities as independent configuration profiles. They can run independently, but they also stack. You can have multiple activities, and each activity can contain multiple virtual desktops. The architecture keeps memory usage low because Plasma only loads the assets and widgets for the active profile. Background activities keep their window positions in memory but do not render their panels or wallpapers.
Setting up virtual desktops
Start with virtual desktops if you just need to group windows. Open System Settings and navigate to Workspace, then Virtual Desktops. The default setup usually provides four desktops arranged in a two-by-two grid. You can change the number of desktops or adjust the rows and columns. The pager widget in your panel or desktop will update to match the grid.
Switching is fast. The default shortcuts use the Meta key combined with arrow keys. Press Meta and Ctrl together with the right arrow to move forward. Press Meta and Ctrl with the left arrow to move backward. If you prefer function keys, Ctrl plus F1 or F2 works on most keyboards. To move a specific window to another desktop without changing your own view, hold Meta, Ctrl, and Shift, then press the direction key.
You can also control virtual desktops from the terminal. This is useful for automation or when you are managing a session over SSH. The KWin compositor exposes a D-Bus interface that accepts commands directly.
Here is how to query the current desktop and switch to a different one.
# Query the current desktop index. KWin returns a number starting at 1.
qdbus org.kde.KWin /KWin currentDesktop
# Switch to desktop 3. The command takes an integer argument.
qdbus org.kde.KWin /KWin setCurrentDesktop 3
# List all available desktops to verify the total count.
qdbus org.kde.KWin /KWin numberOfDesktops
Run qdbus org.kde.KWin /KWin numberOfDesktops after changing the grid size. The number should match your visual pager.
Creating and managing activities
Activities require a slightly different workflow. Press Meta and Q to open the overview. You will see your current windows and a small plus icon or a button labeled Create Activity. Click it, type a name like Work or Personal, and confirm. Plasma creates a new profile and switches you into it immediately.
Each activity remembers its own state. Open a terminal, resize it, and pin it to the panel. Switch to another activity. The terminal disappears from the overview. Switch back. The terminal is exactly where you left it. This isolation happens because Plasma writes activity-specific configuration to ~/.local/share/plasma/ and ~/.config/plasmashellrc. The window manager tags every window with an activity UUID. When you switch, KWin filters the visible windows based on that tag.
You can control activities from the command line using the Activity Manager D-Bus interface. The interface returns UUIDs instead of simple numbers.
Here is how to list activities and switch between them programmatically.
# List all activity UUIDs. The output is a comma-separated string.
qdbus org.kde.ActivityManager /ActivityManager/Activities ListActivities
# Get the UUID of the currently active workspace.
qdbus org.kde.ActivityManager /ActivityManager/Activities CurrentActivity
# Switch to a specific activity. Replace the UUID with your own.
qdbus org.kde.ActivityManager /ActivityManager/Activities SetCurrentActivity <uuid>
Copy the UUID from the CurrentActivity output and paste it into a script. The switch happens instantly without opening the overview.
Combining both systems
The real power comes from stacking them. Open System Settings, go to Workspace, and find Virtual Desktops. Look for the toggle labeled Different virtual desktops per activity. Enable it. Each activity now gets its own independent grid of desktops. Your Work activity can have four desktops for coding, writing, email, and reference. Your Personal activity can have two desktops for browsing and media. They do not interfere with each other.
This configuration changes how KWin tracks window placement. The window manager now stores position data keyed to both the activity UUID and the desktop index. If you disable per-activity desktops later, Plasma will merge the grids and redistribute windows. The merge is not always perfect. Windows may overlap or shift to the first desktop.
Keep the per-activity toggle enabled if you rely on strict separation. Disable it only if you want a single shared grid across all contexts.
Window rules and configuration persistence
Window rules let you lock applications to specific desktops or activities. Open System Settings, go to Window Management, then Window Rules. Add a rule for the application you want to control. Set the Desktop property to a specific number, or set the Activity property to match your workspace UUID. Without the Activity property, the rule applies globally across all contexts.
Plasma stores these rules in ~/.config/kwinrulesrc. The file uses standard INI formatting with sections for each rule. You can edit it manually, but the GUI is safer because it validates UUIDs and prevents syntax errors. If you copy a rule from one machine to another, the activity UUIDs will not match. You must regenerate the activity tags on the target system.
Here is how to verify that a window rule is actually attached to an activity.
# Dump the current window rules to check property bindings.
qdbus org.kde.kwin /KWinScripting loadScript /usr/share/kwin/scripts/windowrules/main.py
# Alternatively, inspect the config file directly.
grep -A 5 "\[Rule" ~/.config/kwinrulesrc
# Check which activity a specific window belongs to by its XID.
qdbus org.kde.KWin /KWin windowActivity <window_id>
Run the windowActivity query after moving a window. The output should match the UUID of your target activity. If it returns an empty string, the window is not bound to any activity and will appear everywhere.
Common pitfalls and error handling
Window rules sometimes ignore activity boundaries. If you set a rule to keep a window on desktop 1, it will stay on desktop 1 across all activities unless you explicitly tie the rule to an activity. Open System Settings, go to Window Management, then Window Rules. Add a rule for the application. Set the Activity property to match your workspace. Without that property, the rule applies globally.
Keyboard shortcuts can conflict with global hotkeys. If Meta plus Q stops working, check System Settings under Shortcuts. Search for Overview or Activity Manager. Another application might have claimed the binding. Reassign it or disable the conflicting shortcut.
The qdbus commands may return empty strings on Wayland sessions if the D-Bus policy restricts external access. Fedora defaults to Wayland for Plasma. Run echo $XDG_SESSION_TYPE to verify your session. If it returns wayland, the commands still work for most users, but some older scripts expect X11 environment variables. Add export DISPLAY=:0 only if a script explicitly fails and you are running X11. Do not force X11 variables on a Wayland session. It breaks clipboard sharing and screen recording.
If the overview fails to load or activities disappear from the panel, restart the shell. Run kquitapp5 plasmashell && kstart5 plasmashell in a terminal. The panel and overview will reload within a few seconds. This clears stale D-Bus connections without logging out.
Restart the shell before you file a bug report. Half the time the D-Bus socket is just stuck.
When to use each tool
Use Virtual Desktops when you need quick window grouping without changing your panel layout or wallpaper. Use Activities when you want complete context isolation with independent wallpapers, widgets, and window rules. Use the D-Bus interface when you are writing automation scripts that need to switch workspaces programmatically. Use per-activity virtual desktops when you run multiple distinct projects and want each project to have its own desktop grid. Stay on the default shared desktop grid if you only occasionally switch contexts and prefer a single unified overview.