Doubt about IceWM startup

Forum Forums New users New Users and General Questions Doubt about IceWM startup

  • This topic has 10 replies, 4 voices, and was last updated Dec 5-9:17 am by Xecure.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #71603
    Anonymous

      I put some stuff in IceWM startup ($HOME/.icewm/startup).

      It works, albeit I observed that, if restarting IceWM or logging out and back in, I now have *two* instances of each thing (scripts, commands…) startup runs. At least according to “top” command.
      Which means that, by restarting IceWM session, previous startup commands are not reset, but still running.

      Is there some way to fix it? To make that when restarting session all stuff in startup is also reset, so to have always only one instance of them.
      Already searched man page of IceWM, found nothing explicit…

      Thanks beforehand.

      #71614
      Member
      PPC
        Helpful
        Up
        0
        ::

        That never happened to me, as far as I noticed…
        Try putting your scripts/app in ~/.desktop-session/startup instead, and see how it goes…

        P.

        #71627
        Anonymous
          Helpful
          Up
          0
          ::

          Thanks very much!
          By putting them there there were no more duplicated tasks in “top” command or “lxtask” application.

          Just one doubt:
          in the AntiX wiki, in the “Desktop Session” page, it says that all stuff put in desktop-session startup must end with “&” (which means to be run in background).
          The stuff I put is a small while loop; I first tried putting it just as it is (after noticing first command in default startup has no “&” at the end), and seemed to work…
          Could I leave it like that, or better to enclose whole loop in “()” and end it with “&” ?
          What could be the difference?

          Thanks again.

          #71633
          Member
          Xecure
            Helpful
            Up
            0
            ::

            It is better to save the loop inside a separate script and call it from startup.
            For example

            $HOME/scripts/my-loop.sh &
            where my-loop.sh is a file containing your instructions with executable permissions. It could look like:

            #!/bin/bash
            
            while true; do
                echo "check battery"
                acpi
                sleep 120
            done
            • This reply was modified 1 year, 5 months ago by Xecure.

            antiX Live system enthusiast.
            General Live Boot Parameters for antiX.

            #71645
            Anonymous
              Helpful
              Up
              0
              ::

              It is better to save the loop inside a separate script and call it from startup.

              Thank you. That’s a good tip / reminder.

              #71671
              Anonymous
                Helpful
                Up
                0
                ::

                Thanks.

                So that’s the better practice.
                Though on first time I did it like putting loop raw code at the end of startup…
                Could there be consequences at mid/long term if doing it like this?

                #71825
                Anonymous
                  Helpful
                  Up
                  0
                  ::

                  Also, must I really make all stuff put here (either scripts or commands) to run on background? I.e., ending all of them with a “&” character.
                  Thanks.

                  #72278
                  Anonymous
                    Helpful
                    Up
                    0
                    ::

                    I apologize beforehand; but after looking for more info about “desktop-session” in general around internet, I found little to nothing. Mostly references to the forum here precisely.

                    I’d like trying to ask just once more, in case anyone could help or have an idea.

                    —Can there be consequences by putting raw code in desktop-session startup?
                    —Must I really make all stuff in here to run on background (ending them with “&” character)?

                    Thanks beforehand again.

                    #72282
                    Member
                    Xecure
                      Helpful
                      Up
                      0
                      ::

                      If the commands you add terminate and don’t continue running (like a simple check, or changing a file’s content, or enabling/disabling options), then you don’t need to fork it with the & character at the end of the line. If it launches a program that continues to run (like a toolbar, the volume-icon, etc), if you don’t fork it it will stop the desktop session to continue its work.

                      You can add all the amount of code you want, with loops or conditions or whatever, as long as you expect them to finish so that the rest of the file is read.

                      The startup file is sourced by desktop-session just after the window manager starts (with a X seconds session delay set by STARTUP_DELAY in the desktop-session.conf file). This means that it will read one line at a time, as if running a bash script. If the script stops at one point and doesn’t continue “down the script”, because it got stuck by a command that didn’t fork, then all commands after that line will not run.

                      We recommend using the & symbol to fork all the startup commands just in case (better safe than sorry), but if you have good bash and shell programming knowledge, you can do as you want there.

                      antiX Live system enthusiast.
                      General Live Boot Parameters for antiX.

                      #72293
                      Anonymous
                        Helpful
                        Up
                        0
                        ::

                        Thanks very much sir.

                        The stuff I’m putting is a small –yet indeed constant– while loop, involving Yad app to use as notifications.
                        As previously mentioned, I first put this block “raw” as it is, without “&” at the end, but at the very end of file.

                        Is this why I seemingly noticed nothing wrong? By a “coincidence”?
                        And no, sadly I’m no Bash expert at all…

                        Thanks again.

                        #72305
                        Member
                        Xecure
                          Helpful
                          Up
                          0
                          ::

                          As previously mentioned, I first put this block “raw” as it is, without “&” at the end, but at the very end of file.

                          Is this why I seemingly noticed nothing wrong? By a “coincidence”?

                          Correct. If it is placed at the end of the file, then everything else has already loaded so no worries here.

                          antiX Live system enthusiast.
                          General Live Boot Parameters for antiX.

                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.