Page 1 of 10

How to show MRU Most Recently Used Documents on Start Menu?

Posted: Sun 21 Aug 2011, 18:23
by johnywhy
hi

is there a way to display my most recently used files on my Puppy menu?

thanks

Posted: Sun 21 Aug 2011, 19:29
by Béèm
MRU is Many Regrets Unable :wink:
Blow it all away.

It has been addressed before and I never saw a solution.
Altho theoretically something can be developed for this.
A tip: there is a .recently-used.xbel file in /root.
Most programs have that function in the file menu and I think they use that file.

Posted: Thu 11 Oct 2012, 11:33
by musher0
Edit, 2016-09-23, 8:43 EDT:
To anyone interested in a MRUF/MRUD script and new to this thread:
------ it is now at version 0.9.5.4 and can be found here. ------
~~~~~~~~~~~~~~~

Hello.

Béèm answered johnwhy's question with his usual philosophical wisdom :) .

So here's my attempt, in view that Puppy does not seem to have a MRU utility per se.

(béèm, if you're reading this from where you are, the info provided by ~/.recently-used was really too skimpy for me.)

Code: Select all

#!/bin/sh
# /$MBINS/lstMRU.sh
# Save this script in /root/my-applications/bin
# par musher0, 11 oct. 2012
####

MBINS=~/my-applications/bin
# Modèle : `ls -u1F | grep "*" | head -n 5 | uniq -ui | sort`

rm -f ~/my-applications/bin/MRUprog.lst

cd /usr/local/bin
ls -u1F | grep "*" | head -n 5 | uniq -ui | sort > $MBINS/14+

cd /usr/bin
ls -u1F | grep "*" | head -n 5 | uniq -ui | sort >> $MBINS/14+

cd /usr/share/applications
ls -u1F | grep "*" | head -n 5 | uniq -i | sort >> $MBINS/14+ 

cd /usr/local/share/applications
ls -u1F | grep "*" | head -n 5 | uniq -i | sort >> $MBINS/14+ 

cd ~
cat ~/.bash_history | tail -n 5 | uniq -i | sort >> $MBINS/14+ 

cd $MBINS
ls -u1F | grep "*" | head -n 5 | uniq -i | sort >> $MBINS/14+

# replaceit --input=14+ "*" ""
# enable the above if you have the replaceit utility

uniq -ui 14+ | sort > MRUprog.lst
rm -f 14+-
urxvt +sb -g 41x27+300+150 -e less -N -~ -M MRUprog.lst
The script above simply lists the five appplications you used last in each of six Puppy directories where executables are commonly stored. Theoretically that's 30 programs, but the uniq program removes the double entries, so you may have a listing of less than 30 programs.

The result is sort of a fuzzy-logic reminder to back-track on what you've done on your computer in the past couple of days.

Useful for people with short memories (e.g. moi), and perhaps for menu or rxvt listings.

Improvements to my code are welcome.

The unavoidable screenshot is attached.

Enjoy.

Posted: Thu 11 Oct 2012, 11:45
by puppyluvr
:D Hello,
User Warmock is working on Navig8or here:
http://www.murga-linux.com/puppy/viewtopic.php?t=66008
If one could graphically integrate something like musher0`s above script into it,
you would have a menu that was very windoze like.. (eww LOL)

Posted: Thu 11 Oct 2012, 12:01
by johnywhy
This is very cool, really great!

tho in my OP i was actually looking for most recently opened files, not programs. Yes I know programs are files, but I mean files which are not programs.

Posted: Thu 11 Oct 2012, 12:40
by stu91
You can with Openbox windows manager yes - via a pipe menu.

Image

This script was posted on crunchbang forum by user johnraff but it works on Puppy ok.

Posted: Thu 11 Oct 2012, 12:57
by johnywhy
Thanks.

I guess this is totally dependent on which window manager you're using, right?

Posted: Thu 11 Oct 2012, 13:03
by stu91
johnywhy wrote:Thanks.

I guess this is totally dependent on which window manager you're using, right?
Yes the above posted script is only for Openbox windows manager.

Posted: Thu 11 Oct 2012, 14:05
by musher0
johnywhy wrote:This is very cool, really great!

tho in my OP i was actually looking for most recently opened files, not programs. Yes I know programs are files, but I mean files which are not programs.
Your wish is my command! :lol: (See inside script for remarks.)

Code: Select all

#!/bin/sh
# /$MBINS/lstMRUD.sh
# Save in ~/my-applications/bin
# "Should" :-) list the 30 last docs or non-program files you 
# used or perused in the ~/my-documents folder.
# musher0, 11 oct. 2012
####
# variable
MDOCS=~/my-documents

# script
cd $MDOCS

rm -f $MDOCS/MRUD.lst # remove previous list

ls -Bt1 * | head -n 15 | sort > ~/30+
# list alphabetically 15 last files you used last in ~/my-documents proper

ls -Bt1 */* | head -n 15 | sort >> ~/30+ 
# list alphabetically the 15 files you used last in ~my-documents/< various subdirs that may be there >

# clean up a bit
uniq -ui  ~/30+ | sort > MRUD.lst # remove any double entries
rm -f  ~/30+ # remove the work file

# display the new MRUD list
urxvt +sb -g 45x32+300+150 -e less -M -N -~ MRUD.lst

### 30 ###
Erratum: the ls command above has been corrected to "ls -Bt1" ( was "ls -Bu1"). This makes the time be calculated from today. Sorry about that; please reload this corrected version.

You're partially on your own if your documents are not in ~/my-documents. Meaning: you'd have to change the MDOCS variable to point to a different documents folder.

Enjoy!

Posted: Thu 11 Oct 2012, 14:10
by musher0
@stu91. Thanks for the reference.
I might try to adapt that little robot on pekwm.

BFN.

Posted: Thu 11 Oct 2012, 14:13
by musher0
johnywhy wrote:Thanks.

I guess this is totally dependent on which window manager you're using, right?
Well, some wm's don't have the capacity at all, which is why I wrote these little scripts that can be used from the command line.

PS. Not just wm's. Some panels, such as lxpanel, have it too.

BFN.

Posted: Thu 11 Oct 2012, 14:14
by musher0
puppyluvr wrote::D Hello,
User Warmock is working on Navig8or here:
http://www.murga-linux.com/puppy/viewtopic.php?t=66008
If one could graphically integrate something like musher0`s above script into it,
you would have a menu that was very windoze like.. (eww LOL)
Hi.

I'll have a look at it.

BFN.

Posted: Sun 04 Nov 2012, 07:37
by musher0
Hi, people.

Here is a cleaner and more limited MRUD script, inspired by a pipemenu for openbox. Thanks to stu91 for the tip. It's more limited in the sense that it detects only documents, not scripts or programs.

This one uses BK's defaultlauncher, rather than xdg-open or the ROX mime-types, to relaunch the documents. I added a couple of filetypes to the launcher, so that odt and gnumeric files are recognized.

It contains an attempt at internationalization and some UTF-8 conversions.

It has its own *.desktop file, so a menu entry should appear under "Documents" in any wm, even if this initial release is based on aemenu.

Created on lupu 5.25 retro. I'm sort of counting on you people to tell me on which other puppies it works.

It is a 0.1 version, in other words, "beta". Any constructive comment or improvement suggestion is welcome.

Screen capture is here: http://murga-linux.com/puppy/viewtopic. ... 352#662352

Code: Select all

#!/bin/sh
# Titre et emplacement : /root/my-applications/ae/MRUD-lst.sh
# Dérivé de http://openbox.org/wiki/Openbox:Pipemenus:recentfilesxbel
# Merci au groupe openbox et à stu91 pour le tuyau.
# Adapté par musher0 pour aemenu, fin oct. - début nov. 2012
# Dépendances : aemenu, replaceit, /root/.recently-used.xbel (actif)
####
# set -xv # pour le débogage

# Préparation pour aemenu
export AEM="/root/my-applications/ae"
[ ! -d /root/my-applications/ae ] && mkdir $AEM

# Langues (pour le titre)
case ${LANG%_*} in
	 ca) DOCREC="Documents recents";;
	 en) DOCREC="Recent Documents";;
	 es) DOCREC="Documentos recientes";;
	 fi) DOCREC="Viimeisimmät tiedostot";;
	 fr) DOCREC="Documents récents";;
