Page 1 of 1

Integrate app to Rox filer?

Posted: Tue 26 Mar 2013, 20:46
by PaulR
Is there way to integrate a program into the right-click menu in Rox (in the same way as Windows programs 'integrate to shell'). ?

Specifically I'd like to add XArchive so I can right-click and choose 'add to archive' (right-clicking and choosing 'open with' XArchive doesn't work as I'd hoped :( )

Posted: Tue 26 Mar 2013, 23:00
by `f00
That is one of the reasons I use xfe a lot more than rox. Working with archives is dead simple, fast and intuitive (also for open/view/edit other file types, kybd shortcuts and so forth).

Surely there are ways to get rox to do what you want how you wish .. and perhaps someone else (ball rolled :) ) will come along with rox guidance.

Merely a thought to try xfe - by the way, it uses fltk rather than gtk (so you still have a working fm even if gtk somehow gets broken :shock: )..

Posted: Tue 26 Mar 2013, 23:35
by R-S-H
Hi.

Create a empty script (right-click into a opened rox window), name it to 'add2archive' and insert: the code below into this script

Code: Select all

#!/bin/bash -a
#------------------------------------------------------------------------------
# Add files either to an existing or to a new to create archive
# 2013-03-26 RSH for Puppy Linux / PaulR
#------------------------------------------------------------------------------
xarchive --add=ask "$@"
# End
Copy the script to /usr/local/bin.

Go to /root/.config/rox.sourceforge.net/OpenWith and create a symbolic link for each and every file type or inode-directory etc. you want to use this for.

Example:

Want to use this for jpeg images, create a symbolic link to /usr/local/bin/add2archive in /root/.config/rox.sourceforge.net/OpenWith/.image_jpeg (I would use 'absolute' most other users would use 'relative')

If you do create a symbolic link also in /root/.config/rox.sourceforge.net/OpenWith, then you can use this also on a selection of several files (right-click option 'Open with' is needed to use then)

Posted: Wed 27 Mar 2013, 00:01
by don570
The method of RSH will work but it lacks a menu icon. Rox solves this
by recognizing a special type of folder. I think Rox calls it a 'AppInfo file' folder in its manual.

http://rox.sourceforge.net/Manual/Manua ... ml#appdirs

To see examples of these folders go to /usr/local/apps/

Look inside the folders you see there.

There are typically three files inside the folder

1) description when mousing over folder
2) a script which can be very complex , but typically is very simple
and just launches an app. It is called 'AppRun'
3) usually there is an icon (typically a link to an icon) that is hidden.
It must be called '.DirIcon'.


So just make a right click menu item by linking to this special rox
folder. The link's name is what shows in the right click menu.

.

Posted: Wed 27 Mar 2013, 00:29
by R-S-H
Yes, don570 is right!

That's why I've made the Add2Archive-0.0.1.pet.

So, you just can install this package and everything should work out of the box.

Posted: Wed 27 Mar 2013, 09:04
by PaulR
Thanks all! I guessed it would be possible... and lots of useful info there to play with :D

One other related thing - see image3 in R-S-H's post, I always have to resize this window to see the filenames, is there a way to overcome that annoyance?

Thanks again

Paul

Posted: Wed 27 Mar 2013, 11:43
by CatDude
Hello PaulR
PaulR wrote:...One other related thing - see image3 in R-S-H's post, I always have to resize this window to see the filenames, is there a way to overcome that annoyance?
Re-compile the bugger.

I just had a quick test myself,
and this is what i did:


Downloaded the sources: http://switch.dl.sourceforge.net/projec ... 8-6.tar.gz

Unpacked them (into /root for this example)

In the titlebar of the image you refer to, we see the string "Select Files or Directories To Add"
so let's find out which file contains that string.

Open a terminal inside of the sources directory and run the following command:

Code: Select all

grep -rn "Select Files or Directories To Add" .
which returns the following:

Code: Select all

./src/myfc_gtk.c:219:           "Select Files or Directories To Add", NULL,
So, open up: /root/xarchive-0.2.8-6/src/myfc_gtk.c in Geany.
and scroll down to line 219 you will see the string,
scroll down further and you will see these:
Line 238

Code: Select all

  gtk_widget_set_size_request(GTK_WIDGET(myfcd.fc), 450, 200);
Line 243

Code: Select all

  gtk_widget_set_size_request(vbox, 450, 180);
They are what we need to change.

The attached image is the result of using these changes:

Line 238

Code: Select all

  gtk_widget_set_size_request(GTK_WIDGET(myfcd.fc), 600, 305);
Line 243

Code: Select all

  gtk_widget_set_size_request(vbox, 600, 225);

When tou have finished making your changes,
run:

Code: Select all

./configure --prefix=/usr && make
there's no need to do the make install

Your new binary is located here: /root/xarchive-0.2.8-6/src/xarchive
  • NOTE:
    It is considerably larger than the current one, so you may wish to strip it.
Now rename: /usr/bin/xarchive to someting like /usr/bin/xarchiveORIG
and place a copy of your new binary file into: /usr/bin

Then fire up xarchive and check if your happy with the new size,
if not have another go until you are.

Hope this helps
CatDude
.

Posted: Wed 27 Mar 2013, 12:52
by PaulR
Cheers catdude, that's one way of fixing it I guess!

Might be better to add some code to write out a file (or add a line to an existing config if any?) when closing and reload it when opening such that the window size is remembered but I kmow nothing about coding for GTK and would probably break it. :lol:

Paul

Posted: Thu 28 Mar 2013, 08:34
by disciple
Does Puppy not include Pupzip (a wrapper for xarchive) anymore?