The time now is Mon 23 Apr 2018, 23:33
All times are UTC - 4 |
Page 1 of 4 [56 Posts] |
Goto page: 1, 2, 3, 4 Next |
Author |
Message |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Fri 13 Jan 2012, 04:20 Post subject:
less, Powerful Not-So-CLI (:-) Text Viewer and Launcher Subject description: Can use piping and be called from right-click on any pdf or txt file |
|
Edit, 19 Nov. 2015. Version 481 compiled for Puppy, here.
~~~~~~~~~~~~~~~~~
Edit, Dec. 17, 2014. Less, version 470, has been attached to message
http://murga-linux.com/puppy/viewtopic.php?p=815558&sort=lastpost#815558.
The new "read pdf as txt" script is in the message just above it. Enjoy!
~~~~~~~~~~~~~~~~~
Edit, Dec. 20, 2013. For latest compile of less version 458, please go to:
http://murga-linux.com/puppy/viewtopic.php?p=745241&sort=lastpost#745241
(I've deleted the version 451 that was attached to this initial post.)
Thanks.
~~~~~~~~~~~~~~~~~
Update, April 25, 2013: less-458 is out. See message at bottom of page.
Hello, all!
Here is less 4.51, dated July 2012, compiled from source. This pet includes lesspipe and numerous right-click accesses. More compact size than v. 4-44 obtained by stripping and upx'ing of executable. This one also replaces outright the "defaulttextviewer" file.
From the less viewer, if you need to edit a file, press "V" and the file will load in your text editor. You will be brought back to the less viewer upon closing your editor.
Enjoy!
/////////////////
Rationale:
The less included by default in Puppy is the cut-down version integrated in busybox. It does the job, barely. If you need more sophisticated viewing capacity, then you need this full version of less.
For example I've replaced Puppy's defaulttextviewer with less-4.51, with no regrets. It loads the text extremely fast, it allows you to view text -- or binary material, which leafpad, nicodedit or even geany do not load at all.
This pet also comprises (minimal) docs created by the compilation. Look for "less.hlp" under /usr/local/share/doc and view it with... less ??
(You can also view the help file of less while reading any other text, simply by typing "h". After you've consulted less's help, type "q" to return to reading your initial text.)
The default text viewer has been replaced with this script:
Code: | #!/bin/sh
# /usr/local/bin/defaulttextviewer
####
urxvt -fn "xft:Aerial Mono:pixelsize=13" -fg "#D8FDDB" -bg "#786849" -sr +st +tcw -bc -T "Aperçu de \"$@\"" -n "Aperçu de \"$@\"" -tr -tint black -sh 57 -bd firebrick4 -g 84x25+320+24 -cr white -b 4 -e less-444 -B -J -m -N -~ "$1"
# exec nicoedit "$@"
# or perhaps
# exec leafpad "$@"
|
The above uses the transparent and xft font features of urxvt to make viewing under less "softer on the eyes". It also displays the name of the file being viewed in the title bar.
As an aside, I've got the docs in a series of 8 jpg panels for easy consultation. If there's a request, I'll make them available here also.
Have a great day!
P.S. A screenshot is included.
Description |
|
Filesize |
20.25 KB |
Viewed |
1386 Time(s) |

|
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Last edited by musher0 on Thu 19 Nov 2015, 04:45; edited 10 times in total
|
Back to top
|
|
 |
GustavoYz

Joined: 07 Jul 2010 Posts: 894 Location: .ar
|
Posted: Wed 18 Jan 2012, 02:15 Post subject:
|
|
Thanks, it works like a charm.
I've to tweak some things in order to make puppy less (busybox one) work with man pages, but this full less has no issues.
Thanks again.
EDIT: I've replaced the original less symlink for an equal symlink pointing to less-444, no regrets.
_________________

|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Thu 19 Jan 2012, 03:20 Post subject:
|
|
Hi, Gustavo.
My pleasure!
BFN.
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Thu 19 Jan 2012, 03:37 Post subject:
|
|
Confused by the less commands?
Here's a little script that will launch the less help at the same time as the document you want to view with less.
You can link this script as a context command in ~/.config/rox-sourceforge.net/SendTo/text_plain, for example, or any other of the directories there with text_something.
The help text will appear black on white, and the consulted text as white on black. No fancy transparency.
Enjoy!
Code: |
#!/bin/ash
# /~/my-applications/bin/less-avec-aide.sh
####
urxvt -sr -g 82x24+40+40 -e less-444 --help &
urxvt -rv -sr -g 110x28 -e less-444 -B -J -m -N -~ "$@" &
|
Here is a screenshot.
Description |
|
Filesize |
63.89 KB |
Viewed |
1223 Time(s) |

|
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Fri 31 Aug 2012, 05:10 Post subject:
|
|
Hello, all.
A new version of less is available. Please see first post for download.
Enjoy!
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
GustavoYz

Joined: 07 Jul 2010 Posts: 894 Location: .ar
|
Posted: Mon 03 Sep 2012, 14:21 Post subject:
|
|
@musher0: Thanks, check this out:
http://www.greenwoodsoftware.com/less/faq.html#tricks
_________________

|
Back to top
|
|
 |
GustavoYz

Joined: 07 Jul 2010 Posts: 894 Location: .ar
|
Posted: Tue 13 Nov 2012, 15:13 Post subject:
|
|
You can set options into a system variable called `$LESS`, so the next time is executed, less will use those (useful when "piping").
For example, to see a script with sintax highlights, I often use pygmentize + less on this way (I use a custom bash function with this in reality):
Code: | pygmentize -l perl regex.pl | less |
But, if $LESS has no '-R', it won't show colors.
The workaround is easy: add on the .bashrc somthing like this:
This way you won't loose any previous options set and add support for colors on situations like above.
My $LESS variable (bashrc adds '-r -Qai'):
Also, less alloud you to have color on man pages (some puppies have `man`).
Check this: http://pastebin.com/SbaR33Pt
_________________

|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Tue 13 Nov 2012, 16:31 Post subject:
|
|
Thanks for those tips, Gustavo!
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Thu 25 Apr 2013, 21:21 Post subject:
|
|
less-458 is just out.
Enjoy!
musher0
PS. Almost forgot:
* if this is your first install of less, you can ignore this note.
* if you already have less installed, remove all previous "less"-related files (such as lesskey, lessopen) with pfind before you install this version. The executables of this version are entirely in /usr/bin, and we don't want interference from earlier versions, right ?
In particular remove any previous versions you may have in /usr/local/bin or /root/my-applications/bin.
Also, it's not fresh to my mind, but I believe BK has a "less" linked to busybox in /bin in some Puppies. Never remove BK stuff from a Puppy; simply rename it to "less-NO", or something like that. The new 458 full version will then have full precedence, and there will be no confusion in the system.
Thanks.
Description |
Known to work on wheezypup 3.5.2.5
|

Download |
Filename |
less-458.pet |
Filesize |
121.31 KB |
Downloaded |
641 Time(s) |
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Last edited by musher0 on Fri 26 Apr 2013, 11:02; edited 1 time in total
|
Back to top
|
|
 |
tallboy

Joined: 21 Sep 2010 Posts: 907 Location: Oslo, Norway
|
Posted: Fri 26 Apr 2013, 01:51 Post subject:
|
|
Hi musher0
I downloaded less_458 to my LupuPlus_5.2.8. As you mentioned, the existing /usr/bin/less was a link to busybox.
Less only flashed on the screen for a fraction of a second when I tried it.
Code: | # less my-documents/growisofs.txt
less: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory |
tallboy
_________________ True freedom is a live Puppy on a multisession CD/DVD.
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Fri 26 Apr 2013, 10:16 Post subject:
|
|
Hi, tallboy.
Ah ? I compiled this version in wheezy 3.5.2.5. Strange...
But it's normal, in a way, because less needs "food", it does indeed sort of flash and close if it does not have any text to show.
Re-reading your message, I see that you did give it "food". Ok, I'll do another compile on lupu 5.28 specifically.
musher0
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Fri 26 Apr 2013, 10:17 Post subject:
|
|
To test "less" :
Does the following show in a console window or just flashes?
Code: | echo beebabelooba > /tmp/bebop.txt;urxvt -e less -~ /tmp/bebop.txt
# Or any other *.txt file, of course. Or
#
# urxvt -e less --help
# if this last one, type G to go to the end of the help file, and
# small-case g to come back to top, to see if it reacts properly.
|
If the text shows, it works, obviously.
musher0
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Last edited by musher0 on Fri 26 Apr 2013, 10:54; edited 1 time in total
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Fri 26 Apr 2013, 10:52 Post subject:
|
|
@tallboy and others who might be experiencing library problems with the wheezypup build of less above:
please try this one, compiled on Small Business Pup (SBP) by e_mattis, a derivative of lupu 5.28.
Tests were ok on my lupu. Reports appreciated if not on your machine.
The less-458 version and the libtinfo.so.5.7 library are presented separately. You'll need both for less-458 to work on lupu 5.28.
Enjoy.
musher0
Note. The attached libtinfo library pet was extracted from this package: http://pkgs.org/centos-6-rhel-6/centos-rhel-i386/ncurses-libs-5.7-3.20090208.el6.i686.rpm/download/.
Description |
less-458 for lupu 5.28; you'll also need the libtinfo library, below.
|

Download |
Filename |
less-458lupu2.pet |
Filesize |
121.59 KB |
Downloaded |
564 Time(s) |
Description |
partial ncurses library needed by less on lupu 5.28 Puppies.
|

Download |
Filename |
libtinfo.so-5.7.pet |
Filesize |
45.13 KB |
Downloaded |
614 Time(s) |
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Last edited by musher0 on Sat 27 Apr 2013, 00:10; edited 1 time in total
|
Back to top
|
|
 |
tallboy

Joined: 21 Sep 2010 Posts: 907 Location: Oslo, Norway
|
Posted: Fri 26 Apr 2013, 21:15 Post subject:
|
|
Hi musher0.
The /root/my-applications/bin/ directory containing 4 scripts in the original less_458.pet package, is not present in the less_458lupu version.
Will there be any problems if I just copy the scripts into /my-applications/bin? Any hardcoding with references?
tallboy
_________________ True freedom is a live Puppy on a multisession CD/DVD.
|
Back to top
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12088 Location: Gatineau (Qc), Canada
|
Posted: Sat 27 Apr 2013, 00:09 Post subject:
|
|
tallboy wrote: | Hi musher0.
The /root/my-applications/bin/ directory containing 4 scripts in the original less_458.pet package, is not present in the less_458lupu version.
Will there be any problems if I just copy the scripts into /my-applications/bin? Any hardcoding with references?
tallboy |
Hi, tallboy.
Chucks...
Thanks for telling me.
No, no problem at all with your suggestion. Just with my focus...
So I redid the pet for lupu. See above.
BFN.
musher0
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
|
Page 1 of 4 [56 Posts] |
Goto page: 1, 2, 3, 4 Next |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|