Jump to content

Plasma/SafeMode

From KDE Community Wiki

This is a page to collect ideas for Plasma Safe Mode.

Action items @ https://invent.kde.org/plasma/plasma-desktop/-/issues/156

About

Safe mode describes a feature where the user has the option to log into a special Plasma session which has most, or all, user modifications disabled. The goal is to give the user a way to repair critical damage done to their user environment/session. The OS itself is still booting and somewhat working in this state.

Destructiveness

When this page uses words that convey destructiveness what we actually mean is backup&destroy. e.g. move a given directory to some backup location, not outright deleting it. Destroying data would prevent further debugging (in bug reports) and also mean that the user cannot selectively bring back parts of the data. Deleting is never the correct operation.

Scope

Of particular concern are things that can break the desktop to a large degree. All data pertaining to:

  • plasma
  • kscreen
  • kwin
  • kactivity ❓

Reset Utility

One idea that was thrown around is a reset utility that lets the user wipe specific categories of data to see if things start working.

At its most crude that would be:

  • wipe .cache
  • wipe .local/state
  • wipe .config
  • wipe .local
  • recreate the entire home

The idea is that the user can go through those steps in turn to see if they improve the situation. The tricky aspect here is how to make this convenient, we'd have to restart the entire session somehow while having the wizard persist state.

A more involved, possibly future, version would be to actually establish logic groups for the user to reset. Rest "KWin", or only the "Desktop", or only "Kate" etc. This doesn't need to be comprehensively cover all apps, but the groups we have should at least be in themselves somewhat complete.

Config Sets

One thing that was brought up was having a concept of config sets and being able to somewhat transparently switch between them. Essentially having multiple .config directories, around which we can build tooling to compare and pick changes. This would allow the user to use the reset utility with confidence, resetting .cache and .config, and then picking data out of the old .config to be used in the new .config. Selectively restoring the "broken" state essentially.

System-wide problems

A special type of breakage can appear because of a system-wide problem that only shows itself as part of the session. A notable example would be ABI issues that prevent Plasma or KWin from starting. It's probably best to consider this out of scope for safe mode and instead defer to an error detection system centered around plasma-login. Safe mode itself would likely be broken because of this anyway.

Ideas

  • Log into separate home directory such that the old data is writable but not affecting the current logged in session
  • Could also do magic with a separate user, but probably more complicated than it is worth
  • Have a way to spin up a regular session inside a window to see if whatever was broken is working again. This could for example be a localhost rdp session to keep everything neatly separated (may be too complicated again - is separate dbus with legacy startup enough?)
  • If safe mode does not help reaching a working session it may be necessary to forward the user to documentation on how to reset their system progressively (in particular also in a KDE Linux case: reset etc, reset var, factory reset, data reset etc)