antiX 22: selecting preferred applications

Forum Forums Official Releases antiX-21/22 “Grup Yorum” antiX 22: selecting preferred applications

  • This topic has 80 replies, 9 voices, and was last updated Nov 24-6:29 pm by Robin.
Viewing 6 posts - 76 through 81 (of 81 total)
  • Author
    Posts
  • #93884
    Member
    PPC
    Helpful
    Up
    0
    ::

    @Robin –
    I tested an older version- the only old script I have on this machine is “20221024” – it works almost perfectly: – it’s a version previous to the one that included “Free choice”, and I just went trough all the categories it displayed – all options were perfect with one exception – slimjet displayed as “New window” (localized in pt-pt), other than that, perfect- it seems to correctly displayed all my installed apps, on the correct categories (but I just tried changing the Text Editor).
    And yes, smtube and ytfsz do need to be filtered out…

    Edit:
    I just tested version 1.3 – it’s the same as “20221024”, on this system, but with the Free choice button…

    Unless there is something wrong with my system, a version 1.31 that filter out the youtube apps and, if possible, ust the main “name[locale]” string (to avoid using addicional entries like “New window” that comes up in slimjet) would make it “perfect” for me- it’s fast and, as far as I can seem flawless, if those problems are solved.

    P.

    • This reply was modified 2 weeks ago by PPC.
    #93886
    Member
    PPC
    Helpful
    Up
    0
    ::

    I edited the 1.3 version to remove smtube, pmrp and ytfzf from video/audio player list, also centered both windows…
    Please test it, Robin et all…

    P.

    #93935
    Member
    PPC
    Helpful
    Up
    0
    ::

    I’ve tested in more detail my proposed 1.3.1 script – I noticed it displays “gtkcam” in the Image Viewer apps- I’ll have to use “sed” to cut that out of the list too. Other than that, I think all suggested .desktop files are perfect, for every category.

    I’ve located the problem with slimjet – that may happen with other apps: Since it’s a “unstranslatable” app name, no “Name[locale]:” fields exist, that the script can pick up, except for those fields that are below the line [NewWindow Shortcut Group].
    The solution to avoid similiar problems is, of course, remove, from the analised .desktop files, all lines after that “NewWindow” string. But I’m unsure where to implement that… Any ideas? Robin? Bobc?

    edit:
    as an alternative to avoid similar problems in the future, I suggest it’s better to stop parsing .desktop files on the second line that starts with “Name=” (I hope this stops the script using any Name field that is not directly related to the Name of the app, but to the name of some funcion, like opening a new app, sending e-mail, etc).
    If you want, I can attach slimjet’s .desktop field…

    edit2:
    The more I try to test scripts based in the 1.3 version, the more frustrated I get – I noticed that, for example, in the video player fields, VLC and Xine were not detected, and that, for some reason, Calibre-reader came up in the Image Viewer field… I’ll try some tweaks more and then I’ve have to stop tweaking it…

    P.

    • This reply was modified 2 weeks ago by PPC.
    • This reply was modified 1 week, 6 days ago by PPC.
    #93947
    Member
    Robin
    Helpful
    Up
    0
    ::

    But I’m unsure where to implement that

    The more I try to test scripts based in the 1.3 version, the more frustrated I get

    That’s the reason why I have rewritten the complete filter logic. If you want to deal with these issues, you’ll have to check the very same things and structures the 1.4 version of filter does. The structure of .desktop files is pretty complex to parse, and I wouldn’t have managed to build up the new filter logic if I hadn’t dealt with exactly these issues in the most recent version of our internal „desktop-übersetzen.sh” script for transifex upload, translation and harvesting of antiX .desktop files translations (the new version will be soon available at gitlab).

    For preferred applications script we need here an universal solution, able to deal with even unknown .desktop files of programs some user might install. We can’t reprogram the complete script again and again to add one exception after the other to its filter code once we find it. Hence we need an external filter setup file, easily to update, maintain and adapt to future needs. All this you can’t achieve with the 1.3 version.

    But please feel free to program a filter logic function with same proper functionality, working faster than mine. It is modularised in 1.4 version, so it can get easily replaced by a faster structure, simply by replacing the filter_selection() function. I’m not a programmer, so I simply can’t get it faster, I have to rely on basic bash scripting functionality. Maybe some advanced programming techniques I don’t know of might help, and I’d be glad if an experienced programmer could show how to do this filtering task faster.

    I suggest it’s better to stop parsing .desktop files on the second line that starts with “Name=” (I hope this stops the script using any Name field that is not directly related to the Name of the app

    That’s simply not possible this way, since the sort order of entries in .desktop file within a section is subject of change, and also the sort order of sections, which is not guaranteed. If dealing with .desktop files you need to parse them properly, otherwise things will get messed up. The „Name=” field you need might be present in second or third section only. What really counts is the Section header, and then you’ve to look up the „Name=” entry in this very section, and also the „Name[lang]=” entry. If you implement this into 1.3, it will be also slow…

    – The “* unstranslated string” warning was a nice touch, but I think it confuses people- most app names are not localized, so most app names came up with that warning…
    – Have the main window and the update window centered (yes, window managers tend to open windows on random places, unless told so otherwise)

    That is legacy from Bob’s version from 28.10.2022 — I’ve simply taken this behaviour over to 1.4 from what I found, along with some strange variable naming. If people consider this should be removed or changed, I’m also fine with this. These tasks don’t slow down processing noticeably.

    why not use, as window icon, the same “Yellow star” icon that is on Control Centre? […] The icon should be this one: /usr/share/icons/papirus-antix/48×48/places/bookmarks.png

    Yes, the icon actually should be the yellow star. But we shouldn’t rely on a path here, since this very path is not available on all antiX versions. The icon paths are subject of change (see all the erlenmeyer bulbs of older scripts displayed in taskbar when running in newer antiX versions). So we have either to rely on a named gtk icon, or install our private icon we can control the path, as I did in antiXscreenshot2. I noticed this problem in aCSTV, the selected icon of antiX 17 wasn’t any longer present in antiX 19… But yes, we actually will use the yellow star Bob has introduced. It’s fine, and was not meant to be changed. We simply need to rename it, and put it to the set of files prepared for the installer.

    Have a tooltip when the mouse overs above the buttons, explaining what the “Update” and “Free choice” do,

    Simply yes. Good suggestion, many thanks!

    Windows is like a submarine. Open a window and serious problems will start.

    #93951
    Member
    PPC
    Helpful
    Up
    0
    ::

    Thanks for the reply, Robin

    I can’t, right now, study the scripts in any detail, so I can’t really understand the parsing that it’s done (not 1.3 and much less version 1.4), and see why it takes so long, but I can offer some suggestions and you can ponder, to try to increase v.1.4’s spead (sorry, I can’t focus in reading a long and complex script, but I can test a few lines of code).

    All files in the default .desktop folder can be parsed to try to find relevant words: example “Web”, for the web browser category, “video” for the video player category etc.
    then the script can parse that small list, on a 2 steps process:

    Example:
    find /usr/share/applications/ -type f -exec grep -l "video" {} \;

    Lists all .desktops related to video. It’s then a matter of, on a second step, applying a exclusion list, to remove the ones that don’t matter and then searching for the (localized) application name

    I quickly tested this for also “web”, “audio” “TextEditor”, “TerminalEmulator”, “Graphics”, “e-mail” and “FileManager” – and it never failed to include all the correct apps for each category. The complete lists for each category are generated in no more than 5 (usually less) seconds for each one, on this crappy single core computer with very slow HD (so 8 *5= less than 40 seconds to generate the list) . I’m assuming running an exclusion list on each category would take no more than that, so less than 80 seconds to parse the entire .desktop list. That’s less than whay v.14, takes to run on this computer…
    Does any of this help, Robin?

    I can search on-line, later, how to use python to parse .desktop files – unfortunatly, I know exactly 0 about python…

    P.

    #93963
    Member
    Robin
    Helpful
    Up
    0
    ::

    then the script can parse that small list, on a 2 steps process:

    Yes, good suggestion. I thought about it myself already, but I believe this isn’t possible: Neither MIME entries, nor manually included executables will be caught this way, since they lack of the keywords regularly. And the exclusions would need a next step again. Not sure whether we’ll save time in the end, but this can only be found out if the respective filter code would be written and tested.

    I can search on-line, later, how to use python to parse .desktop files – unfortunatly, I know exactly 0 about python…

    Save your time, the new .desktop files translation script, containing a complete .desktop file parser, is written in python (was not that easy, actually, and I have actually borrowed some ideas for it from other gpl3 projects, since I’m completely new to python myself.) You can simply study the code once I’ve uploaded it.

    Windows is like a submarine. Open a window and serious problems will start.

Viewing 6 posts - 76 through 81 (of 81 total)
  • You must be logged in to reply to this topic.