Recover from KDE aborted logout

On KDE, If I leave an application like VirtualBox open, then go to reboot the system, VirtualBox will prevent me from logging out. The problem is, plasma is not restored so all my docks are closed. If I’m lucky I left a terminal open, or I can switch TTY. What is the best method of recovery so that I can perform a graceful reboot?

I usually change TTY in those situations.

So what I’ve understood is: you want to restore your session even when VirtualBox was running and I have a way of doing this by:

  • starting with an empty session

  • having 1 (one) script in autostart that starts all of the applications I always use.

    # Play sound to notify login successful
    aplay /usr/share/sounds/ST_Computer_Authorization_Accepted.wav &
    # sleep 2 seconds to allow DE to use full CPU to start up after login sound
    sleep 2
    #Start Konsole on Desktop #1
    /usr/bin/konsole &
    sleep 2
    # Start optimus manager tray icon
    # sleep 2
    /usr/bin/telegram-desktop &
    /usr/bin/skypeforlinux &
    sleep 2
    filelight &
    sleep 1
    /usr/bin/qbittorrent &
    sleep 1
    firefox &
  • the & are there to say “start the application in the background and continue the script”

  • the sleep commands are there to sleep X seconds to ensure not all applications are started at the same time and maxing out the CPU (or not: Telegram and Skype are started concurrently, but all the other applications wait a few seconds before starting)

Why I do this this way you ask instead of just restoring my entire session?

  • because then I never have the problem you now have… :grin:
  • If an application ever makes my desktop crash, it will not be restored automatically and crash it again
  • if one of the applications in my autostart makes my desktop crash, I can log into a TTY and manually remove it from the startup script.