Forum › Forums › General › Software › Dynamic Toolbar or App grid menu that adds/removes options dynamically
- This topic has 39 replies, 8 voices, and was last updated Oct 28-11:10 am by BobC.
-
AuthorPosts
-
August 29, 2021 at 11:25 am #65966Moderator
BobC
Imagine there was such a thing as a Dynamic toolbar or App grid menu (like on your phone) available that worked from a log of apps run from the menu, toolbar, or app-select. It could be turned on or off, and a cron job would run periodically that would regenerate the options list, perhaps just adding new items to the end. The launcher program displaying the toolbar or app grid menu would need to be very efficient to run quickly on older hardware.
Concept:
Reserved apps – Include manually reserved apps in particular positions no matter if they were ever run or not. Preferred app defaults for example maybe should always be included.
Excluded apps – Exclude unwanted apps no matter how many times they were run.
Dynamically selected apps – Analyze all other apps run from menu or toolbar (from the log) and use an weighted average number of times run per week within the past XXX weeks, based on an Alpha factor, similar to an Exponentially smoothed average.
Then rank the apps from highest usage to lowest, take the total number of apps allowed, subtract the number of reserved apps to arrive at the maximum number of dynamically selected apps to be included on the toolbar. Include that number of highest usage ranking apps.
Save copy of previous toolbar version, generate new toolbar to replace it. Restart window manager or prompt for same.
Other related thoughts:
Possible design improvements – It would be nice if it could show a very high number of apps so that new ones used could just be tacked on the end of the list or resorted, if desired. A GUI program to maintain/organize the list would be even better, especially if built in (like on the phone), but maybe not critical.
To do this requires using a menu launcher that can optionally log the entries run, and a toolbar or app grid menu capable of holding many entries.
It’s sad that IceWM’s menu is not able to do this. I tried asking the Devs, but they don’t want to work on it. That will force me to use either a different window manager, or a different menu and toolbar system with IceWM, which would add overhead and could make it unsuitable for older hardware. I haven’t found a window manager or menu system that will help with the logging part, or is simple enough for someone with my limited skills to modify.
In the past, I’ve seen toolbars that worked like a carousel where the one being hovered over is larger than the others and a tooltip about the one being hovered over might appear. Another possibility would be a popup commonly used apps grid menu, like on a phone, that would make it easy to get a much longer, perhaps categorized list on the screen efficiently. It might be that one of the existing lightweight menu systems can do this…
Any ideas of possible existing programs that could be used to do the menu, app grid menu, or toolbar parts of this? I think I could write the batch part that analyzes the usage and decides what apps should get added to the toolbar or app grid menu…
- This topic was modified 1 year, 8 months ago by BobC.
August 29, 2021 at 12:15 pm #65981Member
oops
::Imagine there was such a thing as a Dynamic toolbar or App grid menu (like on your phone)
Hello,
Not sure it is a good idea to have this ability, this kind of tool is obsolete now (eg: preload – Adaptive readahead daemon)
… And this may be considered as a “bloat” feature šAugust 29, 2021 at 12:28 pm #65982MemberModdIt
::Hi BobC,
after half a day solely using menu on Bullseye a2 Beta then getting fed up and setting up task bar starters
my thoughts went in the same direction as yours.
To me the only more efficient way to start applications than the toolbar would be keyboard shortcuts.That would put off many users, autohiding taskbar is user friendly, as you note adding applications not always so
easy. I was reminded of that while creating starters for appimages today. I use ungoogled chromium and Librewolf
quite a lot. Site compatibility problems otherwise.I think the idea of populating the taskbar based on usage a pretty good idea as long as a mechanism exists to lock
starter buttons in position and to prevent automagic removal of not so often used but important items.I still have buttons for some autostarting applications, I set Claws to autostart to desktop one for majority of users.
For others placement of applications to a specified desktop is very useful. Moddit standard is 6 desktops which works
fine, even on my eepc.- This reply was modified 1 year, 8 months ago by ModdIt.
August 29, 2021 at 12:35 pm #65984MemberModdIt
::@oops, I think the feeling of bloat comes when searching for menu items, there are a lot of entrys and many
applications that I do not find immediately. I tried to live with near sole use of the menu, was fed up very
quickly.I do not think antiX is bloated, would reserve that term mainly for any system with gnome desktop. But then
I intensly dislike that sluggish mess.August 29, 2021 at 12:44 pm #65985Member
oops
::I think the feeling of bloat comes when searching for menu items
Yes probably, but not only (deamons and process are also checked).
August 29, 2021 at 2:03 pm #65992Member
Xecure
::Can anyone confirm if this is the function used in icewm to launch all apps from menu/toolbar?
https://github.com/ice-wm/icewm/blob/master/src/yapp.cc#L392If so, you could modify the icewm code so that on the lines before (or after) launching the program (I presume the ones starting with execvp), you could send the path and arguments (the command that is going to be run) to a different program (the app-use-log or whatever name has the script you are creating) so that it does its magic.
This way only apps run from icewm (menu or toolbar) are registered by this program, and not the ones from commands on the terminal or app-select or launched from other apps.
I am barely a baby in the C language, so I cannot help that much here. This is just a possibility I thought of, as I have no idea how to set up a daemon to track what programs are being launched manually vs the ones launched by already running processes (like connmand calling wpa_supplicant, connman-vpn, etc.).
Also, it requires compiling a custom icewm version, so you would need to keep having to compile a new version yourself with this patch every time you want to update icewm.antiX Live system enthusiast.
General Live Boot Parameters for antiX.August 29, 2021 at 3:00 pm #65994MemberPPC
::I can see a low tech solution to have a log of currently running apps- run xlsclients (to list all open apps) using cron every 30 or 60 seconds,
ex:
xlsclients | awk '{print $2}' |sed '/^\//d'and log the output with a time stamp. You can then process the log to a “Recent Apps” or “Most used apps” folder that would work much like the “Recent Files”, making the script look for a .desktop file that has a Exec line that matches every one of the listed programs…
P.
- This reply was modified 1 year, 8 months ago by PPC.
August 29, 2021 at 3:54 pm #65997ModeratorBobC
::BAH HUMBUG! on the bloat comments, LOL. Things that save manual effort at the cost of minimal code and system effort are a BLESSING, IMO. That’s why we use computers instead of doing everything by hand!
Moddit, Yes, I have the same problem. What I’ve been doing is putting my IceWM tweaks on the USB flashdrive I use to install. A better way might be to put them with a script to install them on Github or Gitlab. I have learned to LOVE the autohiding menu with kitchen sink toolbar. It is super rare that I run something not on the toolbar. Maybe we could have the menu’s “Run” option log usage as well to catch the usage of appimages so they get automatically added? Or maybe we could find any appimages in the path and add them to the back end of the toolbar so they would be there to click? If you have a better idea, please suggest?
But I think for the concept to be really useful, we should be able to start it with an initial list that includes the most popular included apps which I would call “reserved”, and then over time anything else that person uses gets automatically added to the list. A simple way to mark something as reserved would be to end the prog line with #RESERVED if that will work (not tested), and that would be interpreted as “Leave this line alone and in the same sequence it was”. If the person doesn’t want a reserved item on their toolbar, all they would need to do would be to comment out that line to EXCLUDE it. In other words, to EXCLUDE a particular app, if the line is there you just insert a # in front of it to comment it out, which is what we do now anyway to hide an app. Otherwise, the syntax would be the same as the toolbar and menu lines are now. A GUI maintenance program would be great. Of course if IceWM was no longer the window manager, there are panel/launcher programs like tint2 that already provide maintenance programs. To be honest, I would rather keep IceWM if I could have my cake and eat it too. It seems logical that the toolbar/app-grid-menu generator program could be made able to generate different flavors of menus if other launchers that fit the requirements were found.
Xecure, Thanks for that info. I am able to compile IceWM and have in the past made super-simple changes, but for the most part, can’t even read the code. A super-simple tweak or two is something I might be able to handle. Maybe if the concept worked out to where multiple people liked it, they might be willing to include the tweak. As I see it, I’d need to know the name the menu or toolbar showed, the icon displayed, and the executed string, the same as the toolbar or menu line.
PPC, I looked at trying to monitor running programs, but so many are not ones run from the menu or toolbar, and we wouldn’t know what description to give them or icon to use unless we could identify their desktop entry or the user entered the info by hand. Yes, I see you added a suggestion. I will try it and see what it produces. But how would we build a toolbar line from it?
I should add that anticapitalista has not sanctioned this concept, so it would need to be popular, I would guess, for him to be willing to add it if we got it to work. LOL, see “bloat” comment above š
- This reply was modified 1 year, 8 months ago by BobC.
August 29, 2021 at 4:41 pm #66003Member
oops
::I can see a low tech solution to have a log of currently running apps- run xlsclients (to list all open apps) using cron every 30 or 60 seconds,
… and log the output with a time stamp. You can then process the log to a āRecent Appsā or āMost used appsā folder that would work much like the āRecent Filesā, making the script look for a .desktop file that has a Exec line that matches every one of the listed programsā¦P.
It is a good idea, a learning function can be made for some time (temporary and manually) to populate the Top 5 or 10 mostly used Apps, it’s a good idea on the basis of xlsclients:
xlsclients | awk ‘{$1 = “” ; print $0}’ | cut -c2-
Edit (with flag code and not B-quote is better š
xlsclients | awk '{$1 = "" ; print $0}' | cut -c2-- This reply was modified 1 year, 8 months ago by oops.
August 29, 2021 at 4:57 pm #66004MemberPPC
::@Bobc- I adapted some TIM code to create a file that lists, one per line, the Exec contents and .desktop name…
All you have to do is check each of the app’s being run against this list and get the relevant .desktop to be added to the menu
I consider this something not to be put to common use, because it uses too many system resources to come out of the box in antiX…
In my particular case (using my antiX Transformation pack) I use rofi as an app launcher… It lists last launched (from Rodi itself) apps first- that is partly what you want to do…
P.
Edit- this does not always detect the right .desktop file
I can see this used in a script that can pin to the menu/toolbar any application that is currently being run (a feature that I miss from other operating systems, and that I’ve always thought about adding to my transformation pack)- this does not use system resources, until you launch the script to check currently running apps and search for the relevant .desktop file to be added to the toolbar/menu- not wasting CPU power unless you really need it- that’s not really what you wanted, but it may be a feature worth adding to antiX (a menu entry that looks like “Pin running applications to the toolbar”)
P.
#Loop through all .desktop files in the applications folders and extract Exec and .desktop name and save that to a .txt file cd /usr/share/applications/ find ~+ -type f -name "*.desktop" > ~/.apps-antix-0.txt cd ~/.local/share/applications/ find ~+ -type f -name "*.desktop" >> ~/.apps-antix-0.txt ###NOTE: repeat the last 2 lines, changing the first, the "cd" one, to change to the folder where your .desktop files are sort ~/.apps-antix-0.txt > ~/.apps-antix.txt cd ~ for file in $(cat ~/.apps-antix.txt) do name1=$(grep -o -m 1 '^Exec=.*' $file) name=$(echo $name1|sed 's/.*\=//') echo "$name" -- "$file" done > /tmp/list.txt cat /tmp/list.txt- This reply was modified 1 year, 8 months ago by PPC.
August 29, 2021 at 5:23 pm #66006Anonymous
::Any ideas of possible existing programs that could be used to do the menu, app grid menu, or toolbar parts of this?
BobC, we discussed similar in a prior topic. Search the forum, find the topic containing my reply mentioning potential use of “snoopski”.
snoopski, one of the 3(?) potential “tracking” engines I had previously posted, can (configurable) provide an extensively detailed log.
A solution employing a “frequently used” list gleaned from snoopski log would be desktop -agnostic and, IIRC its config already enables one to specify a list of apps (by pathname? by process name?) to be excluded from the log. {—- This is essential toward eliminating logspam from ill-considered recurring tasks (e.g. “conky iexec re-re-recheck every 10-secs: is persistence enabled?”)Can anyone confirm if this is the function used in icewm to launch all apps from menu/toolbar?
https://github.com/ice-wm/icewm/blob/master/src/yapp.cc#L392As I recall from grepping through the source code months ago when BobC originally inquired, we are not assured that the “toolbarButtonClick event handler” is the sole caller of YApplication::runProgram()… and the runProgram() function does not (as-is) accept “name of caller” as a passed argument. In fact, that exact function (within yapp.cc) might only be called from the “RunProgram:” menu button (or its associated “runner” keybind).
A GUI program to maintain/organize the list would be even better, especially if built in (like on the phone), but maybe not critical.
To do this requires using a menu launcher that can optionally log the entries run, and a toolbar or app grid menu capable of holding many entries.
Itās sad that IceWMās menu is not able to do this.
Change the tune ~~ instead of “sad”, maybe it represents a “a disguised blessing”.
Instead, I would encourage your to pursue a desktop -agnostic usage tracking solution, and use a tab (gtk notebook widget) to display “icewm specific” tracking settings. If no one develops a separate, dedicated, tab for fluxbox, no harm. Without “hacking//patching IceWM”, scripts external to IceWM can still perform adjustments to menu entries and toolbar entries.a learning function
Yes, that’s it!
And in that topic months back BobC asked “does such a thing exist”, and in reply I mentioned (linked?) the strangely-named “frecency” algorithm..
edit:
use a tab (gtk notebook widget) to display āicewm specificā tracking settings
yad, or gtk, or whichever gui toolkit… instead of tab, could sniff the current environment and selectively display controls for settings which are only relevant to the DE/WM which is currently running, eh.August 29, 2021 at 5:34 pm #66007ModeratorBobC
::Oops, it doesn’t look like the syntax is right
$ xlsclients | awk ā{$1 = āā ; print $0}ā | cut -c2- awk: cmd. line:1: ā{ awk: cmd. line:1: ^ invalid char 'ļæ½' in expression Error: no such file "/bin/bash}ā"PPC, Yours worked, and shows promise
$ xlsclients | awk '{print $2}' |sed '/^\//d' firefox-esr geany sol roxterm zzzfmWe would need to log the “week number” along with the program. If we calculated a number for the date and divided by 7 and took the integer of the result it would be good enough.
Weekly, we could count the number of times we see that program running during the week, and accumulate weekly results to a history file.
After the history file is up to date, we could then analyze the results to come up with the exponential average number of occurrences per week.
Then we would then need to match them up to toolbar or menu entries that run those same programs, remove the ones that are excluded or reserved, and then rank the remainder.
We could then generate the revised toolbar list by removing all prog lines except # (which get excluded) and #RESERVED, and then adding the ranked items after them.
August 29, 2021 at 5:38 pm #66009MemberModdIt
::BobC wrote, What Iāve been doing is putting my IceWM tweaks on the USB flashdrive I use to install.
Had to grin because I do that too. The setup I consider of most use for home schooling,
as far as we are able to escape microsoft has around 20 icons in the toolbar. About the only tool I use
from the menu is the controll center as after initial setup it is rarely needed.get a lot of feedback from my daughter who is very well informed about complaints or suggestions from
youthful users. Menu bar saves so many mouse meters a day.- This reply was modified 1 year, 8 months ago by ModdIt.
August 29, 2021 at 5:45 pm #66011Member
oops
::… Yes, it is the problematic double quote and quote (into the antiX forum “” and ”) I do not why
xlsclients | awk '{$1 = "" ; print $0}' | cut -c2-The other command do not work if a space into the name or ///.
- This reply was modified 1 year, 8 months ago by oops.
- This reply was modified 1 year, 8 months ago by oops.
- This reply was modified 1 year, 8 months ago by oops.
August 29, 2021 at 6:09 pm #66017ModeratorBobC
-
AuthorPosts
- You must be logged in to reply to this topic.