Building MMview, a universal file viewer
MochiMoppel:
I just noticed,that I was too much in a hurry when I wrote and posted the code above.
See the Edit.
---
I have done some testing on vanilla Tahr and Slacko539 - both on 2 "puppy-machines" i.e. 500MB and 1 GB.
The result was as described previously.
I have no solutions -
except some user-rules based on my experience -
1) dont sort
2) dont go into /proc - basically we have no business there
3) avoid using the keyboard-arrows in dirs with big-files.
BIG-files will load slowly and if big enough crash the gui.
That goes for Geany too - so its mostly a matter of getting
accustomed to having a quickview,when travelling a filelist.
NORTON Commander -Remember that?
'------
I think your script is much more than the gui.
The integration/hookup with rox gives a lot of power/choice.
Nice project.
I just noticed,that I was too much in a hurry when I wrote and posted the code above.
See the Edit.
---
I have done some testing on vanilla Tahr and Slacko539 - both on 2 "puppy-machines" i.e. 500MB and 1 GB.
The result was as described previously.
I have no solutions -
except some user-rules based on my experience -
1) dont sort
2) dont go into /proc - basically we have no business there
3) avoid using the keyboard-arrows in dirs with big-files.
BIG-files will load slowly and if big enough crash the gui.
That goes for Geany too - so its mostly a matter of getting
accustomed to having a quickview,when travelling a filelist.
NORTON Commander -Remember that?
'------
I think your script is much more than the gui.
The integration/hookup with rox gives a lot of power/choice.
Nice project.
Use head to load only x lines of text files for preview?some1 wrote: 3) avoid using the keyboard-arrows in dirs with big-files.
BIG-files will load slowly and if big enough crash the gui.
Like, top 100?
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]
Nice initiative....
Doubling clicking an item with spaces in the file name gives errors.....
Replacing rox by defaultfilemanager (2 places) cures this problem (on LxPupSc-17.02.1 with pcmanfm)
Cheers!
peebee
Doubling clicking an item with spaces in the file name gives errors.....
Replacing rox by defaultfilemanager (2 places) cures this problem (on LxPupSc-17.02.1 with pcmanfm)
Cheers!
peebee
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
No, this is perfect! Thank you! Here is what I will use for the next update:dejan555 wrote:But then it wouldn't show the center of image by default but top-left corner and you would need to scroll for the rest
Code: Select all
<hbox scrollable="true" space-expand="true">
<pixmap>
...
</pixmap>
</hbox>
I tested your proposal and it worked. I only had to add a missing refresh:vPMAP2 and I deleted the width-request="'$PR_X'" height-request="'$PR_Y'" stuff because it causes the pixmap to "spill out" of its frame (you will understand what I mean when you resize the window).
The idea certainly is clever and probably the best tweak possible considering the limits of the pixmap widget, but weighing all pros and cons I find too many cons. My biggest objection is that the scaling is not dynamic (e.g as in Viewnior) and that it has not clue how big or small the viewer pane really is, so the code may scale down an image even when the viewer pane could easily accommodate the original size. Nevertheless other members might reach different conclusions. I attach a very barebone test script which will show your tweak in action. Maybe this could also serve as the barebone template you proposed.
clicking on them is not any better3) avoid using the keyboard-arrows in dirs with big-files.
What you really should avoid is using the LEFT and RIGHT arrow keys. They let you switch between the leftmost Places pane and the main files list... if you are lucky.
Make a test:
- 1) in QuickView go to /usr/local (just as an example) and press the close button
2) Restart QuickView. You should now be in /usr/local again.
3) Press the LEFT key
The Search box opens. This makes it not only impossible to switch back to the file list, it's even worse: the list is gone. The user might not remember were he came from.
4) Now click on left "File system" and go to /usr/local. Try LEFT key again. It will take you to "File system" in Places pane, not the Search box. That's the way it should be.
*Which* errors? Spaces in file names shouldn't be a problem, but if you don't use rox then of course the script may not work properly.Peebee wrote:Doubling clicking an item with spaces in the file name gives errors.....
- Attachments
-
- mm_quickview_imagescaling_test.gz
- Remove fake gz extension
THIS IS A STRIPPED DOWN VERSION FOR THE SOLE PURPOSE TO TEST
IMAGE RELATED CODE. NO FURTHER UPDATES, NO BUG FIXES. - (4.52 KiB) Downloaded 377 times
Last edited by MochiMoppel on Fri 10 Feb 2017, 00:19, edited 1 time in total.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
bothers me too..smokey01 wrote:Each time a file is touched the filename is bolded
Well, only the "access" and "change" timestamps are changed, not the important "modified" timestamp. So far I regarded it more as a nuisance, to be fixed on a rainy day when everything else is fixed.and the date of the file is changed to the current date.
Now that you mentioned it I investigated and found the culprit. The behavior is caused in the fill_statusbar function by the -p option of the file command:
- MIME=$(file --separator " │ " -ip "$vCHOOSER" 2>&1)
if [[ "$MIME" = *│*x-symlink* ]];then
echo -n $vCHOOSER " ➡" $(file --separator " │ " -ip "$(realpath "$vCHOOSER")" 2>&1)
It obviously means that the time of access by the command is preserved with a new timestamp ... on files, not of files. Sorry, lost in translation. I will update the script.The manual wrote:-p, --preserve-date preserve access times on files
Hi Mochi - I am using the latest version and wondered the following:
- is there any way to set it for single click rather than double click? If I single click on an image or text file it displays ok immediately but if I single click on a directory it does not open - requiring me to doubleclick. Is this related to rox settings? Is it possible for this behaviour to be modified (or modifiable) within mmviewer regardless of how rox is set?
- is it possible to set mmviewer so that it slightly alters the display format of text files so that they have a leading space in the display panel? Xml files display in a nice readable way because they tend to have plenty of leading spaces and tabs - but flat text files seem crammed up against the left margin of the viewer and are harder to read for someone like me who suffers from astigmatism.
cheers!
- is there any way to set it for single click rather than double click? If I single click on an image or text file it displays ok immediately but if I single click on a directory it does not open - requiring me to doubleclick. Is this related to rox settings? Is it possible for this behaviour to be modified (or modifiable) within mmviewer regardless of how rox is set?
- is it possible to set mmviewer so that it slightly alters the display format of text files so that they have a leading space in the display panel? Xml files display in a nice readable way because they tend to have plenty of leading spaces and tabs - but flat text files seem crammed up against the left margin of the viewer and are harder to read for someone like me who suffers from astigmatism.
cheers!
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
No.greengeek wrote:- is there any way to set it for single click rather than double click?
I've now changed <edit> to <edit left-margin="0"> . Set a higher value to add margin.- is it possible to set mmviewer so that it slightly alters the display format of text files so that they have a leading space in the display panel?
If you could consider changing rox to defaultfilemanager then that would be appreciated - thanks.MochiMoppel wrote:*Which* errors? Spaces in file names shouldn't be a problem, but if you don't use rox then of course the script may not work properly.Peebee wrote:Doubling clicking an item with spaces in the file name gives errors.....
I would like to include this facility in the next LxPupSc.....
- Attachments
-
- Screenshot.png
- (121 KiB) Downloaded 496 times
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
I knew you could do it.
MochiMoppel wrote:bothers me too..smokey01 wrote:Each time a file is touched the filename is boldedWell, only the "access" and "change" timestamps are changed, not the important "modified" timestamp. So far I regarded it more as a nuisance, to be fixed on a rainy day when everything else is fixed.and the date of the file is changed to the current date.
Now that you mentioned it I investigated and found the culprit. The behavior is caused in the fill_statusbar function by the -p option of the file command:I used this option because I thought it would preserve the existing file dates
- MIME=$(file --separator " │ " -ip "$vCHOOSER" 2>&1)
if [[ "$MIME" = *│*x-symlink* ]];then
echo -n $vCHOOSER " ➡" $(file --separator " │ " -ip "$(realpath "$vCHOOSER")" 2>&1)It obviously means that the time of access by the command is preserved with a new timestamp ... on files, not of files. Sorry, lost in translation. I will update the script.The manual wrote:-p, --preserve-date preserve access times on files
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Not by many people The script would stop to work. No major Puppy knows "defaultfilemanager". My script also uses rox options which I don't expect to work with any other file manager.peebee wrote:If you could consider changing rox to defaultfilemanager then that would be appreciated
Instead may I suggest that you fix your scripts. You are not using ROX-Filer and the error message in your screenshot is not triggered by ROX-Filer. In your case the command rox "$vCHOOSER" , which of course works fine with the "real" ROX, calls a wrapper script which points to pcmanfm. You need to use proper quoting in this script .... or you could simple symlink to defaultfilemanager, where you did the quoting right, hence no problems with defaultfilemanager.
Just an idea, how about using xdg-open instead rox?
Would the resulting behavior stay the same?
EDIT: Just tried the new version and big images are now scaled down and small images stay normal, that's awesome!
Would the resulting behavior stay the same?
EDIT: Just tried the new version and big images are now scaled down and small images stay normal, that's awesome!
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]
The X series of pups have a modified rox file in /usr/local/bin that uses exo-open, maybe this will give you a clue to make something workable.peebee wrote:If you could consider changing rox to defaultfilemanager then that would be appreciated - thanks.MochiMoppel wrote:*Which* errors? Spaces in file names shouldn't be a problem, but if you don't use rox then of course the script may not work properly.Peebee wrote:Doubling clicking an item with spaces in the file name gives errors.....
I would like to include this facility in the next LxPupSc.....
Code: Select all
#!/bin/sh
# redirect rox calls to thunar
CURRENTWM="`cat /etc/windowmanager`"
if [ "$CURRENTWM" = "jwm" ]; then
exec /usr/local/apps/ROX-Filer/AppRun "$@"
else
if [ $# -eq 0 ];then
exo-open /root
exit
fi
if [ "$1" = "-D" ];then
exit
fi
if [ "$3" = "-d" ] || [ "$3" = "-x" ];then
exo-open "$2"
exit
fi
if [ "$1" = "-d" ];then
shift
exo-open "$@"
exit
fi
if [ -d "$1" ];then
exo-open "$@"
exit
fi
fi
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Hi MochiMoppel, If I click a symbolic link to a text file the view pane is blank. Is it a limitation of the chooser GTK widget? Thanks for this script.
edit: MochiMoppel followed up by PM. the problem is identified and solved.
edit: MochiMoppel followed up by PM. the problem is identified and solved.
Last edited by step on Sat 11 Feb 2017, 19:08, edited 1 time in total.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]
Thanks for the pointers - they led me to make other beneficial changes.....MochiMoppel wrote:....You need to use proper quoting in this script .... or you could simple symlink to defaultfilemanager, where you did the quoting right, hence no problems with defaultfilemanager.
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
New features in update 2017-02-12 (see also initial post)
Menu bar (shortcut F10)
Offers keyboard access for all and shortcuts for most functions.
Usage messages for executables
Most binaries in the various bin directories display a short usage message when the user typesinto a console. Sometimes it should rather be -help, -h or nothing at all... no rules ... hit and pray.
The script tries --help and -help and displays the output in the viewer pane. Most of the times it succeeds. It's a convenient way to get an idea what all these little programs are about.
Since this function executes a file and not just reads it, it is available only on demand (shortcut F1) .
The function contains some safeguards against "rogue" utilities:
- Works only for programs which contain the string 'usage:'
- Runs the program in a tiny console window
- Kills the console automatically, latest after 0.5 sec.
Directory tree size
The script displays the disk usage of a directory tree (command du -hs ). Symlinks and directories containing only zero size files are displayed as 0, completely empty directories are displayed as empty.
Can be a bit slow for very large directories but generally the speed is acceptable.
Window size and position
The script now remembers its last size and position on screen if the user closes the window with the Close button or the (new) keyboard shortcut Ctrl+Q.
Menu bar (shortcut F10)
Offers keyboard access for all and shortcuts for most functions.
Usage messages for executables
Most binaries in the various bin directories display a short usage message when the user types
Code: Select all
<filename> --help
The script tries --help and -help and displays the output in the viewer pane. Most of the times it succeeds. It's a convenient way to get an idea what all these little programs are about.
Since this function executes a file and not just reads it, it is available only on demand (shortcut F1) .
The function contains some safeguards against "rogue" utilities:
- Works only for programs which contain the string 'usage:'
- Runs the program in a tiny console window
- Kills the console automatically, latest after 0.5 sec.
Directory tree size
The script displays the disk usage of a directory tree (command du -hs ). Symlinks and directories containing only zero size files are displayed as 0, completely empty directories are displayed as empty.
Can be a bit slow for very large directories but generally the speed is acceptable.
Window size and position
The script now remembers its last size and position on screen if the user closes the window with the Close button or the (new) keyboard shortcut Ctrl+Q.