Role of /usr/local/bin vs. /usr/local/lib for antiX

Forum Forums New users New Users and General Questions Role of /usr/local/bin vs. /usr/local/lib for antiX

  • This topic has 7 replies, 4 voices, and was last updated Mar 2-6:10 pm by olsztyn.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #78208
    Member
    olsztyn

      What is the reason for placing some antiX scrips in /usr/local/bin and other, even closely related scripts in /usr/local/lib?
      E.g.:
      – desktop-session-exit is placed in /usr/local/bin
      – desktop-session-restart is in /usr/local/lib/desktop-session/
      Is this intentional architecture design or some inconsistency?

      Thanks and Regards…

      • This topic was modified 1 year, 2 months ago by olsztyn.

      Live antiX Boot Options (Previously posted by Xecure):
      https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

      #78215
      Forum Admin
      Dave
        Helpful
        Up
        1
        ::

        Intentional. desktop-session-restart is a “lib” file used within desktop-session, desktop-session-exit is a script for the user to run directly (desktop-session-exit -R to run the restart). Another even more related example would be /usr/local/bin/desktop-session-exit vs /usr/local/lib/desktop-session-exit.py…

        Can you run the files in /usr/local/lib/desktop-session directly? Yes probably.
        Do they need to / are meant to be run directly? No not really.

        Other examples of this;
        /usr/local/lib/desktop-session/desktop-session-menu-window:
        Can be run directly to open a window to select another desktop (EG: the other desktops item in the application menu) but is meant to pop up via desktop-session when you start a desktop that is not a typical antiX “desktop”.

        /usr/local/lib/desktop-session/desktop-session-update-wm-menus:
        Can be run directly to update the application menu but is meant to be called when apt is run (via apt hook) to install / remove / update applications to automatically rebuild the menu to match the system changes.

        Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

        #78216
        Member
        afghan
          Helpful
          Up
          1
          ::

          I suppose it’s following the convention of putting executables into bin and libraries into lib. /usr/local/bin would be where all user created executables goes and can be invoked by the user directly. Notice that /usr/local/bin is in $PATH. /usr/local/lib should hold libraries or even modules of scripts that is technically only invoked by something from bin. They should not be invoked directly by the user; hence it is no in $PATH.

          This is my understanding at least. Perhaps somebody more knowledgeable can correct me if I’m wrong.

          Edit: As I was typing @Dave already gave a more concise explanation.

          • This reply was modified 1 year, 2 months ago by afghan.

          Beware of people who knows nothing; they are the ones that won't know that they know nothing.

          #78228
          Member
          olsztyn
            Helpful
            Up
            0
            ::

            Intentional. desktop-session-restart is a “lib” file used within desktop-session, desktop-session-exit is a script for the user to run directly (desktop-session-exit -R to run the restart).

            Thank you. What was confusing to me, desktop-session-restart is just a script, not a binary lib, linked to from antiX executable code. It can be run by user (such as meant to run as triggered by key combination defined by user, or just directly from terminal). E.g. if I want to switch sessions from IceWM to JWM or vice versa. This can be obviously also selected from menus.
            From such perspective the primary purpose of desktop-session-restart is to be run by the user, although can be (and is) being used by antiX menus.
            However I understand it was intentional design, so I take is as such, although it seems unnecessarily confusing…
            Thanks for the explanation.

            Notice that /usr/local/bin is in $PATH. /usr/local/lib should hold libraries or even modules of scripts that is technically only invoked by something from bin. They should not be invoked directly by the user; hence it is no in $PATH.

            Yes. I noticed that and this creates more trouble for the user, such as the entire path to desktop-session-restart must be defined in the key combination of user desktop session config to trigger switch to a different WM…
            Thanks and Regards…

            • This reply was modified 1 year, 2 months ago by olsztyn.
            • This reply was modified 1 year, 2 months ago by olsztyn.

            Live antiX Boot Options (Previously posted by Xecure):
            https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

            #78256
            Forum Admin
            Dave
              Helpful
              Up
              0
              ::

              The command in the key combination to restart the session should be
              desktop-session-exit -R
              Is there a specific reason to use the desktop-session-restart file directly?

              Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

              #78260
              Member
              olsztyn
                Helpful
                Up
                0
                ::

                The command in the key combination to restart the session should be
                desktop-session-exit -R
                Is there a specific reason to use the desktop-session-restart file directly?

                The reason for using desktop-session-restart script is to switch session to another WM. E.g. to switch from IceWM to JWM this would be:

                desktop-session-restart JWM

                Understandably there is another way provided in antiX – navigating through menus: Other desktops… However a better and quicker way is defining a key combination in IceWM config to switch between WMs on a key stroke using the above and similar keystroke could be defined in JWM config to switch session to IceWM to any other WM.

                There are good reasons for such switching WMs as needed, e.g. in my case in the past due to IceWM some annoying bugs, while JWM worked perfectly under the same conditions.
                But more importantly: Such necessity is even more pressing when using IceWM (or JWM) in conjunction with tiling WM, such as Herbsluftwm or DWM. It is very handy to switch between them preserving your work in progress…
                I hope this explains…
                Thanks and Regards…

                • This reply was modified 1 year, 2 months ago by olsztyn.

                Live antiX Boot Options (Previously posted by Xecure):
                https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

                #78341
                Forum Admin
                rokytnji
                  Helpful
                  Up
                  0
                  ::

                  For the ged educated guys like me. It beats trying to figure out what are .bin files vs .lib files if they were all thrown in /usr/local/lib/

                  I know antXcc, plus other useful scripts sit in there and makes for a cleaner output when I use

                  locate antiXcc

                  That is my dumbed down way of looking at things.

                  Sometimes I drive a crooked road to get my mind straight.
                  Not all who Wander are Lost.
                  I'm not outa place. I'm from outer space.

                  Linux Registered User # 475019
                  How to Search for AntiX solutions to your problems

                  #78348
                  Member
                  olsztyn
                    Helpful
                    Up
                    0
                    ::

                    It beats trying to figure out what are .bin files vs .lib files if they were all thrown in /usr/local/lib/

                    If I remember correctly, some time last year the issue of standardizing the location of antiX related files was raised and as much as I recall the following was decided:

                    – Binary antiX files (bin) to be located in /usr/bin
                    – antiX related scripts to be located in /usr/local/bin
                    – antiX related libs (true libs linked to from antiX binary executables) to be located in /usr/lib

                    If I remember correctly this was decided to standardize locations used for different types of code.
                    Having said that, there is a chance I may have misunderstood this initiative to make it uniform, rather than perpetuating the lack of uniformity. In such case that I may have misunderstood exact locations, anticapitalista as the antiX owner may want to correct me, please…
                    One way or the other I do not see where /usr/local/lib would be necessary to use, to host some antiX scripts, that ‘are not to be used by end user’, but just by antiX code.
                    Particularly taking the previously posted example:
                    – desktop-session-restart script is definitely used by end user,in order to switch session WMs, whether explicitly from terminal, assigning key strokes in WMs session config, or through menus (Other Desktops…). Placing such script in /usr/local/lib/desktop/session is causing just additional trouble for the user as it is not is not in a system path, therefore requires explicit specifying that location.

                    Therefore, perhaps some antiX experts (or even anticapitalista) could make it clear what exactly is antiX standard of directory structure.
                    Just my HO…

                    • This reply was modified 1 year, 2 months ago by olsztyn.
                    • This reply was modified 1 year, 2 months ago by olsztyn.

                    Live antiX Boot Options (Previously posted by Xecure):
                    https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

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