How to display Rox-filer options window in command line?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

How to display Rox-filer options window in command line?

#1 Post by Argolance »

Helllo,
All is in the title: Usually this options window is displayed while right clicking on any empty area of a window of Rox. I would like to know the command line that displays it directly, for example <action> exec rox ???? &</action>.
Thank you a lot.
Regards

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#2 Post by seaside »

Argolance,

This has come up before and sadly no one has found a way to do this. Even though there was no documented way, I tried various commands that I hoped might start the Options directly for Roxset using SOAP and none seemed to work.

You could do a workaround using Xdotools by issuing mouse or key commands after the rox session window has opened.

Cheers,
s

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#3 Post by amigo »

I just metioned this request to ttuuxxx in a PM about my hacked rox-1.2.2-12 filer. I have added several SOAP methods to it -mostly back-ported from later versions of rox. but, I thnik it may not be too hard to add a SOAP method for doing this. There is, of course, a menu entry for opening the dialog (actually several menu entries), so th code for performing the action is already in there -the window is separate but I'm not sure if it is separate enoguh to run without rox also running. But, assuming that rox is running, then it shouldn't be too hard to create SOAP code to do that... I'll have a look over the next few days and see if I can figure it out -unless someone beats me to it.
It may help to have a look at my rox-1.2.2-12 sources to see how the SOAP methods were added. Another of my patches adds a 'Back' button using the existing code for the menu entry, so that patch should also be informative -half this and half that. The sources which include the patches and some example SOAP scripts are here:
http://distro.ibiblio.org/pub/linux/dis ... 12.tar.bz2

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#4 Post by amigo »

Alright, I had a look at this and think I have it working. Here's the patch to the rox-filer_puppy-2.6.1 sources:

Code: Select all

--- ./src/remote.c.00	2006-11-11 13:09:47.000000000 +0100
+++ ./src/remote.c	2010-02-13 14:17:45.000000000 +0100
@@ -50,6 +50,7 @@
 #include "xml.h"
 #include "diritem.h"
 #include "usericons.h"
+#include "options.h"
 
 static GdkAtom filer_atom;	/* _ROX_FILER_EUID_VERSION_HOST */
 static GdkAtom filer_atom_any;	/* _ROX_FILER_EUID_HOST */
@@ -105,6 +106,8 @@
 static xmlNodePtr rpc_SetIcon(GList *args);
 static xmlNodePtr rpc_UnsetIcon(GList *args);
 
+static xmlNodePtr rpc_OpenOptionsUi(GList *args);
+
 /****************************************************************
  *			EXTERNAL INTERFACE			*
  ****************************************************************/
@@ -154,7 +157,8 @@
 	soap_register("PanelRemove", rpc_PanelRemove, "Side", "Path,Label");
  	soap_register("SetIcon", rpc_SetIcon, "Path,Icon", NULL);
  	soap_register("UnsetIcon", rpc_UnsetIcon, "Path", NULL);
