| Author |
Message |
johnywhy
Joined: 20 Aug 2011 Posts: 322
|
Posted: Sun 21 Aug 2011, 14:23 Post subject:
How to show MRU Most Recently Used Documents on Start Menu? Subject description: like Winblows |
|
hi
is there a way to display my most recently used files on my Puppy menu?
thanks
|
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11782 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Sun 21 Aug 2011, 15:29 Post subject:
|
|
MRU is Many Regrets Unable
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).
Consult Wikka
Use peppyy's puppysearch
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2192 Location: Gatineau (Qc), Canada
|
Posted: Thu 11 Oct 2012, 07:33 Post subject:
|
|
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: | #!/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.
| Description |
|
| Filesize |
31.56 KB |
| Viewed |
377 Time(s) |

|
_________________
"...l'industrie de l'informatique n'aura besoin que de très peu de temps pour ramener l'humanité aux dessins rupestres." (M. Goebbel, Order of the Command Line; [ma trad.])
|
|
Back to top
|
|
 |
puppyluvr

Joined: 06 Jan 2008 Posts: 3052 Location: Chickasha Oklahoma
|
Posted: Thu 11 Oct 2012, 07:45 Post subject:
|
|
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"
http://puppylinuxstuff.meownplanet.net/puppyluvr/
http://theplpd.webs.com/
Nothing but Puppy since 2.15CE...
|
|
Back to top
|
|
 |
johnywhy
Joined: 20 Aug 2011 Posts: 322
|
Posted: Thu 11 Oct 2012, 08:01 Post subject:
|
|
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.
_________________ asus eeepc 1001PXB
2x Intel(R) Atom(TM) CPU N450 @ 1.66GHz
2064MB RAM, 1024x600 Display
Detailed HardInfo: https://sites.google.com/site/johnywhy/my-asus-pc
|
|
Back to top
|
|
 |
stu91

Joined: 06 Aug 2012 Posts: 100 Location: England. Dpup. Dell Inspiron 1501
|
Posted: Thu 11 Oct 2012, 08:40 Post subject:
|
|
You can with Openbox windows manager yes - via a pipe menu.
This script was posted on crunchbang forum by user johnraff but it works on Puppy ok.
| Description |
remove fake .gz extension and make script executable
|

Download |
| Filename |
recently_opened_menu.gz |
| Filesize |
3.07 KB |
| Downloaded |
172 Time(s) |
|
|
Back to top
|
|
 |
johnywhy
Joined: 20 Aug 2011 Posts: 322
|
Posted: Thu 11 Oct 2012, 08:57 Post subject:
|
|
Thanks.
I guess this is totally dependent on which window manager you're using, right?
_________________ asus eeepc 1001PXB
2x Intel(R) Atom(TM) CPU N450 @ 1.66GHz
2064MB RAM, 1024x600 Display
Detailed HardInfo: https://sites.google.com/site/johnywhy/my-asus-pc
|
|
Back to top
|
|
 |
stu91

Joined: 06 Aug 2012 Posts: 100 Location: England. Dpup. Dell Inspiron 1501
|
Posted: Thu 11 Oct 2012, 09:03 Post subject:
|
|
| 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.
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2192 Location: Gatineau (Qc), Canada
|
Posted: Thu 11 Oct 2012, 10:05 Post subject:
|
|
| 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! (See inside script for remarks.)
| Code: | #!/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!
| Description |
|
| Filesize |
59.47 KB |
| Viewed |
321 Time(s) |

