Hi, Ibidem.
Ibidem wrote:
>
But I'd like to ask you one question: when was the last time you needed
!<command> in less? I could see the reason if it were vi you were
talking about, but have never desired that in a pager.
Oh! I find quite handy. I use it a lot. It saves me the trouble of going
back to the menu or to a desktop icon to launch urxvt, for example, or
a script, or any other program. I now use it even to see what drives
are mounted and for access to them (see attached pic).
What I find particularly interesting in the full less is that it can act a real
reader (its main purpose). Through proper setting of its variables, it can
launch an editor (say, geany, or joe) if you need to edit anything.
I have made it my "defaulttextviewer"; it's much faster than the current
practice in Puppy, of using leafpad or nicoedit as the viewer. Also, since
you can't edit anything in less, while reading the text, you can't introduce
accidental errors if you press a wrong key.
Other uses:
You can team it up with cal to see a month or a year (see pic 2, and
code below)
Use less instead of gtk-dialog or yaf-splash; if you use the transparent
effect (-tr, -tint, and/or -sh parameters) in urxvt, it makes for a more
visually interesting message.
Highlight important words in a text you're sending to friends, members
or subscribers.
Etc., etc.
Thanks for reading this. BFN.
musher0
~~~~~~~~~~~~~~
Example: Script to view previous, current, or next year in less.
Code: Select all
#!/bin/ash
# $BINS/annee.sh
#
# annee, sans paramètre ou avec le paramètre 0, donne
# le calendrier de l'annee courante;
# annee +, celui de l'année suivante;
# annee -, celui de l'année précédente.
#
#(c) musher0, June 5, 2013.
####
a="`date +\"%Y\"`"
case $@ in
+) an="`expr $a + 1`" ;;
-) an="`expr $a - 1`" ;;
0|*) an=$a ;;
esac
cal -s $an > /tmp/$an
AN="`head -n 1 /tmp/$an`"
GM="g 66x36+280+280"
urxvt -fn "xft:Proc2:pixelsize=12:autohint=true" +sb -$GM -tr -e less -L -j 36 -~ -P "$AN" /tmp/$an
rm /tmp/$an
Console usage (translated):
annee.sh 0 -> calendar of current year
annee.sh + -> ... of next year
annee.sh - -> ... of previous year
You can integrate the above directly in a pekwm, icewm or aewm
menu. Or you can create *.desktop files for the three possibilities for
other wm's. Or link to an icon on your desktop.
Note. The proportional Proc2 font is used here on purpose to create
the "wider" effect. Usually, for ease of reading, you'd use a "mono"
font (e.g., Monaco or Liberation Mono) with urxvt/less.