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

Booting, installing, newbie
Post Reply
Message
Author
User avatar
johnywhy
Posts: 879
Joined: Sat 20 Aug 2011, 14:52

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

#1 Post by johnywhy »

hi

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

thanks

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#2 Post 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.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#3 Post 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.
Attachments
MRU_list_for_Puppy.jpg
(31.56 KiB) Downloaded 1438 times
Last edited by musher0 on Fri 23 Sep 2016, 12:46, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#4 Post 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)
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...

User avatar
johnywhy
Posts: 879
Joined: Sat 20 Aug 2011, 14:52

#5 Post 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.
[b]Now[/b]: X-Tahr 2.0! StretchDog! DevuanDog!
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]

User avatar
stu91
Posts: 145
Joined: Mon 06 Aug 2012, 15:11
Location: England. Dpup. Dell Inspiron 1501

#6 Post 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.
Attachments
recently_opened_menu.gz
remove fake .gz extension and make script executable
(3.07 KiB) Downloaded 976 times

User avatar
johnywhy
Posts: 879
Joined: Sat 20 Aug 2011, 14:52

#7 Post by johnywhy »

Thanks.

I guess this is totally dependent on which window manager you're using, right?
[b]Now[/b]: X-Tahr 2.0! StretchDog! DevuanDog!
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]

User avatar
stu91
Posts: 145
Joined: Mon 06 Aug 2012, 15:11
Location: England. Dpup. Dell Inspiron 1501

#8 Post 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.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post 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!
Attachments
MRUD_list_for_Puppy.jpg
(59.47 KiB) Downloaded 1309 times
Last edited by musher0 on Thu 11 Oct 2012, 15:34, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#10 Post by musher0 »

@stu91. Thanks for the reference.
I might try to adapt that little robot on pekwm.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#11 Post 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.
Last edited by musher0 on Thu 11 Oct 2012, 14:17, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#12 Post 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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#13 Post 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="Π
Attachments
MRUD-0.1.pet
(16.85 KiB) Downloaded 879 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#14 Post 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
Attachments
MRUD-0.3.pet
(17.04 KiB) Downloaded 528 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#15 Post by musher0 »

Hello, all.

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

Enjoy!

musher0
Attachments
MRUD-lst.sh.zip
Latest version of the script.
(2.24 KiB) Downloaded 371 times
MRUD-0.3+date.jpg
(18.12 KiB) Downloaded 667 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#16 Post 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:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#17 Post 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
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#18 Post 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:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#19 Post 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
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#20 Post 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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply