ROX-xdg 1.5
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
@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.
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]
Thats okay. I will just leave this package here on this forum.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.
Based on Barry's observation. audio, image, video, and text can simply use the following script.
for audio and video
for image
for text
However I noticed that the application/* has a different story.
Here are the examples:
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
for audio and video
Code: Select all
#!/bin/sh
exec defaultmediaplayer "$@"
Code: Select all
#!/bin/sh
exec defaultimageviewer "$@"
Code: Select all
#!/bin/sh
exec defaultexteditor "$@"
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
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
@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.
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]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
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.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.
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
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.
@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.
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.
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Thanks for the clarification about text/plainMochiMoppel 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.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.
- 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
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.
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]
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".
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.
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".

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)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
I am calm!mistfire wrote:@musher0
Calm down, don't panic.

IMO, that may lead to some confusion.mistfire wrote:The recent rox-xdg can coexist with the old system and yet enhance the rox-filer's flexibility.
Indeed!mistfire wrote:Thanks to Barry.

musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
When you double-click on text files of mime type text/x-shellscript or text/html they will not open in your text viewer.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.
You will need "Open as Text" to do that. You can access this function via menu item "Open as Text" or via Shift-click.