-
+	soap_register("OpenOptionsUi", rpc_OpenOptionsUi, NULL, NULL);
+	
 	/* Look for a property on the root window giving the IPC window
 	 * of an already-running copy of this version of the filer, running
 	 * on the same machine and with the same euid.
@@ -822,6 +826,22 @@
 	return reply;
 }
 
+static xmlNodePtr rpc_OpenOptionsUi(GList *args)
+{
+	GtkWidget *win;
+
+	win = options_show();
+
+	if (win)
+	{
+		number_of_windows++;
+		g_signal_connect(win, "destroy",
+				G_CALLBACK(one_less_window), NULL);
+	}
+	
+	return NULL;
+}
+
 static xmlNodePtr rpc_CloseDir(GList *args)
 {
 	char	   *path;
And here is a SOAP fragment (as a script) which should trigger the action:

Code: Select all

rox --RPC << EOF
<?xml version="1.0"?>
	<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
		<env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
			<OpenOptionsUi>
			</OpenOptionsUi>
		</env:Body>
	</env:Envelope>
EOF
To apply the patch, copy it into the toplevel of the rox sources, cd in there and run:
patch -p1 < name-of-patch (I name it rox-SOAP-OpenOptionsUi.diff)
Then run:
./AppRun --compile
If everything goes alright (as it should), then you'd need to replace your installed version of the rox binary with the new one(be sure to keep a backup of the old one just in case).
Once you have replaced the old binary with the new one, then log out and back in, or restart your desktop -do anything which will cause rox to stop and restart.
Then save the SOAP fragment as soap-test-OpenOptionsUi, make it executable, then open a terminal and cd into the dir where the fragment is and run:
./soap-test-OpenOptionsUi
Hopefully that will open the Options window -I haven't fully tested it as I run a rox-1.2.2 system and the two versions conflict, but I'm fixing to apply the patch to the 1.2.2 version to see if it works there...

Edit: Okay, I just checked and it works as expected with rox-1.2.2. Some of the source patch had to be changed for the old version, but I still expect this the above patch to work for you -I was more worried about whether the SOAP syntax was correct since it compiled okay with the changes. This SOAP command is different from nearly all the supported ones in that it doesn't require or accept any arguments. Of the supported methods only the 'Version' method is like this with no args. Anyway, hope that works for you!

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#5 Post by Argolance »

Thank you a lot, amigo!
I am running Puppy/Toutou 4.31 and was wondering if this could be done properly? Is there any contra-indication or special care to take while?
Regards.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#6 Post by amigo »

No, the filer should be completely normal otherwise -you do know how to compile stuff, right? and have your devx stuff on board?

The script fragment can be pasted as-is into any script/utility you are working with. I am assuming that you are wanting to use it in some integrated look/feel configuration system or from a menu. You could also simply make it executable, name it whatever is convenient, drop it into the PATH and run it as you would any ordinary script -it wouldn't hurt anything to put a shebang at the beginning on the first line:
#!/bin/sh

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#7 Post by Argolance »

Hello amigo!
Thank you a lot for reply!
... Tried to do what you said:
Nothing happens, just this when I launch the first command line in a terminal:
# patch -p1 < rox-SOAP-OpenOptionsUi.diff
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- ./src/remote.c.00 2006-11-11 13:09:47.000000000 +0100
|+++ ./src/remote.c 2010-02-13 14:17:45.000000000 +0100
--------------------------
File to patch:
:?
Regards.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#8 Post by Argolance »

Hello there?
@amigo
Is my reply so silly that it is not worth thinking over? I tried one more time to do what you said but did not succeed!
Regards.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#9 Post by amigo »

Sorry, I don't get notifications when you post, so I didn't know you had aswered.

You need to copy the patch into the toplevel of the rox sources(after unpacking the tarball) and then cd in there and run the command from there -you should be seeing a directory there called 'src'. The installed ROX-Filer probably does not contain the sources, so you'd need to get them from the puppy sources.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#10 Post by Argolance »

Hello amigo,
You need to copy the patch into the toplevel of the rox sources (after unpacking the tarball)
... It is what I did not notice... Sorry! One more question: Please, what tarball should I download (from sourcefourge?) for matching with Puppy 4.31?
Anyway, I will try and leave you some feedback later...
Thank you a lot for your kind attention.
Regards

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#11 Post by amigo »

You'd want to get the sources for the puppy version. The link I have is:
http://bkhome.org/sources/alphabetical/r/

You can check which version you are running by finding the ROX-Filer AppDir on your system, right-click, choose open folder and then open the AppInfo.xml file to see which version you are running. The link above has sources for 2.5, 2.6.1 and 2.7.1
I think Barry has recently started using 2.9. If you are running a recent puppy with gtk >2.18, you may need to use another patch or workaround in /etc/profile to avoid a bug. Search for threads about rox on BK's blog for details of how he worked around it and the patch which I posted there to fix it the 'right' way. If you are using puppy pre-4.3.1 you'll probably be fine with either rox 2.6.1 or 2.7.1.
The patch I posted in this thread is for 2.6.1, but probably would apply to 2.7.1 as well.
Once you have the rox sources, unpack and patch as I posted before, then from the toplevel of the sources just run:
./AppRun
to compile and run the new filer. To make it your new filer, you'd need to replace your existing ROX-Filer AppDir with the new one by renaming the old one and then moving/renaming the new one to match the old name.
Good luck!

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#12 Post by Argolance »

Hello amigo!
I downloaded 'rox-filer-2.7.1.tar.bz2' from http://sourceforge.net/projects/rox/files/, uncompressed (folder 'rox-filer-2.7.1'), opened a terminal in there and type the command line 'patch -p1 < rox-SOAP-OpenOptionsUi.diff' (the name I gave to the file where I pasted the code above and duly present at the top-level of this folder)... and still have this message :oops: :
# patch -p1 < rox-SOAP-OpenOptionsUi.diff
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- ./src/remote.c.00 2006-11-11 13:09:47.000000000 +0100
|+++ ./src/remote.c 2010-02-13 14:17:45.000000000 +0100
--------------------------
File to patch:
What's going wrong Doctor?
Thanks.
Regards

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#13 Post by Argolance »

Sorry, i did not understand that the folder was 'Rox-filer' in 'rox-filer-2.7.1'. Now what I get:
# patch -p1 < rox-SOAP-OpenOptionsUi.diff
# ./AppRun --compile
Compiling /mnt/sdb3/Desktop/rox-filer-2.7.1/ROX-Filer... please wait...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for GCC version... 4.2.2
checking whether to disable pointer sign warning... yes
checking whether to disable stack protector... yes
checking that pkg-config runs... yes
checking that gtk+-2.0 (version >= 2.4.0) is installed... yes
checking that libxml-2.0 (version >= 2.0.0) is installed... yes
checking that libglade-2.0 (version >= 2.0.0) is installed... yes
checking that shared-mime-info (version >= 0.14) is installed... no
configure: error: Package is not installed
Compile failed
Press Return...
Regards.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#14 Post by Argolance »

Hello amigo,
Have you got any idea of what I have to do to solve this problem?
checking that shared-mime-info (version >= 0.14) is installed... no
configure: error: Package is not installed
Compile failed
... Found nothing clear (for me!) on the web!
Sorry to ask you so much!
Regards.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#15 Post by technosaurus »

it means that you need an updated shared-mime-info package .... such as these:

http://distro.ibiblio.org/pub/linux/dis ... o-0.70.pet
http://distro.ibiblio.org/pub/linux/dis ... V-0.70.pet


Or you can find the shared-mime-info area in the configure script and change "exit" to "echo" in that section - it should still compile
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#16 Post by Argolance »

Thank you for your reply!
Now, this is what I get:
# patch -p1 < rox-SOAP-OpenOptionsUi.diff
patching file src/remote.c
Hunk #1 succeeded at 50 with fuzz 2.
Hunk #2 succeeded at 106 with fuzz 2.
Hunk #3 FAILED at 157.
patch unexpectedly ends in middle of line

Hunk #4 succeeded at 826 with fuzz 1.
1 out of 4 hunks FAILED -- saving rejects to file src/remote.c.rej
Anyway I run ./AppRun --compile: All seems running well... But as I run 'soap-test-OpenOptionsUi', I get:
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope"><env:Body xmlns:rox="http://rox.sourceforge.net/SOAP/ROX-Filer"><env:Fault xmlns:rpc="http://www.w3.org/2001/12/soap-rpc" xmlns:env="http://www.w3.org/2001/12/soap-envelope ... >Tentative d'invoquer la m&#xE9;thode SOAP inconnue 'OpenOptionsUi'</faultstring></env:Fault></env:Body></env:Envelope>
???
Regards

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#17 Post by Argolance »

Hello there?
Could anybody help me to go farther?
Regards.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#18 Post by technosaurus »

Sometimes it is easier to apply the patch manually, especially if there have been several revisions.

Open the patch in nicoedit/leafpad etc...
then open the files to be patched in geany(not necessary to use two different text editors/viewers, but I find it nicer to have 2 different windows)

then just go to (or near) the line numbers indicated in the patch for each file (or do a search for the --- text) and remove the existing --- text and add the +++ text
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#19 Post by amigo »

Yeah, since the patch is for 2.6.1, you'll probably need to apply it manually. It's pretty small. the 'failed hunk' leads to the errors when you run it.

Post Reply