new applauncher.py

Forum Forums antiX-development Development new applauncher.py

This topic contains 48 replies, has 7 voices, and was last updated by skidoo Jul 12-10:38 am.

Viewing 4 posts - 46 through 49 (of 49 total)
  • Author
    Posts
  • #24341
    Forum Admin
    Dave
    Dave

    I would need some time to study python and gtk stuff, and try to help with this project more than I can right now. For future versions, I would like to try adding two extra tabs, one for “Recent Apps” and another for “Options” which would read/save from/to a configuration file (which in the future could be saved in ~/.conf/antiX-launcher-name/) that would give options:

    Would recent apps be the ones that you recently ran?
    If so I think we would be looking at making an index file with a format like:
    app id (probably .desktop file name) | [0-9][0-9] (index value)
    every time a program is run it would increase the index value by one. I am not certain how to limit the number increase or change the index of the others to give the one run more priority off the top of my head though. Then again number processing is quite quick… so what if your number #1 app is run 10 billion times in a year 😛 Interesting statistic though LOL.
    This index could then be used as a sort by value using a check box or as an option.

    For the “options” page, it is more commonly done via a dialog and menu vs another tab but by all means a tab would work to. As would a simple text file…. ( Hehe coming from the guy that made programs to edit the config files. 😛 Very well; As you were. )

    – display-icons = true/false (if false, no icons are displayed and the script would change so it doesn’t waste time searching for icons, decreasing the time it takes for the .py app in first launch)

    Initially on board with this. Easy to do as well. Not found of reading through the entire list myself as then I would think sort by category… and if sort by category then menu? However I can see merit to this with using the search function against the description or low spec machines.

    – save-icons = true/false (if true, and display-icons=true, on first launch it would save all paths to icons in a file named icon-path inside ~/.conf/antiX-launcher-name/ and, every time it launches, it would use this path for the icons instead of searching for them -> Improve consecutive first-launches in the future)

    85+% of the icons can be found really quick as they are working with proper naming against the icon theme selected.
    Another good chunk already have the full path specified or can be found by specifying the pixmaps folder path (/usr/share/pixmaps/) in front of the Icon= specification. Again very quick and expectable IMHO if your app does not fit with the icon theme.
    It is the last ~ 15 items that take the time as the program crudely runs the locate command to try and find the image file and takes the first file found ( which is not always an image file and is even slower if the program checks each item to see if it is an image. If you would like to see the difference; comment out line numbers 93 – 98. I would like to do this ( some item we can fix as they are our own .desktop files ) but some are not as easy to fix ( here is looking at you feh! ). Actually I just did a real comparison counting the number of items on my production install and the number of no image found icons only went down from ~ 15 to ~10 with the locate command which I doubt is worth the wait. Another machine that I tested on when down alot more but that is mostly due to our in house application .desktop files which have already been fixed in V17/19. We will leave that commented out by default.

    – exclude-apps = true/false (If true, a list of app-names in a file called exclude-list hosted in ~/.conf/antiX-launcher-name/ will be used to hide these apps from the list in the app).

    This would go well with the previous idea of an index file. Just add a hide value to the index…
    app id (probably .desktop file name) | [0-9][0-9] (index value) | True (hide)

    – recent-apps-bool = true/false (If true, it would populate the “Recent Apps” tab with recently launched apps)
    – recent-apps-amount = integer (I propose as BobC, maximum 50 – If Recent-apps-bool=true, It will generate and read/write from/to recent-apps file inside ~/.conf/antiX-launcher-name/ where the app-name of each app launched would be saved, placing at the top the most recent, and this info would populate the “Recent Apps” tab in such order, where the user can find and launch recent Apps) -> Very Very Future

    Noted above in first statement.
    Your way is probably a much cleaner way (aesthetically) but likely more difficult and bulky to implement (code wise). Then again I have no explored either way so I am only speculating)

    – custom-apps-path (under this “variable”, a list of paths will be saved, starting with /usr/share/applications/ there as default. All new paths added will be used by the script to search for .desktop files there and to add them to the app-launcher every time it launches.) Possibly, if they have the same app-name, only the first app found will appear in the App launcher, so the order in the path list will be very important.

    Uhm the app searches via xdg menu standard so every directory should then have a menu file to go along with the directory (as is the case with the personal menu in /etc/xdg/menus/TCM-menu.menu. That being said I have added by left out commented for the moment the ability to view the local applications / personal menu ( ~/.local/share/applications/ ) and autostart folder (~/.config/autostart). It is quite crude at the moment as all it does is crawl the directory and blindly add the files found to the list store. I think this opens up the possibility of a lot of nasty things without any sanity / safety checks. If you know the directories are safe and care to try it by uncommenting lines 120 – 128

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

    #24347
    Member
    Xecure
    Xecure

    Dave, thanks for the detailed answer. I have learnt a lot.
    All that I wrote were just ideas. For now it is better to check that the current version works well. Experimentation can come later.

    85+% of the icons can be found really quick as they are working with proper naming against the icon theme selected.

    Then, instead of an option to save icon paths, an option to enable deep icon search (dissabled by default) that would use that comented lines of code to search for all difficult to find icons, in case the user doesn’t care for it to take a bit longer to load.

    Xecure wrote:

    – exclude-apps = true/false (If true, a list of app-names in a file called exclude-list hosted in ~/.conf/antiX-launcher-name/ will be used to hide these apps from the list in the app).

    This would go well with the previous idea of an index file. Just add a hide value to the index…

    The index is a better idea. If formated correctly, it would make it easy for both Recent apps and hiding apps.

    Uhm the app searches via xdg menu standard so every directory should then have a menu file to go along with the directory

    Ok. Now I understand this better. Better not change it. If someone wants to add their .desktop files, do it ~/.local/share/applications they can link them to their menu instead of the app search. I need to investigate.

    If you know the directories are safe and care to try it by uncommenting lines 120 – 128

    I tried to test this and I only got errors I don’t yet understand. I will continue learning.

    Thanks for all the hard work!

    • This reply was modified 5 days, 11 hours ago by Xecure.
    #24360
    Member
    Avatar
    PPC

    Hi!
    @Dave- I tested the latest app-select from the git page and it starts in about 2,5 seconds (on a 10 years old pc), about as fast as I remember the first versions starting… Very good job!

    I’ve been following the comments about possible future changes for this great app (that has not even been oficially released!!!)
    And I want to throw in some ideas, many you folks (Dave, Skidoo) can make something out of them. Here they go…
    Some possible ideas for the future:
    -did you guys ever thought that, if app-select was able to start a bit faster- in the 1 second range, with some very minor tweaking, it could be used as a “menu” (something like “antiX-menu”)?
    All that involves is removing the window decorations (if possible) and add some “essencial” icons like desktop-session-exit and Control Centre, and you are set.
    There a few more that could be added like the default terminal, default file manager and default Internet Browser, maybe even “Other desktops”, filling the top line of the window…
    It would do away with the current menu overcrowding situation.
    But… I realize most people are used to follow application categories (cliking Menu- applications-Office-LibreOffice Writer, for example), and are so used to doing that that typing the app’s name or scrolling down to double click it would take them longer than using the menu the way they are used to, sometimes for many years (I sometimes still click the menu and Exit, when I have a exit icon on my toolbar, next to the clock)…
    A kind of middle-ground would be something like the (I belive now extint, replaced by launchy) Panther Launcher… It’s a 220kb .deb file download (I found a antiX compatible version in https://launchpad.net/~enso-os/+archive/ubuntu/panther-launcher/+packages
    ), but it has a libgee dependencie on antiX 19b1 (I was lazy and did a sudo apt install libgee* just to be on the safe side), but it runs extremely fast- provides both navigating all apps (like app-select does) and also by categories (looking a lot like a mix of a “normal” menu and the current Windows 10 menu) and also allowing to search for applications. Now there’s good design in my opinion, way better than the current Windows 10 menu, that I only used a couple of times, but I digress… Phanter has one main problem- out of the box, it stays resident in memory, a bit no-no for most antiX users with limited hardware…

    If possible- running apps that run from the terminal without the terminal menu, would make them look more “modern” in my opinion- I tried that- with alsa mixer and a few more, and they look more like a normal “gui” window that works only via keyboard, not something running inside a terminal…

    I don’t expect, or even really want, any of this implemented (except, if technically possible a (even more) almost near instant app-select launch without it staying resident in memory, like Panther), I’m just throwing in some features and design ideas for this great application…

    I hope app-select gets a toolbar icon next to the menu in the next beta (at least in iceWM and JWM, I know it would imply major changes to do that in Fluxbox), so people get used to click it to search apps. I even found some apps I never heard about, using app-select!
    Thanks for all your hard work…

    P.

    #24394
    Member
    Avatar
    skidoo

    re: Recent Documents

    Here you can see how/why several sources would need to be polled (and/or indexed)
    github.com/kupferlauncher/…/plugin/documents.py

    The kupfer scripts contain quite a lot of relevant for-study code. If attempting to incorporate additional functionality beyond “list all .desktop launchers”, I would be inclined to pare down from kupfer v2.0.8-6 rather than reinventing the wheel. The kupfer fuzzy search is admirable, and it already handles recent documents (plus myriad other on/off toggle-able plugins).

    Such a richly featured python+gtk application cannot avoid a “20MB+” memory footprint… and, once an applauncher morphs into everything-erator, it probably doesn’t make sense (for the sake of “session Used RAM frugality”) to repeatedly start/stop the application and have it re-parse the directory contents (anc icon paths) each time, instead of just iconifying (minimize to tray) the application between uses.

Viewing 4 posts - 46 through 49 (of 49 total)

You must be logged in to reply to this topic.