Building MMview, a universal file viewer

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#61 Post by mavrothal »

This is a REALLY nice utility.
I think should be in every puppy!
I can understand that you may not want to have it in woof-CE (you might reconsider though...) but maybe have it as a pet to facilitate the build process.

A couple of issues that you might consider addressing is the appearance of /mnt/home as (the proper mount point name) "dev_save", that may be a bit confusing. It is also a duplication since the relevant partition is also shown.
There is also no indication if a partition is mounted. Partitions auto-mount if clicked upon but provide no way to unmount them. BTW not sure how partitions are ordered in the side panel. Reverse volume-forward partition?

Anyway, is still super. 8)
Attachments
quickview.jpg
(50.77 KiB) Downloaded 549 times
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#62 Post by greengeek »

Thanks for sorting the encoding handling - /usr/share/usbids now displays correctly on my system. (This file is a very interesting list of known usb device ids - a good reference)

If I close the mmquickview window by using the "close" radio button it will remember (and display) the last_viewed_directory (or item) when I next start the utility. Alternatively if I terminate the window by clicking the X button it does not remember the directory or item I was viewing during the previous run. Is there any way to allow mmquickview to remember it's last viewed directory when X is clicked?

One thing I like about having a viewer is that I can investigate the code within my scripts just by clicking them - no more risk of the code being actually executed when I click. (how often have I clicked on various text files to read them then accidentally clicked an executable script and started to panic about what it is doing...)

cheers!

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#63 Post by jamesbond »

Very nice code. Do you mind if I get this included in Fatdog?
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#64 Post by belham2 »

jamesbond wrote:Very nice code. Do you mind if I get this included in Fatdog?
+1


Told ya, Mochi, it was just a matter of time. :wink: Quickview has worked great in all the dpup-stretch builds I'm experimenting with. Never even thought to drop it in Fatdog64, I assumed it would not work right out of the box. Gonna try now that James posted :D

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

#65 Post by drunkjedi »

belham2 wrote:Never even thought to drop it in Fatdog64, I assumed it would not work right out of the box. Gonna try now that James posted :D
I already tested it mate.
Works nicely in Fatdog.

Most scripts work in 62 bit as well as 32 bit.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#66 Post by MochiMoppel »

vovchik wrote: thanks for the scaling preference
Your idea :wink:
mavrothal wrote:A couple of issues that you might consider addressing
Me? :shock: For complaints or suggestions regarding GtkFileChooserDialog you should contact https://www.gtk.org/development.php. I have no influence on what is displayed in the Places panel.
mavrothal wrote:there is also no indication if a partition is mounted
Well, there is: If a partition is mounted, it is listed. If it is not mounted, it is not listed.
mavrothal wrote:Partitions auto-mount if clicked upon
How do you manage to click on unmounted partitions when they are not visible? And why should they automount? All entries in the left panel (except for the Search box) are mere links.

BTW: This thing behind mm_quickview in your screenshot suggests that you are using GTK+3. Gtkdialog seems to be compiled with an older version of GTK+2. Thunor has prepared switches to compile gtkdialog with GTK+3. Since the file chooser has been developed further, looks different in GTK+3 and addresses some of the issues you mentiond, it would be interesting to see how an updated gtkdialog displays the chooser widget. Results of such experiment could be posted in http://www.murga-linux.com/puppy/viewto ... ?p=941690], but not here. I will continue to use gtkdialog as is.
greengeek wrote:Alternatively if I terminate the window by clicking the X button it does not remember the directory
That's a deliberate feature. You may stray into obscure directories but may not necessarily want to restart from there.
Ctrl+Q or Close button: Last directory and geometry are saved
Alt+F4 or X button: Nothing is saved
jamesbond wrote:Do you mind if I get this included in Fatdog?
I don't mind but I have concerns :lol:
- Neither code nor functionality are finished
- I can't test the script sufficiently and can not provide support for different environments.
- I regard this project as a proof-of-concept, not as a polished application (hence my posting in the Programming forum). I still don't know how this will develop. Next step will be on-demand information for selected directories. Then the big topic of adding shell commands. It ain't ready yet.

@belham2,drunkjedi: Thanks for testing.

Questions:
I repeat my earlier question: In tahrpup ffprobe and ffplay are missing. Autoplay is not supposed to work. Does tahrpup offer alternatives?

New question: Could someone suggest a better name? Quickview is already taken. It's the name of a function in Total Commander and it is also the name of a famous commercial application. Internally I call it fileviewer, which is even more dull.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#67 Post by step »

viewmate
[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]

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#68 Post by perdido »

Playing with the Mochi file browser on Precise5.7.1. Looks good and promising!

I like how it has total disk space used by directory when hilighting a directory.

Also good that it launches applications

Makes me smile how easy it is to review music files without launching a program. Nice!

