app-select

Forum › Forums › General › Software › app-select

  • This topic has 18 replies, 7 voices, and was last updated May 26-12:27 am by sybok.
Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #103182
    Dave
    Forum Admin

      App-select has been updated and can be found here:
      http://gitlab.com/antiX-Dave/app-select-antix/

      Looking to have some testing of the app before submitting a merge request to antiX-Linux.

      Current major updates:
      Updated app-select.conf
      – removed hard set items leafpad and mirage (open in text and view image); exchanging them for desktop-defaults-run.
      – added add-desktop options (open in add-desktop, send to desktop, send to personal menu). This also requires and updated add-desktop found here: http://gitlab.com/antiX-Dave/add-desktop-antix
      – Added a options / context menu button beside the apply / exit buttons
      – added mime type associations to the output of the applications, also a filter in the search for mime types.
      – added a mime type “editor” to the options / context menu to set the selected application as default for the selected mime types it supports.

      To “install”:
      – clone the repo and enter the directory
      git clone http://gitlab.com/antiX-Dave/app-select-antix/ && cd app-select-antix
      – remove the already present symlinks (leafpad and mirage) in /usr/lib/app-select/plugins and replace with the symlinks to desktop-defaults-run and add-desktop

      sudo rm -r  /usr/lib/app-select/plugins/leafpad && sudo rm -r /usr/lib/app-select/plugins/mirage 
      sudo cp ./lib-app-select/plugins/* /usr/lib/app-select/plugins

      – copy the as_mime_editor plugin to /usr/lib/app-select/
      sudo cp -r ./lib-app-select/as_mime_editor /usr/lib/app-select/
      – remove (or edit) the current copy of app-select.conf and exchange or merge with the new one
      rm ~/.config/app-select.conf && cp ./app-select.conf ~/.config/app-select.conf
      – replace app-select with the newer version (or run locally with ./app-select)
      sudo cp ./app-select /usr/local/bin/app-select

      Notes:
      – please start app-select from terminal to catch any outputted errors
      – there may be issues with the cache file that causes an error. There is a check in app-select to see if the cache file is the older version (without mime types) and should automatically rebuild the cache file to make a newer version (with mime-types). If you receive and error in terminal on first run, please copy it and then run rm ~/.cache/app-select before trying to run it again.
      – for the updated add-desktop, downloading the add-desktop script (http://gitlab.com/antiX-Dave/add-desktop-antix/-/blob/master/usr/local/bin/add-desktop) and replacing the version in /usr/local/bin/add-desktop with the newly downloaded version should be enough to have the updated add-desktop options working

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

      #103185
      Brian Masinick
      Moderator

        Dave, I gave it a try on an old Hewlett-Packard product: s5747c desktop and it works fine, didn’t see any errors and I tried several apps after modifying the system with this version. Unless there’s something wrong with a particular app, it looks good. Hopefully a few more people will take a look, but in the meantime the instructions looked good and it worked fine.

        Just make sure you’re in the app-select-antix directory; if the cd following the git doesn’t work or you do anything in between, you won’t be in the right place to copy stuff exactly as in Dave’s directions, but if you follow carefully it seems to be fine!

        Thanks for your efforts Dave!

        --
        Brian Masinick
        Alternate "Search B":
        This search page

        #103272
        caprea
        Moderator

          Many thanks for your efforts, Dave, I tested it on antiX21 and still have problems with the new right-click options, respectively they work now very good and open the applications in add-dektop, but add-desktop does not work.
          This is might due to my some years old antiX21 installation where I tinkered and tested a lot.I must say I never used add-desktop before.
          The “send to desktop” option from app-select creates an application/.desktop in the /Desktop folder but in none of the window managers it is shown as shortcut/icon on my desktop.

          The “Send to Personal menu” adds nothing to the personal menu , but if I execute from terminal
          desktop-menu --desktop-code="$code" --menu-file='/etc/xdg/menus/TCM-MENU.menu' --write-out --write-out-file='personal'
          the added applications appear immediately on the Personal menu.
          As already mentioned might caused by my tinkered system. So I will test the above on a clean antiX23 installation later and give feedback.

          In the above instruction there’s a typo in the second codeblock, one sudo is missing
          sudo rm -r /usr/lib/app-select/plugins/leafpad && sudo rm -r /usr/lib/app-select/plugins/mirage

          #103276
          Brian Masinick
          Moderator

            Caprea, you’re right about the corrections; I changed sudo rm -r /usr/lib/app-select/plugins/leafpad && sudo rm -r /usr/lib/app-select/plugins/mirage

            but forgot to mention it; other than that it works fine and I’ve now tried it on antiX 23 Beta 1 first and today I repeated it on antiX 22.

            --
            Brian Masinick
            Alternate "Search B":
            This search page

            #103282
            Dave
            Forum Admin

              @Caprea did you copy over the newer add-desktop?
              Were there any errors displayed in the terminal?

              Which app did you use to try to send to desktop or personal menu (and which language)? I would like to try and reproduce the issue.

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

              #103330
              caprea
              Moderator

                did you copy over the newer add-desktop?

                Yes, I renamed the old one to /usr/local/bin/add-desktop.bak and copied the downloaded one to /usr/local/bin/add-desktop, had to change ownership to root and make it executable.
                I tried arandr for example,the language is german.Nothing in terminal.

                • This reply was modified 3 years, 6 months ago by caprea.
                #103502
                Dave
                Forum Admin

                  @Caprea:
                  I booted the antiX 23 beta iso with the German language selected and 2 issues I noticed.
                  1. add-desktop had the path for the desktop directory hard coded as $HOME/Desktop. This has been changed to use $XDG_DESKTOP_DIR to account for the locale change. For the personal menu, there was an extra menu refresh line that was also static/hard coded and not needed. After fixing these items, add-desktop would add the app to the desktop folder if manually running the string from app-select (like: add-desktop -a some|information|about|the|app) but app-select would not work. Which brings up issue number 2.
                  2. Though the files in lib-app-select/plugins in my gitlab are symlinks to add-desktop and desktop-defaults-run; twice during testing when I copied them over to a fresh boot of the iso the symlinks became copies of the file. This is why app-select acted like it was using an old copy (not working) of add-desktop even though the newer copy was in /usr/local/bin/ as noticed after repairing issue number 1. After removing these files and making new symlinks to /usr/local/bin/ app-select was working for both send to desktop and send to personal.

                  These should be repaired in the newest add-desktop from http://gitlab.com/antiX-Dave/add-desktop-antix/ and by verifying that the file in /usr/lib/app-select/plugins are actually symlinks to /usr/local/bin/(add-desktop|desktop-defaults-run)

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

                  #103508
                  RJP
                  Member

                    @Caprea:
                    I booted the antiX 23 beta iso with the German language selected and 2 issues I noticed.
                    1. add-desktop had the path for the desktop directory hard coded as $HOME/Desktop. This has been changed to use $XDG_DESKTOP_DIR to account for the locale change. )

                    The same problem is in add-desktop script, which does not work other locales than english. The fix is change FILE_WRITE_LOCATION line as

                    FILE_WRITE_LOCATION="$(xdg-user-dir DESKTOP)"

                    #103618
                    Dave
                    Forum Admin

                      @RJP,
                      What is the difference between “xdg-user-dir DESKTOP” and $XDG_DESKTOP_DIR?
                      As expected (to me) these produce the same result in the random languages I have chosen booting from ISO.
                      Both reference ~/.config/user-dirs.dirs; “xdg-user-dir DESKTOP” references it when the command is run and $XDG_DESKTOP_DIR is an environment export when the desktop environment is started (in /usr/local/lib/desktop-session/desktop-session-xdg-dirs.sh).

                      Maybe I am missing a reason why “xdg-user-dir DESKTOP” is preferred over an environment variable?

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

                      #103620
                      RJP
                      Member

                        @Dave Both of them are working.

                        #149483
                        ile
                        Member

                          Hello App-Select
                          There are “deprecated” items in add-desktop.
                          “Encoding=”UTF.8 key needs deletion.
                          (It is default) Item Category $categories “Application” value needs deletion.

                          #205243
                          anticapitalX
                          Member

                            tried to run app-select in my super minimal antiX .

                            $ app-select                           
                            Traceback (most recent call last):
                              File "/usr/local/bin/app-select", line 45, in <module>
                                missing_icon = icon_theme.lookup_icon("application-x-executable", icon_size, 0).get_filename()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            AttributeError: 'NoneType' object has no attribute 'get_filename'
                            

                            I had to edit line 45 of /usr/local/bin/app-select file:

                            #missing_icon = icon_theme.lookup_icon("application-x-executable", icon_size, 0).get_filename()
                            missing_icon = "/usr/share/icons/Adwaita/symbolic/actions/action-unavailable-symbolic.svg"

                            now app-select works and shows this output in terminal :

                            Cannot get filename for icon

                            now app-select works as expected .

                            I hope this information helps you @Dave , to fix this issue in the future .
                            thanks
                            ———
                            app-select version == 2.3

                            • This reply was modified 4 months ago by anticapitalX.

                            Let's accept antiX as it is
                            Pure and Elegant by its nature

                            #205274
                            sybok
                            Member

                              My attempt using version on an antiX 26-ish system (app-select-antix: 2.0.12, fluxbox with papirus-antix 48×48 theme).

                              Your fix assumes that Adwaita theme is installed, which makes it an assumed dependency.
                              I also get the “Cannot get filename for icon” message but no traceback; did you modify the script?

                              Anyway, I tried to run pure Python on my antiX install.

                              from gi.repository import Gtk
                              x = Gtk.IconTheme.get_default()
                              y = x.lookup_icon("application-x-executable", 48, 0) # The-hardcoded string should be modified!
                              y.get_filename()

                              which produced the following message

                              <python-input-1>:1: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version(‘Gtk’, ‘3.0’) before import to ensure that the right version gets loaded.

                              and the result of get-filename is ‘/usr/share/icons/papirus-antix/48×48/mimetypes/application-x-executable.png’ is selected and this file is present in my system.
                              @anticapitalX:
                              What is the output of the following command?
                              find /usr/share/icons/ -name '*application-x-executable*'
                              You could switch theme to one that contains it or you could create a “dummy” file of that name in your current theme.

                              @dave:
                              A possible fix is to iterate over several options (in order to cover for more themes), icon names and/or sizes, when looking up the icon in the default icon theme.

                              for an_icon_name in ('application-x-executable', ...): # Other options
                                  if bool(icon_theme.has_icon(an_icon_name)) is True: # The bool(...) is just for sure since e.g. NumPy bool comparison with pure Python's bool fails.
                                      # select and break from the iteration
                              #205285
                              anticapitalX
                              Member

                                You could switch theme to one that contains it or you could create a “dummy” file of that name in your current theme.

                                I suggest adding a non-fatal fallback mechanism.

                                If a theme or icon set is missing, the script should:

                                Log a warning (non-fatal error)Not block app-select from running

                                This improves resilience across minimal or custom antiX installs.

                                Let's accept antiX as it is
                                Pure and Elegant by its nature

                                #205287
                                sybok
                                Member

                                  I suggest adding a non-fatal fallback mechanism.

                                  I support that, the text you quoted was merely a workaround.

                                  The fall-back, IMHO, would have to be either
                                  A) an icon image file that is always there in any theme, hence the tuple values iteration to get some flexibility, or some kind of mapping, e.g. dictionary <key = theme>:<value: str = icon image file>, to select an icon image file,
                                  or
                                  B) not using Gtk icon in the case the expected icon image is not there; which I expect not to be practical|feasible in a GUI Gtk-application.

                                  BTW, I find it somewhat amusing|ironic that the app-select crashes because the ‘missing_icon’ variable cannot be filled because the expected icon image file is missing.

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