Integrate app to Rox filer?

Booting, installing, newbie
Post Reply
Message
Author
PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

Integrate app to Rox filer?

#1 Post 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 :( )

User avatar
`f00
Posts: 807
Joined: Thu 06 Nov 2008, 19:13
Location: the Western Reserve

#2 Post 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: )..
Attachments
archive-xfe.png
sample of context menu (.tar.gz file type)
(17.45 KiB) Downloaded 274 times
context-xfe.png
sample of context menu (.png file type)
(39.4 KiB) Downloaded 261 times
Last edited by `f00 on Wed 27 Mar 2013, 16:26, edited 1 time in total.

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#3 Post 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)
Attachments
image-2.jpg
(8.49 KiB) Downloaded 317 times
image-1.jpg
(12.64 KiB) Downloaded 323 times
image-3.jpg
(37.71 KiB) Downloaded 322 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#4 Post 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.

.

R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#5 Post 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.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#6 Post 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

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#7 Post 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
.
Attachments
hacked-xarchive.png
(46.83 KiB) Downloaded 285 times
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#8 Post 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

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#9 Post by disciple »

Does Puppy not include Pupzip (a wrapper for xarchive) anymore?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Post Reply