Thanks MochiMoppel! :)

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#69 Post by mavrothal »

MochiMoppel wrote:
mavrothal wrote:there is also no indication if a partition is mounted
Well, there is: If a partition is mounted, it is listed. If it is not mounted, it is not listed.
mavrothal wrote:Partitions auto-mount if clicked upon
How do you manage to click on unmounted partitions when they are not visible? And why should they automount? All entries in the left panel (exept for the Search box) are mere links.

BTW: This thing behind mm_quickview in your screenshot suggests that you are using GTK+3. Gtkdialog seems to be compiled with an older version of GTK+2. Thunor has prepared switches to compile gtkdialog with GTK+3. Since the file chooser has been developed further, looks different in GTK+3 and addresses some of the issues you mentiond, it would be interesting to see how an updated gtkdialog displays the chooser widget. Results of such experiment could be posted in http://www.murga-linux.com/puppy/viewto ... ?p=941690], but not here. I will continue to use gtkdialog as is.
As the image hints to, I used Peebee’s LxPupSc-latest in this case. Is using openbox/pcmanfm and has no-gtk3-anything. Still, I ldd’ed both pcmanfm and gtkdialg just in case and have no gtk3 dependencies. gtkdialog is v 0.8.4 with support for gtk+ 2, glade and VTE. gtk2 is v2.24.
PCmanFM shows partitions regardless of mount status and so quickview in this setup.

Another little thing I notice regarding symlinks to folders, is that they show as “0 /path/to/symlink
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

#70 Post by drunkjedi »

MochiMoppel wrote:New question: Could someone suggest a better name? Quickview is already taken. It's the name of a function in Total Commander and it is also the name of a famous commercial application. Internally I call it fileviewer, which is even more dull.
How about GTK_Filer
step wrote:viewmate
I liked that name but google says there's a CAD data viewer with that name. Would it matter?

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#71 Post by SFR »

Hey Mochi

Very nice script, indeed.
MochiMoppel wrote:I repeat my earlier question: In tahrpup ffprobe and ffplay are missing. Autoplay is not supposed to work. Does tahrpup offer alternatives?
Try avprobe/avplay.
___________

Anyway, I'm here because Fatdog does not come with xclip pre-installed and I wanted to suggest a solution, e.g.:

Code: Select all

which xclip 2>/dev/null && CLIP='xclip -i' || CLIP='xsel -i'
...
echo -n "$vCHOOSER"   | ${CLIP}
I also added double quotes around $vCHOOSER, because otherwise 'echo' squeezes whitespaces, if there's more than one of them in a row.


Oh, and in order to make it more multi-user-friendly, you may want to:

Code: Select all

TEMPDIR=/tmp/mm_quickview.${USER}
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#72 Post by greengeek »

MochiMoppel wrote:New question: Could someone suggest a better name? Quickview is already taken. .
mox

mmoxy

mmoxview

moxview

uniview

viewmmer

zoommer

zoommox

viewmmox

emmviewer

It'd be nice to see a "double m" in there somewhere.

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#73 Post by belham2 »

MochiMoppel wrote:
New question: Could someone suggest a better name? Quickview is already taken. It's the name of a function in Total Commander and it is also the name of a famous commercial application. Internally I call it fileviewer, which is even more dull.

Well, you all can call it whatever you want, but I actually in truth use "MochiView" in my menu entries, tray bars and .desktop and anyhting else. In the .desktop comment for my builds I always write "QuickView aka MochiView File Manager" so people know if they use one. The name "MochiView" lets me identify it immediately. To me it is simply, honorably, and correctly called: :wink:

MochiView File Manager

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#74 Post by jamesbond »

MochiMoppel wrote:
jamesbond wrote:Do you mind if I get this included in Fatdog?
I don't mind but I have concerns :lol:
Thanks.
- Neither code nor functionality are finished
Ok. We don't mind waiting for a while. Anyway, once we get it in, we hope to track this as it progresses.
- I can't test the script sufficiently and can not provide support for different environments.
That's okay - we're going to handle that (now that both step and SFR have responded :D)
- I regard this project as a proof-of-concept, not as a polished application (hence my posting in the Programming forum). I still don't know how this will develop. Next step will be on-demand information for selected directories. Then the big topic of adding shell commands. It ain't ready yet.
Sometimes perfect is the enemy of good. The way I see it, it already serves a good purpose. We're happy to take it as it is; and as you continue with the improvement, we'll track it.
New question: Could someone suggest a better name?
I'm a bit surprised nobody has suggested this. The "glorious" name, of course:
- Puppy Viewer (pview, PView, Pview, pviewer, PViewer, Pviewer, pupview, PupView, pupviewer, PupViewer, PuppyView, etc)
- Puppy File Viewer (pfileview, pupfileview, pupfview, and all other caps/no-caps combinations as above)
- Puppy (File) Preview (ppreview, pfpreview, and other abbrev/caps/no-caps combinations)
- Puppy Universal Viewer (pupuview(er), puview(er), etc)
- MochiView / MochiViewer / MochiFileViewer (mview(er), mfileview(er), mpupview(er), etc)
- Mother of All File Viewer (mview(er), momview(er), etc)
- I'm sure other names along this line will be easy to come up with.

EDIT: belham2 beat me to MochiView, but at least I still have other good ideas :twisted:
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

stemsee

#75 Post by stemsee »

It shall be named
  • MiView
M (och) i

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#76 Post by perdido »

Humble suggestion.

When hilighting a file directory in file window pane it would be nice to see the sub-directories in the viewer window pane. Not all files, just sub-directories.

Just my thought while using.

.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Building a universal file viewer

#77 Post by L18L »

jamesbond wrote:
- I can't test the script sufficiently and can not provide support for different environments.
That's okay - we're going to handle that (now that both step and SFR have responded :D)
You can count me in for universal users. :wink:
Attachments
mm_i.png
Just a teaser
made by:
<menu label="'$(gettext geany File)'">
<menuitem label="'$(gettext geany Quit)'"
<menu label="'$(gettext geany Preferences)'">
(72.56 KiB) Downloaded 666 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Building a universal file viewer

#78 Post by L18L »

gettexted and translated using momanager.

TEXTDOMAIN is "puppyview"
Attachments
mm_i18n.png
note, fatdog is full of translations
also usage messages already translated
(42.69 KiB) Downloaded 615 times
mm_quickview_20170310_i18n.gz
remove fake .gz
(15.87 KiB) Downloaded 173 times

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#79 Post by MochiMoppel »

@all Thanks for joining the naming contest and lots of interesting proposals. Makes it even harder to choose. How about 'MM Inlook'? Would sound familiar - somehow.

For the time being I'll only get rid of the "quick" and change the script name to mm_view. Pure egoism. It helps me to find it in my huge script pit where all of my more serious stuff starts with 'mm_' . I'll take the liberty to refer to it as MMview for the rest of this thread. Eventually, with more input from the community, the 'MM' will have to go. Let's see.

@mavrothal Maybe I can add '(disk usage)' to the output to make it less confusing.
Line wrapping is possible but I see too many disadvantages and have no plans to implement it.

@SFR I haven't yet tried avprobe/avplay. Tahrpup doesn't run well on my current machine, so tahrpup users will have to wait or roll their own code.

Thanks for pointing out Fatdog's xclip deficiency. Makes me wonder about the reasons, but no problem. This should take care of distros with even none of the two utilities installed:

Code: Select all

type -p xclip  && CLIP=xclip || { type -p xsel && CLIP=xsel || CLIP=: ;} ; export CLIP
...
echo -n "$vCHOOSER" | $CLIP -i
File names with consecutive whitespace? You must have seen a lot in your life. But of course you are right. I'll fix the quotation marks.

I'll add (multi) user friendliness to my next update. I will put config settings into $HOME/.config/mm_view, so they may survive a reboot, and truly temporary files into /tmp/mm_view. This should be clean enough for multi-user installations.

@greengeek How do you pronounce "viewmmer"?

@belham2 I'm flattered to see "MochiView File Manager" in such big letters. It's not yet a file manager.

@jamesbond Thanks for your interest. Don't worry, I'm not striving for perfection and I will not ride this horse to death.

@stemsee MiView? Why not "MM MiEV"? Mitsubish Motors i-MiEV. Oh, I smell trouble.

@perdido Some kind of subdirectory display is scheduled for one of the next updates though it will be on-demand only, not when you simply select a directory. The problem is that calculation can take too much time and will cause the script to temporarily freeze. Even the current display, generated by the du command, can be extremely slow, e.g. when you select an external drive with thousands of subdirectories. I will therefore add a timeout to the current display, but you will be able to see the information when hitting the F1 key.

@L18L Error messages don't look any nicer in Japanese :lol: . As you may have noticed I never gettext my scripts. I don't mind if anyone takes the trouble and adds it, but be warned that I change texts frequently, so "internationalization" should be one of the very last tasks.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#80 Post by greengeek »

MochiMoppel wrote: How about 'MM Inlook'? Would sound familiar - somehow.
Haha - you may have just given Microsoft a new idea there. :-)
How do you pronounce "viewmmer"?
Well, I was thinking it would be pronounced something like "vyoo ma". (not really sure how to do phonetic spelling)

"inlook" triggered a few more thoughts:
Can't help myself...

zoomin
zzoomm
zoommin
zoommer
zoommax
immedia
viewmmedia
seemmee
showmmee
inspector
mmonitor
mmicroscope
summary
summation
medium
mmaxiview

I'm going to stop now before my head bursts.

Post Reply