Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Sep 2014, 03:58
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to select files inside a ROX window by a bash script?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Wed 08 May 2013, 22:25    Post subject:  How to select files inside a ROX window by a bash script?  

Hi,

I want to select different files (sorted in a predefined list) shown in a previous opened ROX filer window from within a bash script.

Is this possible, and how?

Thanks,

RSH

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Thu 09 May 2013, 11:12    Post subject:  

R-S-H,

I haven't tried this but perhaps something could be done with the SOAP feature of rox.

http://rox.sourceforge.net/Manual/Manual/Manual.html#soap

Maybe this part - "Copy(From, To, [Leafname, Quiet]) Copy each file in the array From to the directory To........"

Regards,
s
Back to top
View user's profile Send private message 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Thu 09 May 2013, 17:59    Post subject:  

Hi seaside.

Yeah, I've found already an example for this in a script of your SFS-Exec (the script that opens ROX filer showing only the SFS files in SFS directory)

Option 'Filter' or ?'Filters'? unfortunately seems not to be able to filter a list of files (except *.sfs etc. - but that would show all of the .sfs files).

I thought about to filter about 35 files from a directory that contains about 800 files. Would have been nice to get a ROX filer window opened with an preselected selection of different files.

However, thanks for your reply to this.

RSH

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Thu 09 May 2013, 20:02    Post subject:  

R-S-H,

I'm not exactly sure what you have in mind. A group of user-selected files or preselected? At any rate, one more idea-

Perhaps you could us bash/find to select and copy files to NEWDIR directory and then open it "rox -d NEWDIR".

Regards,
s
Back to top
View user's profile Send private message 
Rattlehead


Joined: 11 Sep 2008
Posts: 214
Location: Madrid, Spain

PostPosted: Thu 09 May 2013, 20:20    Post subject:  

Not the neatest way to do it, but you could also 'robotize' the whole process with Xdotool, making a loop that goes

pick first item on the list
keypress / in Rox
type the file name
keypress / again
keypress space
(end of loop)

The whole selection process will then happen 'in your face', which can be regarded as lame or sci-fi-like, depending on the situation I guess Confused

Also, it depends on the number files you usually want to select. The typing is not instant, so if the amount is big...

Just an idea
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2247

PostPosted: Fri 10 May 2013, 12:45    Post subject:  

Don't mix cli and gui together -what you propose is a bad idea. Just use nice shell to do what you want...
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5029
Location: Arizona, U.S.A.

PostPosted: Fri 10 May 2013, 14:46    Post subject:  

Trying to get info. from GUI`s that aren`t designed for it is pointless.
Geany, rxvt, GtkDialog, etc. With rxvt you can redirect some output to a file.
You can`t scrape Geany`s edit box for text, you can only read it`s files.
But if Geany`s file is not saved... Then the file`s not up to date.
Back to top
View user's profile Send private message 
nilsonmorales


Joined: 15 Apr 2011
Posts: 485
Location: El salvador

PostPosted: Fri 10 May 2013, 18:00    Post subject:  

http://hatteras.wordpress.com/2010/02/02/copiar-o-mover-un-archivo-a-cualquier-directorio-con-un-script/ maybe give a clue
Back to top
View user's profile Send private message MSN Messenger 
tallboy


Joined: 21 Sep 2010
Posts: 442
Location: Oslo, Norway

PostPosted: Sat 11 May 2013, 14:13    Post subject:  

R-S-H wrote:
...shown in a previous opened ROX filer window

Hmm. I am not sure if I interpret your wish correctly, but I think this can be done with an ordinary redirection command in Linux.

If you open /root/my-documents/ , and then make a text-file and save it to my-documents, it will be visible at once in the open window.

In a script, you can redirect the files you find with 'grep', 'find' or whatever technique you use, with:
Code:
find files | mv /root/my-documents


Test it with this command in a terminal:
Code:
touch 1.txt 2.txt 3.txt | mv my-documents

The mv -t or --target-directory option can be used:
Code:
touch 1.txt 2.txt 3.txt | mv --target-directory=my-documents

See mv --help for options.

Sorry if I misunderstand completely, then we just try again! Very Happy

THIS IS NOT WORKING WITH THE CODE SUPPLIED; REGARD IT AS INSPIRATION ONLY!

tallboy

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4236
Location: Gatineau (Qc), Canada

PostPosted: Sat 11 May 2013, 15:01    Post subject: Re: How to select files inside a ROX window by a bash script?  

R-S-H wrote:
Hi,

I want to select different files (sorted in a predefined list) shown in a previous opened ROX filer window from within a bash script.

Is this possible, and how?

Thanks,

RSH


Hi, R-S-H.

Maybe you will find some leads in the ROX manual, chapters 10 and 14, and also Annex C. Those parts of the ROX manual focus on searching and displaying, and how to script ROX directly (Annex C).

Your project is a little vague in my mind, but a "previous opened ROX filer window" is a directory, no? Same as
ls <directory>.
So maybe you can forget ROX and do it with ls ?
(Depending on what you want to do, fo course)

Something like
ls [directory]/[flag_for_search] > list.lst
then do something with the list with the
for...do command ? (copy, display or link, etc.)

The full less utility can be handy because it has the ![command] function from the display.

Just my 2 cents. Smile Good luck!

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 11 May 2013, 22:24    Post subject:  

Hi.

Thanks for all the replies.

Since a picture is telling more than a 1000 words - this how the ROX filer window should look like, when opened by a script (as an example).

The files are listed in a text file. I just need to either deselect a few files manually or to add a few files to this selection manually.

I've already thought about any use of xdotool for this, but can't see any solution how to tell xdotool to select a specific file in a ROX filer window.

RSH
image-3.jpg
 Description   
 Filesize   108.5 KB
 Viewed   169 Time(s)

image-3.jpg


_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 442
Location: Oslo, Norway

PostPosted: Sat 11 May 2013, 22:39    Post subject:  

BTW, the Linux commands available in puppy, are not the full versions, but limited versions from Busybox. It is possible that a perfectly valid Linux command string will not give the intended results, when used in puppy.

For a full set, you must download and install 'coreutils', but be prepared for some strange results if the old commands are not completely removed. Busybox (or maybe X) may crash.

Take a look at this link for some versions of code:
http://www.cyberciti.biz/tips/howto-linux-unix-find-move-all-mp3-file.html

tallboy

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0763s ][ Queries: 13 (0.0078s) ][ GZIP on ]