You are not logged in.
I started working on it in this thread but decided on an almost complete rewrite.
There's a few recent files pipemenu scripts out there, but none that pays full attention to icons afaics.
I found that icons are important - not so much for eyecandy, but because they convey information, make it easier to recognize documents at a glance etc.
In the process of writing this I learned a lot about the freedesktop.org icon theme specification (how exactly applications traverse icon directories and Inherits to find suitable icons) and learned to appreciate it (and by extension most of their interoperability specifications).
The bash script
sorts the list by access time and updates the entry in recently-used.xbel when you open a file with it, i.e. next time you will see that file at the top of the list.
filters out entries that do not exist (anymore) or are unreadable for other reasons.
offers to open the file in question with all the applications listed in recently-used.xbel after checking they are present in PATH, and additionally with a mime-opener like 'xdg-open'.
assigns icons from the current icon theme and its Inherits, as close as possible to how e.g. Thunar does it.
caches icon paths and icons so that subsequent runs are much faster.
uses an absolute minimum of external commands & dependencies.
Icon display can be disabled; that speeds it up of course, but on my machine it loads near-instantly with icons too.
On a 5-year old consumer intel desktop I measured 0.019s for a run without icons, 0.047s for a run with cached icons, and 0.129s for the first run after deleting the icon cache.
Here's its help text:
$> ./recent -h
Openbox pipemenu to create a list of recent files with or without icons.
Usage: ./recent [options]
Options:
-m int maximum number of results to display. Default: 20
-s str Consider icon sizes between min-max. Default: 22-64
-n No icons at all. Default is to use icons.
-f No full path on menu label, only filename
-x str Application to mime-open files. xdg-open has some pitfalls when no DE
is defined, mimeo (xyne.archlinux.ca/projects/mimeo/) might be more
robust. Default: xdg-open
-r str Recentfile to parse. Default: ~/.local/share/recently-used.xbel
-i str Full path to mimetype icon directory to store symlinks to exisiting
icons. Default: ~/.config/openbox/mimetype_icons
-g str GTK rc/ini file to extract icon theme from.
Default: ~/.config/gtk-3.0/settings.ini
-c Clear the recentfile (access from pipemenu).
-d Output debug info to stderr
-O str str Attempt to find an icon for the supplied mimetype and category,
then exit.
Dependencies:
xmlstarlet: parsing recentfile
Optional:
gio (glib2, libglib2.0-bin): get icons
Question: Is jgmenu capable of swallowing pipemenus? Is it capable of icon lookups (beyond XDG menu)?
I'm just wondering if this is even useful for normal Bunsen users, or if I'm re-inventing the wheel...
Anyhow, it was fun to code.
If you use transmission-daemon for downloading torrents, this might be interesting for you.
More pipemenus will be added to the repository...
Last edited by ohnonot (2021-07-04 09:21:54)
Offline
This is pretty sharp. Lots of options to choose from.
I see you fixed the 'gnome-colors' problem by using ~/.config/gtk-3.0/settings.ini to grab the current icon theme? (with options for other locations from the menu! Ha!)
Super fast. Can't really tell any delay here at all.
The "clear icon cache" buttons makes switching icon themes a breeze.
The "-h "help" menu is a nice touch.
Showing the number of files opened is a neat feature.
I originally had four "unreadable" files before I deleted the caches, but don't really know what they were. Does this simply mean that no program was found to open?
Well done.
Offline
Thanks onn! I'll definitely try this out.
Question: Is jgmenu capable of swallowing pipemenus?
Of course @malm is the canonical source of information on jgmenu, but as a user I can report that jgmenu has both native pipemenus (a script that produces a csv menu) and displays OpenBox XML pipemenus too, via a library.
The native pipemenus should be faster, and are also easier to write (esp if you use the functions in /usr/lib/bunsen/common/bl-includes) but OB pipemenus are perfectly usable and BunsenLabs still ships some (eg the "Places" menu).
Is it capable of icon lookups (beyond XDG menu)?
Sorry, I've no idea about how jgmenu handles icons. I certainly appreciate the point about extra visual info for the user, but BL menus display no icons by default - like CrunchBang. (We should think about how to make it easy to enable them for users who don't mind the extra system/visual load.)
I'm just wondering if this is even useful for normal Bunsen users, or if I'm re-inventing the wheel...
An OB pipemenu like this is perfectly usable for BL users with jgmenu. We do though, already have a recent files pipemenu (written in lua) which might well be tweakable to add the improvements in your script, possibly without icons though.
---
I might try some day to rewrite part of your script as a native jgmenu pipemenu, unless you'd like to do it yourself? It shouldn't be too hard as the syntax is simpler, if anything, than XML.
it was fun to code
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Thanks for your kind comments.
johnraff, feel free to rewrite it all you wish, it's GPL anyhow.
I have also worked on the other pipemenu in that repo, to whom it may concern.
Offline
The current script for recent files as in Lithium does not show the icons for the items in that menu.
Real Men Use Linux
Offline
^No, none of the current BL menus have icons. That tradition goes back to CrunchBang, and many users prefer the "cleaner" look of a text-only menu. But it's true that icons add a visual clue for users to quickly find the item they're looking for.
jgmenu itself (and openbox), though, does support icons, and it's not hard to make the BL main menu display them.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
In the process of writing this I learned a lot about the freedesktop.org icon theme specification and learned to appreciate it (and by extension most of their interoperability specifications).
Thanks for the useful link! I always seem to be searching for XD -thisorthat and have to do a lot of clicking to get to the True Word. This has it all on one page,
In particular, a link from there to the current standards for that recently-used.xbel file: https://www.freedesktop.org/wiki/Specif … mark-spec/
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
^ ah, thanks. I will have to look at that evtl. - right now I think I'm taking a break from this project.
The current script for recent files as in Lithium does not show the icons for the items in that menu.
And including icons was the hardest part in mine!
Offline
^ ah, thanks. I will have to look at that evtl. - right now I think I'm taking a break from this project.
DeepDayze wrote:The current script for recent files as in Lithium does not show the icons for the items in that menu.
And including icons was the hardest part in mine!
No doubt and I bet the coding for that is not that trivial.
Real Men Use Linux
Offline
@ohnonot you've taken down the link to the actual code!
Was there some problem with it?
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline