ROX-xdg 1.5

Filemanagers, partitioning tools, etc.
Message
Author
mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#21 Post by mistfire »

ROX-xdg 1.4 released

* Some improvements
* Changes in post-install scripts. This new system coexists with the old as fallback.
* audio, video, text, and image script removed. Only application scripts.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#22 Post by BarryK »

@mistfire,
Your system has been good for me, as it has made me rethink how it all works, though I decided not to use it, see the appendage to my blog post:

http://bkhome.org/news/201909/rox-filer ... types.html

The benefit of studying your work has revealed to me a shortcoming in the "old" system as implemented in WoofQ, and I created fallbacks, as reported in the above link.

My fix in WoofQ seems not appropriate for woof-CE. Looking at the woof-CE github, there is no rox mime handling in rootfs-skeleton, so they expect it all to be in the rox pet -- so any fixes would have to be in whoever creates the rox pet.
[url]https://bkhome.org/news/[/url]

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#23 Post by mistfire »

BarryK wrote:@mistfire,
Your system has been good for me, as it has made me rethink how it all works, though I decided not to use it, see the appendage to my blog post:

http://bkhome.org/news/201909/rox-filer ... types.html

The benefit of studying your work has revealed to me a shortcoming in the "old" system as implemented in WoofQ, and I created fallbacks, as reported in the above link.

My fix in WoofQ seems not appropriate for woof-CE. Looking at the woof-CE github, there is no rox mime handling in rootfs-skeleton, so they expect it all to be in the rox pet -- so any fixes would have to be in whoever creates the rox pet.
Thats okay. I will just leave this package here on this forum.

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#24 Post by mistfire »

Based on Barry's observation. audio, image, video, and text can simply use the following script.

for audio and video

Code: Select all

#!/bin/sh
exec defaultmediaplayer "$@"
for image

Code: Select all

#!/bin/sh
exec defaultimageviewer "$@"
for text

Code: Select all

