new applauncher.py

Forum Forums antiX-development Development new applauncher.py

  • This topic has 65 replies, 7 voices, and was last updated Jul 24-11:47 pm by BobC.
Viewing 15 posts - 46 through 60 (of 66 total)
  • Author
    Posts
  • #24341
    Forum Admin
    DaveDave

    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
    XecureXecure

    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 4 months, 1 week ago by Xecure.
    #24360
    Member
    AvatarPPC

    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
    Avatarskidoo

    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.

    #24855
    Member
    AvatarPPC

    Hi!
    On antix 19b2 64 bits, live, the new app select, that I got using “apt upgrade” today, now looks much better (no longer using the columns layout) and loads almost instantly (little more than 1 sec) but… all apps I tried to launch opened a Roxterminal window and a message with a error: “The new terminal’s command failed to run: Failed to execute child process “Unlock” (No such file or directory)”!!!

    A bit off topic:
    This weekend I had an idea partially based in app-select…
    One of the things that newbies probably find strange is that, for example, to add a quick launch icon to the toolbar, they have to edit a text file. There’s not much to it, but it scared me a bit for a while, until I got the hang of it.
    Having a GUI way to do that would be a nice amenity (yes, Im the guy that wants GUIs for everything, I know, but I belive it’s a way to reach the most people possible…)
    If I knew some programming I probably could try to use app/select funtions to create a nice way to add quick launch icons to icewm and jwm toolbars…
    In particular, adding icons to the default desktop, icewm is the easiest (just edit the toolbar text file, add a line starting with “PROG ” then, from the app-select columns the Name, Icon and Exec! It’s all stuff that app-select already picks up, and has only to be written in the desktop’s tray text file.)
    I don’t suggest a “add to tool bar button” to the existing app-select because I believe users would click it endlessly, filling up their toolbar in a instant… If you are willing to do this, it would be better in a app meant only for this purpose… A more elaborate one, also based on this great app would read the tray text file and display it in columns, allowing the user to move delete or add quick launch icons…
    I’m aware that making a full fledged quick launch “editor” would require a lot more work, translating the data from the text file to a icon, name and exec path, presenting each one visually in a line and allowing to move/delete/add icons… NOTE: I can see everyone saying BLOAT!!! If you want all that use ubuntu, or MX!
    but… we do have a icewm control panel — why isn’t it the the CC-desktop, I have no idea…
    but the toolbar quicklaunch icons seems to be the main feature missing there… I bet there are more users wanting to add icons to the toolbar than wanting to make it double the height…

    As always, thanks for this great app! Please fix this bug!
    P.

    • This reply was modified 3 months, 3 weeks ago by PPC.
    #24860
    Forum Admin
    DaveDave

    @ppc

    The idea for adding / removing items from the desktop / menu / toolbar… it is a plan. This is what I originally had the first bit of code sitting in my “toybox” directory for. There are the start of such already…. add/remove-desktop, add/remove-start, desktop-defaults, perhaps samk’s menu manager.

    I think it might work out better to make this app-select a python lib to load into other python scripts, but for now there should be the –select option for app-select to print the selection for another program to use.

    Also I am not seeing the problem that you are saying. Could you try the copy in gitlab?

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

    #24866
    Member
    manyroadsmanyroads

    @Dave do you think this might work on other wms like bspwm? If you want it tested on bspwm, I’m happy to try a test on my desktop.

    Pax vobiscum,
    Mark Rabideau - http://many-roads.com
    MX-19 kernel: 5.2.21-antix.1-amd64-smp
    "For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
    MX- antiX- bspwm, hlwm, xfce4

    #24867
    Member
    XecureXecure

    all apps I tried to launch opened a Roxterminal window and a message with a error: “The new terminal’s command failed to run: Failed to execute child process “Unlock” (No such file or directory)”!!!

    Also I am not seeing the problem that you are saying. Could you try the copy in gitlab?

    I experienced the exact same thing, but Dave’s gitlab version works perfectly.
    (in case someone missed it, Dave’s app-select project is hosted here: https://gitlab.com/antiX-Dave/app-select)

    #24873
    Member
    AvatarPPC

    Also I am not seeing the problem that you are saying. Could you try the copy in gitlab?

    @ Dave -Like Xecure said, the gitlab file works great, taking the same time to start as it did before… Is the almost instant start time connected in any way to the error I got?

    Also: about the add quick start icons to tray – There’s really no rush… But antiX already provides a drag and drop .desktop files to desktop, and a GUI way to edit the menu, but no GUI to add icons to the tray, that’s the reason I mentioned only the tray. In a initial try, if you want to go around this, the app could add icons to the tray file and have a button to open the tray text file, so the user could move the lines referring to the icon around (or delete lines). Copy and pasting a text line is way easier for newbies than creating a line from scratch, the main problem I believe is using the correct icon for the app… If your app already took care of that is a matter of moving lines around or deleting wanted lines…

    P.

    #24876
    Member
    AvatarBobC

    I’m working on a fresh 19b2 system and going to install and hook in the newest code here from https://gitlab.com/antiX-Dave/app-select

    That’s the latest, right?

    It either should be on the toolbar or main menu or hot key or multiple of those, IMO.

    Its so much better than Dmenu. DMenu is not a reasonable alternative for normal people, I don’t think. I really do believe that this will add a lot to the distro at a very small price of space.

    #24877
    Forum Admin
    anticapitalistaanticapitalista

    latest (fixed) version (0.1.2) should now be in repos.

    Philosophers have interpreted the world in many ways; the point is to change it.

    #24879
    Member
    manyroadsmanyroads

    I just installed app-select on an MX18.3 machine running bspwm. It does work quite well. I find the layout a bit ‘big’. I will explore/ test it further. If you are open to suggestions, a rofi like layout is more compressed and to my liking. I understand that “my liking” is probably at the top of your list… ;0 nor should it be.

    Pax vobiscum,
    Mark Rabideau - http://many-roads.com
    MX-19 kernel: 5.2.21-antix.1-amd64-smp
    "For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
    MX- antiX- bspwm, hlwm, xfce4

    #24914
    Member
    AvatarBobC

    Manyroads, maybe you should show Dave and Skidoo what you wish it would look like and say why, just in case they might make sense to someone to adapt if time permitted at some point.

    A comment/minor issue, but not related to the app itself…
    It might have just been a timing thing, but when I tried to update it via Synaptic, it didn’t want to, and then I went to the versions and forced it to load the newer version, and it updated fine after that. Since I don’t really know why that happened, and I was able to work around it, I’m mostly suggesting that you make sure you are running the newer version.

    One tiny feature I would like to see would be the ability to override the default filter to “Name” instead of “All”, perhaps via command line option or config file, but I can do it each time by pulling it down, so it’s not a big issue.

    It runs well, and I had no problems with it, other than wishing it there was launcher for it on the toolbar or down low on the main menu. If normal people can find it, it will be used a lot I think, and that’s the indicator of a very successful app.

    #24916
    Member
    AvatarPPC

    @ Dave – I agree with BobC when he said this application should be more visible, on the menu or as a shortcut on the desktop or quick launch icon on the IceWM/JWM bars…
    Also: nice touch, allowing users to choose the interface they like best directly in the GUI!
    Suggestion: I like the defaults, but it could be handy do have, on the start of the script, an option to select the default filter, like BobC asked.
    Additional suggestions: if I had to select a default position for app-select window it would be on the lower left of the screen, the default location of the menu.
    Also- please use the same icon app-image has on the menu- if the users “trays” app-select they get the default “X” icon, not the expected icon… Related to that- do you think it would be handy to have to choice to minimize app-select to tray by default? For users with more available RAM that want it instantly available, and not have to endure the small start lag (well I have a about 2 seconds start lag- not meaningful, but because I was used to j4 dmenu that was “instant”, I may notice it more than I should?)
    Is there a easy way to add apps without desktop files like wallpaper.py, xcalc, xeyes, etc to app-select?

    A bit off topic and also a personal suggestion: I talked about using app-select as a basis for quick launch icons… A middle ground could be to allow users to copy and past the exec, app name, and icon location (if this can be easily implemented). This way users wanting the create their tray entries would have that process very simplified, just pasting the stuff they need in the config file for their desktop (for example- I’m yet to find a simple way 100% sure to create IceWM toolbar entries always with the right icon when the .desktop file does not provide the full path to the icon- example, creating a SMtube toolbar icon using the data in it’s .desktop file did produce any usable icon, I had to choose one from the papirus icons that referred to YouTube…)

    Completely off-topic- I downloaded the new “Drill” search app, and when it popped up it made me think for a second that I was using app-select… It’s a file search app that by default lists and allows to search executable files! Maybe Drill’s creator saw app-select and got inspired by it? (by the way the last version runs great, but as a “bug”- it remains in memory after you close it’s window, taking about all the CPU cycles it can, trying to finish the last “search”… Be careful if you try it)

    Anyway- great launcher, needs to be better placed in antiX in order to be widely used (for me, in the menu, the logical places for it would be above all other application categories, almost like a “All apps”, Whisker menu style, or directly on the menu’s first layer, example- near the “run” entry).

    P.

    • This reply was modified 3 months, 3 weeks ago by PPC.
    #24920
    Member
    manyroadsmanyroads

    @BobC Attached is a screenshot of rofi (note the tabs on the bottom they are for separate functions). The rofi layout is also fully customizable.

    • This reply was modified 3 months, 3 weeks ago by manyroads.

    Pax vobiscum,
    Mark Rabideau - http://many-roads.com
    MX-19 kernel: 5.2.21-antix.1-amd64-smp
    "For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
    MX- antiX- bspwm, hlwm, xfce4

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