|
_________________
"...l'industrie de l'informatique n'aura besoin que de très peu de temps pour ramener l'humanité aux dessins rupestres." (M. Goebbel, Order of the Command Line; [ma trad.])
Last edited by musher0 on Thu 11 Oct 2012, 11:34; edited 1 time in total
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2192 Location: Gatineau (Qc), Canada
|
Posted: Thu 11 Oct 2012, 10:10 Post subject:
|
|
@stu91. Thanks for the reference.
I might try to adapt that little robot on pekwm.
BFN.
_________________
"...l'industrie de l'informatique n'aura besoin que de très peu de temps pour ramener l'humanité aux dessins rupestres." (M. Goebbel, Order of the Command Line; [ma trad.])
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2192 Location: Gatineau (Qc), Canada
|
Posted: Thu 11 Oct 2012, 10:13 Post subject:
|
|
| 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.
_________________
"...l'industrie de l'informatique n'aura besoin que de très peu de temps pour ramener l'humanité aux dessins rupestres." (M. Goebbel, Order of the Command Line; [ma trad.])
Last edited by musher0 on Thu 11 Oct 2012, 10:17; edited 1 time in total
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2192 Location: Gatineau (Qc), Canada
|
Posted: Thu 11 Oct 2012, 10:14 Post subject:
|
|
Hi.
I'll have a look at it.
BFN.
_________________
"...l'industrie de l'informatique n'aura besoin que de très peu de temps pour ramener l'humanité aux dessins rupestres." (M. Goebbel, Order of the Command Line; [ma trad.])
|
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 2192 Location: Gatineau (Qc), Canada
|
Posted: Sun 04 Nov 2012, 03:37 Post subject:
|
|
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.php?p=662352#662352
| Code: | #!/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="Πρόσφατα Έγγραφα"
# Désactivé car il faudrait aussi traiter les accents en grec (ci-dessous).
it) DOCREC="Documenti recenti";;
pl) DOCREC="Ostatnie dokumenty";;
pt) DOCREC="Documentos recentes";;
ro) DOCREC="Documente recente";;
esac
echo "cmd \"> $DOCREC <\" \"\"" > $AEM/recents
echo "cmd \"~~~~~~~~~~~~~~~\" \"\"" >> $AEM/recents
# Coeur du script d'origine # Merci au groupe openbox (cf ci-dessus).
cat ~/.recently-used.xbel | grep file:/// | tail -n15 | cut -d "\"" -f 2 > $AEM/MRUD.lst
# J'ai enlevé : "| tac" de l'original. # m0
# Adaptation pour lancement avec les types "mime" de rox
# ou le defaultlauncher de Puppy, plutôt qu'avec xdg-open
R="replaceit --input=$AEM/MRUD.lst"
$R "file:///" "/"
$R "/initrd/mnt/dev_save" "/mnt/home"
# Code html
$R "&" "&"
$R "'" "'"
# The following lines to translate UTF-8 XML code to regular accented characters;
# you may comment these lines if you are using only English.
# Traduction du codage XML pour les accents.
$R "%C2%A0" " "
$R "%C2%A1" "¡"
$R "%C2%A2" "¢"
$R "%C2%A3" "£"
$R "%C2%A4" "¤"
$R "%C2%A5" "¥"
$R "%C2%A6" "¦"
$R "%C2%A7" "§"
$R "%C2%A8" "¨"
$R "%C2%A9" "©"
$R "%C2%AA" "ª"
$R "%C2%AB" "«"
$R "%C2%AC" "¬"
$R "%C2%AD" " "
$R "%C2%AE" "®"
$R "%C2%AF" "¯"
$R "%C2%B0" "°"
$R "%C2%B1" "±"
$R "%C2%B2" "²"
$R "%C2%B3" "³"
$R "%C2%B4" "´"
$R "%C2%B5" "µ"
$R "%C2%B6" "¶"
$R "%C2%B7" "·"
$R "%C2%B8" "¸"
$R "%C2%B9" "¹"
$R "%C2%BA" "º"
$R "%C2%BB" "»"
$R "%C2%BC" "¼"
$R "%C2%BD" "½"
$R "%C2%BE" "¾"
$R "%C2%BF" "¿"
$R "%C3%80" "À"
$R "%C3%81" "Á"
$R "%C3%82" "Â"
$R "%C3%83" "Ã"
$R "%C3%84" "Ä"
$R "%C3%85" "Å"
$R "%C3%86" "Æ"
$R "%C3%87" "Ç"
$R "%C3%88" "È"
$R "%C3%89" "É"
$R "%C3%8A" "Ê"
$R "%C3%8B" "Ë"
$R "%C3%8C" "Ì"
$R "%C3%8D" "Í"
$R "%C3%8E" "Î"
$R "%C3%8F" "Ï"
$R "%C3%90" "Ð"
$R "%C3%91" "Ñ"
$R "%C3%92" "Ò"
$R "%C3%93" "Ó"
$R "%C3%94" "Ô"
$R "%C3%95" "Õ"
$R "%C3%96" "Ö"
$R "%C3%97" "×"
$R "%C3%98" "Ø"
$R "%C3%99" "Ù"
$R "%C3%9A" "Ú"
$R "%C3%9B" "Û"
$R "%C3%9C" "Ü"
$R "%C3%9D" "Ý"
$R "%C3%9E" "Þ"
$R "%C3%9F" "ß"
$R "%C3%A0" "à"
$R "%C3%A1" "á"
$R "%C3%A2" "â"
$R "%C3%A3" "ã"
$R "%C3%A4" "ä"
$R "%C3%A5" "å"
$R "%C3%A6" "æ"
$R "%C3%A7" "ç"
$R "%C3%A8" "è"
$R "%C3%A9" "é"
$R "%C3%AA" "ê"
$R "%C3%AB" "ë"
$R "%C3%AC" "ì"
$R "%C3%AD" "í"
$R "%C3%AE" "î"
$R "%C3%AF" "ï"
$R "%C3%B0" "ð"
$R "%C3%B1" "ñ"
$R "%C3%B2" "ò"
$R "%C3%B3" "ó"
$R "%C3%B4" "ô"
$R "%C3%B5" "õ"
$R "%C3%B6" "ö"
$R "%C3%B7" "÷"
$R "%C3%B8" "ø"
$R "%C3%B9" "ù"
$R "%C3%BA" "ú"
$R "%C3%BB" "û"
$R "%C3%BC" "ü"
$R "%C3%BD" "ý"
$R "%C3%BE" "þ"
$R "%C3%BF" "ÿ"
# Liste de conversion ci-dessus tirée de http://jeppesn.dk/utf-8.html
# Exemple de ma hiérarchie de documents | Example of my documents hierarchy
# (Dés)activer si vous n'en avez pas besoin. | (De)activate if you don't need it.
$R "/root/my-documents/clients" "/mnt/home/clients"
$R "/root/my-documents/boulot" "/mnt/home/boulot"
# If you have moved the "my-documents" folder to mnt/home
# Remove the "#" sign. | Enlevez le dièse si vous avez déménagé
# le répertoire "my-documents" dans /mnt/home.
# $R "/root/my-documents" "/mnt/home/my-documents"
# $R "/root/mes-documents" "/mnt/home/mes-documents"
sort -fu --output=$AEM/MRUD.tri $AEM/MRUD.lst
uniq -u $AEM/MRUD.tri > $AEM/MRUD.lst # Fonctionne ! :-)
# Du script d'origine # Merci au groupe openbox (cf ci-dessus).
while read line
do
file=$(echo "$line")
name=$(echo -en "$file" | sed 's,.*/,,' | sed 's/%20/ /g')
# Mettre des adaptations pour divers gest. de fen. ici.
# Adaptation par musher0 pour aemenu et Puppy | Toutou
echo "cmd \"$name\" \"defaulthandler $line\"" >> $AEM/recents
done < $AEM/MRUD.lst
# Pour le débogage
# echo "cmd \"~~~~~~~~~~~~~~~\" \"\"" >> $AEM/recents
# echo "cmd \"Éditer ce menu\" \"leafpad $AEM/recents\"" >> $AEM/recents
# Nettoyage
rm -f $AEM/MRUD.lst
rm -f $AEM/MRUD.tri
# Lancement d'aemenu
$AEM/aemenu -rc $AEM/recents
# set +xv # pour le débogage
## Fin ##
|
 |
| Description |
|

Download |
| Filename |
MRUD-0.1.pet |
| Filesize |
16.85 KB |
| Downloaded |
131 Time(s) |
_________________
"...l'industrie de l'informatique n'aura besoin que de très peu de temps pour ramener l'humanité aux dessins rupestres." (M. Goebbel, Order of the Command Line; [ma trad.])
|
|
Back to top
|
|
 |
|