#!/bin/sh
exec defaultexteditor "$@"
However I noticed that the application/* has a different story.

Here are the examples:

Code: Select all

application/x-7z-compressed
application/x-7z-compressed-tar
application/x-ace
application/x-alz
application/x-annodex
application/x-ape
application/x-ar
application/x-arj
application/x-bittorrent
application/x-btsnoop
application/vnd.rn-realaudio
So I made a new approach. Only application script on MIME-types folder must retain to act as fallback mode to search default app at xdg level. So in this manner still the rox-xdg provides more flexibility and retains being dynamic. Rather ROX-xdg is now a plugin for rox-filer

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#25 Post by BarryK »

@mistfire,
Yes, I think that your last post pretty much sums it up.

I made another modification to my blog post:

http://bkhome.org/news/201909/rox-filer ... types.html

I need to think some more about the 'application' mime type. Not now, have to rush off to a family gathering.
[url]https://bkhome.org/news/[/url]

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#26 Post by mistfire »

@musher0

Calm down, don't panic. The recent rox-xdg can coexist with the old system and yet enhance the rox-filer's flexibility. Thanks to Barry.

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

#27 Post by MochiMoppel »

BarryK wrote:There is a problem...
The ROX right-click menu has "Open as text" which no longer works.
It relies on /etc/xdg/rox.sourceforge.net/MIME-types/text, the old one, which has "exec defaulttexteditor $@" in it.
Oh dear, how to get around this? Other than modifying the source code in rox, I can't see how.
What do you mean by "the old one"? Call it the "neglected one". Your problem arises because mistfire places his scripts into the directory /root/.config/rox.sourceforge.net/MIME-types. IMO this is wrong. The scripts should go into /etc/xdg/rox.sourceforge.net/MIME-types.

These are the directories where ROX looks for its run scripts, in following order. Note that ROX first scans directories 1) - 3) for mime subtypes, e.g. image_png. If not found it scans again for main types, e.g. image.
  • 1) /root/.config/rox.sourceforge.net/MIME-types
    2) /etc/xdg/rox.sourceforge.net/MIME-types
    To be compatible with very very old ROX versions it then checks the now deprecated
    3) /root/Choices/MIME-types
IMO 3) shouldn't be used anymore. All scripts should go to 2). These are the defaults. 1) should be reserved for user specific associations where the user can override the defaults.

Now to your "Open as text" problem: When you "Open as text" (or Shift+click) ROX does not rely on /etc/xdg/rox.sourceforge.net/MIME-types/text. Firstly, the mime type it looks for is text/plain. Currently ROX relies on /root/Choices/MIME-types/text_plain, but with its low priority and mistfire's scripts now in /root/.config/rox.sourceforge.net/MIME-types ROX will never find it.

Solution 1: Remove /root/Choices/MIME-types/text_plain. ROX will fall back to type text and run mistfire's script. Haven't tested, but should work.

Solution 2: With text_plain in 1) and mistfire's scripts in 2) it will work.

foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#28 Post by foxpup »

@musher0

You are probably right BK is no longer Puppy God himself since he left Puppy to the Community.
God of Puppy is now the main dev at woof CE, who is almost invisible and the Community who is everywhere an nowhere, like many traditionnal gods. lol

I do sometimes have trouble launching things by clicking in ROX.
Sometimes it is a bad/non-existing (default) application.
If it is an unknown type of file, there is an item in the right-click menu to appoint the default handler app. It seems to work for me like that.
If I have msWord (on wine) next to LibreOffice and AbiWord, I can detail what app takes what kind of text document. :!:
For me that is all I need. But I can imagine there is room for improvement.

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#29 Post by mistfire »

ROX-xdg 1.5 released

*Some improvements on rox-xdg-open script

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#30 Post by BarryK »

MochiMoppel wrote:These are the directories where ROX looks for its run scripts, in following order. Note that ROX first scans directories 1) - 3) for mime subtypes, e.g. image_png. If not found it scans again for main types, e.g. image.
  • 1) /root/.config/rox.sourceforge.net/MIME-types
    2) /etc/xdg/rox.sourceforge.net/MIME-types
    To be compatible with very very old ROX versions it then checks the now deprecated
    3) /root/Choices/MIME-types
IMO 3) shouldn't be used anymore. All scripts should go to 2). These are the defaults. 1) should be reserved for user specific associations where the user can override the defaults.

Now to your "Open as text" problem: When you "Open as text" (or Shift+click) ROX does not rely on /etc/xdg/rox.sourceforge.net/MIME-types/text. Firstly, the mime type it looks for is text/plain. Currently ROX relies on /root/Choices/MIME-types/text_plain, but with its low priority and mistfire's scripts now in /root/.config/rox.sourceforge.net/MIME-types ROX will never find it.
Thanks for the clarification about text/plain

Yes, in WoofQ, I have put all the rox mimetype handling and open-with handling into /etc/xdg/rox.sourceforge.net

I just now had a look at the woof-CE github repo, and there is no rox mime handling stuff in it, I guess because they want to keep it file-manager-neutral. Then it is up to whoever creates the rox PET to build the mime handling into the right paths.

In WoofQ, I have considered rox to be an integral part of EasyOS and Quirky, so it is built-in, and will override whatever mime handling is in the rox PET.

But ha ha, yes, there are different "gods" running the show now.
[url]https://bkhome.org/news/[/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#31 Post by musher0 »

Far-fetched:
Why not skip the mime-types altogether and use the file command, piped?

E.g.:
file (the command) file (the data) | grep something distinctive the file command says
about the data file > result file

Then this result is paired with a list of players or editors, and we load the data file with
this "executioner". :twisted:

As I said, far-fetched.

~~~~~~~~~~~~~~~~~~

As for the right-click for text, I don't remember using it. (Maybe when I was a newbie.)
Actually, I don't have a need for it any more.

In a ROX window, I double-click on a text file, and it opens in the text viewer.

Now my text viewer is (the real) less, and (the real) less can be scripted to pass the
text to an editor if it needs to be edited. Doing it like this is intentional: by changing the
application, you keep your brain on alert and notice more errors if there are any. (Basics
of psychology of perception: the brain tires easily, has a short attention span, and is
refreshed by a change of environment.)

Also less has an hex mode it can switch to (after a warning) if the content of the file
is not text. This is sometimes handy with files that look weird. Most data files have a
2-3 bytes header that identifies their type: archive, C code, png, and so on.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#32 Post by musher0 »

mistfire wrote:@musher0

Calm down, don't panic.
I am calm! :lol:
mistfire wrote:The recent rox-xdg can coexist with the old system and yet enhance the rox-filer's flexibility.
IMO, that may lead to some confusion.
mistfire wrote:Thanks to Barry.
Indeed! :)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#33 Post by MochiMoppel »

musher0 wrote:As for the right-click for text, I don't remember using it. (Maybe when I was a newbie.)
Actually, I don't have a need for it any more.

In a ROX window, I double-click on a text file, and it opens in the text viewer.
When you double-click on text files of mime type text/x-shellscript or text/html they will not open in your text viewer.
You will need "Open as Text" to do that. You can access this function via menu item "Open as Text" or via Shift-click.

Post Reply