Announcement

Collapse
No announcement yet.

Restore previous session as default

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Restore previous session as default

    Currently, Kubuntu, and perhaps other KDE Plasma distros, have Restore previous session as the default in System Settings > Startup and Shutdown > Desktop Session.

    I came across a user who had this default setting as well as a conky in Autostart. After some sessions, there were several conky processes running presumably because the user didn't shutdown conky before logging out or shutting down.

    To lower the chances of such a situation, it may make sense to change
    • Applications to be excluded from sessions
    to something a little more verbose such as
    • Applications, such as those in your Autostart, to be excluded from sessions
    Kubuntu 20.04

    #2
    I have Restore previous session set.
    In autostart, I have three entries: XplanetFX, Latte dock, and... conky.

    The first two, resume with no problem. So it seems that autostart deals with them properly. Conky... can be wonky ;·) sometimes.
    So I (auto)start it with a little script. For two reasons.
    First, I make it kill any residual conky processes.
    Second, I make it wait a little for the network interface to be fully up and hence show IP addresses properly.
    So:
    Code:
    #!/bin/sh
    killall conky
    sleep 16
    cd /home/not/.conky
    conky -c ./.conkyrc & exit

    Comment


      #3
      My preference is to start with an empty session and to close all applications except panels (latte or the default plasma one) and conky.

      But I've just tried the restore session and purposely left a window each open for dolphin, kate, and konsole. I also included these (along with conky, gedit, and latte) in autostart. I logged out and back. Here's the output of wmctrl -l:

      Code:
      $ wmctrl -lx
      0x02800010 -1 plasmashell.plasmashell  KUEE Desktop — Plasma
      0x03200007  0 konsole.konsole       KUEE ~ : bash — Konsole
      0x03c00007  0 konsole.konsole       KUEE ~ : bash — Konsole
      0x03e00006  0 dolphin.dolphin       KUEE Home — Dolphin
      0x03a00006  0 kate.kate             KUEE Untitled  — Kate
      0x02e00011 -1 latte-dock.lattedock  KUEE Latte Shell — Latte Dock
      0x03000006  0 kate.kate             KUEE Untitled  — Kate
      0x03800064  0 org.gnome.gedit.Org.gnome.gedit  KUEE Untitled Document 1 - gedit
      0x03600006  0 dolphin.dolphin       KUEE Home — Dolphin
      0x04e00002 -1 conky.conky           KUEE conky (KUEE)
      0x05000002 -1 conky.conky           KUEE conky (KUEE)
      $
      As seen by donbcilly, latte is handled properly. But there are two instances of dolphin, kate, and konsole and, of course, conky. (I did not use a script with killall conky. )

      Edit:
      I tried again with two windows of gedit open at log out. On logging back in, there's just one! Hmmm... back to start with empty session for me. In any case, I don't like leaving applications open at log off or shutdown.
      Last edited by chimak111; Jan 18, 2020, 03:54 AM.
      Kubuntu 20.04

      Comment


        #4
        Hmm.
        I left Dolphin, Kate, Konsole and Firefox windows open.
        Logged back in:

        Code:
        ~$ wmctrl -lx
        0x0220000b -1 plasmashell.plasmashell  all Desktop — Plasma
        0x0300000c -1 latte-dock.lattedock  all Latte Shell — Latte Dock
        0x03600007  0 konsole.konsole       all ~ : bash — Konsole
        0x03a00006  0 kate.kate             all ~/.conky/2k.sh  — Kate
        0x03c00006  0 dolphin.dolphin       all .conky — Dolphin
        0x02200019 -1 plasmashell.plasmashell  all Plasma
        0x03400003  0 Navigator.Firefox     all Restore previous session as default - Mozilla Firefox
        0x05600002 -1 Conky.Conky           all conky (all)
        No extra legs ;·) *

        * A friend of mine was working at an airport check-in counter years ago. A lady came up and asked if she could have "extra leg room". She replied: "Why, have you got extra legs?". Since then, we use "extra legs" for unrelated things :·)

        Comment


          #5
          Originally posted by Don B. Cilly View Post
          Hmm.
          I left Dolphin, Kate, Konsole and Firefox windows open.
          ...
          But did you also add them to autostart?
          Kubuntu 20.04

          Comment


            #6
            Oops. I did not. Click image for larger version

Name:	icon_smile_blush.gif
Views:	8
Size:	845 Bytes
ID:	644521

            I did now (Dolphin, Kate and Konsole), and sure enough, I had two instances of each. One open, one minimised (they were minimised at shutdown).

            And
            Code:
            ~$ wmctrl -lx
            0x0220000b -1 plasmashell.plasmashell  all Desktop — Plasma
            0x02a00007  0 konsole.konsole       all ~ : bash — Konsole
            0x0300000c -1 latte-dock.lattedock  all Latte Shell — Latte Dock
            0x03a00006  0 dolphin.dolphin       all Home — Dolphin
            0x03600006  0 dolphin.dolphin       all Home — Dolphin
            0x03c00006  0 kate.kate             all Untitled  — Kate
            0x03400007  0 konsole.konsole       all ~ : bash — Konsole
            0x03800006  0 kate.kate             all Untitled  — Kate
            0x02200019 -1 plasmashell.plasmashell  all Plasma
            0x05000002 -1 Conky.Conky           all conky (all)
            0x05400003  0 Navigator.Firefox     all Restore previous session as default - Mozilla Firefox
            So you're right. In the case of having open sessions of those three and having them enabled as startup apps, logging out and back in results in double instances.
            Funny thing is, I also have Latte and XplanetFX in autostart, they are running at shutdown, and they don't double up.
            XplanetFX isn't even mentioned by wmctrl...

            Comment


              #7
              Originally posted by Don B. Cilly View Post
              ...
              Funny thing is, I also have Latte and XplanetFX in autostart, they are running at shutdown, and they don't double up.
              XplanetFX isn't even mentioned by wmctrl...
              Yes, Latte behaves for me as well.

              I don't know anything about XplanetFX but according to this it's a sort of daemon:

              xplanetFX is a daemon for rendering high quality views of mother earth as wallpaper in real-time (sun, moon and clouds). It comes with a handy GTK interface but is fully usable under CLI.
              and
              it seems to have provision for autostart as well. Maybe the OS deals differently with programs like it (and latte).

              Re. wmctrl not "seeing" XplanetFx, maybe it's because it isn't an actual X window?




              By the way, this video deals with XplanetFx and Conky
              Last edited by chimak111; Jan 18, 2020, 06:32 AM.
              Kubuntu 20.04

              Comment


                #8
                Originally posted by chimak111 View Post
                Re. wmctrl not "seeing" XplanetFx, maybe it's because it isn't an actual X window?
                It isn't. It is a deamon, and has an icon in the tray.
                But neither is Latte, and wmctrl mentions it... or maybe it is an X window, just a "clever" one...

                Anyway, I guess the moral to the story is, don't leave actual windows open of startup applications when shutting down - if you have "restore session" enabled.
                - Or else?
                - Or else you'll get double instances of them

                [AH] My xplanet/conky setup is prettier than the one in the video, nye nye ;·)

                Comment


                  #9
                  I always leave Dolphin, Firefox, konsole, and Thunderbird open upon shutdown. They just open at the next boot just fine.

                  I don't use conky, so I can't help with that, Don. But, I've done the same shutdown for years, and stuff just opens at the next boot without setting anything for auto open. So it has to be conky's fault
                  The next brick house on the left
                  Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



                  Comment

                  Working...
                  X