#	 gr) DOCREC="Π

Posted: Sun 17 Nov 2013, 07:01
by musher0
Hello.

Please find attached v. 03. Basically, the changes concern line 14:

Code: Select all

[ ! -f /root/.recently-used.xbel ] && ln -s /root/.local/share/recently-used.xbel /root/.recently-used.xbel
Since, in newer Puppies, the recently-used.xbel file is in folder
/root/.local/share, a link was needed.

Enjoy!

musher0

Posted: Sun 25 May 2014, 02:08
by musher0
Hello, all.

Please find attached my most recent take on this.
Like the versions above, it requires aemenu.

Enjoy!

musher0

Posted: Mon 26 May 2014, 08:42
by Puppus Dogfellow
musher0 wrote:Hello, all.

Please find attached my most recent take on this.
Like the versions above, it requires aemenu.

Enjoy!

musher0
working pretty well in precise 5.5 and reasonably well in 5.7.1. thanks (again) for this, musher0. (i edited my original because sometimes it just ignores me).
:lol:

Posted: Tue 27 May 2014, 11:32
by musher0
Hi, Puppus_D.

When you have a minute, would you care to expand on the difference(s) between "pretty
well" and "reasonably well"? :) I'm a bit confused, here... :)

Thanks in advance.

musher0

Posted: Tue 27 May 2014, 22:41
by Puppus Dogfellow
musher0 wrote:Hi, Puppus_D.

When you have a minute, would you care to expand on the difference(s) between "pretty
well" and "reasonably well"? :) I'm a bit confused, here... :)

Thanks in advance.

musher0
sure, musher.

as you know, edits don't register on this forum unless a subsequent post has been made. the progression went like this:

working very well in 5.5 and 5.7.

i kept hammering at it, just because i thought it was cool. a little bit of non response from the 571 machine changed it to pretty well/very well or something similar.

after a while, i noticed that the 5.5 machine also took to ignoring me at times. it still seemed cool to me and i reasoned it was better to have than not have so...

pretty well/reasonably well.

there was no statistical analysis done to see which was performing better or more consistently, either with regards to an accurate list or the snapping to the item selected from it, nor was there an attempt to impart a quantifiable/qualitative difference with the terms. it was just the easiest way to edit it at the time.

at the very least, the script answers important questions like "what the hell was i just doing?" and "where was that freaking thing?"

sometimes i leave machines alone for days at a time...and sometimes the information is handy just seconds after i close a document, so... it's not empty praise. it's a pretty cool thing you've done here. i'm reasonably happy with it.


hope that helped. :lol:

ps: i realize that my chuckling over this is no real indication that it's actually funny.

:lol:

Posted: Wed 28 May 2014, 01:59
by musher0
Thanks for the clarification! 8)

As to your last sentence, I'd comment that laughter is a natural anti-depressant.
So I guess you have to chuckle twice to get the benefits of one hearty laugh.
(NOT! Just kidding!) :lol:

BFN.

musher0

Posted: Wed 28 May 2014, 02:25
by musher0
BTW, I never had to wait for another post to be written to validate edits. Strange...
Perhaps your return key is sticky, or something?

May I suggest that you ask Flash about this? He knows the regular behavior of the forum
software through and through, and he will certainly be able to confirm or rectify your impressions.

BFN.