Author |
Message |
R-S-H
Joined: 18 Feb 2013 Posts: 490
|
Posted: 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
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 917
|
Posted: 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
|
|
 |
R-S-H
Joined: 18 Feb 2013 Posts: 490
|
Posted: 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
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 917
|
Posted: 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
|
|
 |
Rattlehead

Joined: 11 Sep 2008 Posts: 367
|
Posted: 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
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
|
|
 |
amigo
Joined: 02 Apr 2007 Posts: 2641
|
Posted: 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
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5087 Location: Arizona, U.S.A.
|
Posted: 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
|
|
 |
nilsonmorales

Joined: 15 Apr 2011 Posts: 938 Location: El Salvador
|
Posted: 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
|
|
 |
tallboy

Joined: 21 Sep 2010 Posts: 907 Location: Oslo, Norway
|
Posted: 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!
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
|
|
 |
musher0

Joined: 04 Jan 2009 Posts: 12097 Location: Gatineau (Qc), Canada
|
Posted: 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. Good luck!
musher0
_________________ musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
|
Back to top
|
|
 |
R-S-H
Joined: 18 Feb 2013 Posts: 490
|
Posted: 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
Description |
|
Filesize |
108.5 KB |
Viewed |
515 Time(s) |

|
_________________ LazY Puppy Home
The new LazY Puppy Information Centre
|
Back to top
|
|
 |
tallboy

Joined: 21 Sep 2010 Posts: 907 Location: Oslo, Norway
|
Posted: 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
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 1503 Location: Japan
|
Posted: Sat 03 Sep 2016, 23:16 Post subject:
|
|
I know, it's an old thread, but it's not yet solved so I hope it's OK to give it a shot.
The challege - as I understand it - is to select files in a ROX-Filer window programmatically.
R-S-H wrote: | The files are listed in a text file | OK, that's clear.
Quote: | I just need to either deselect a few files manually or to add a few files to this selection manually. | Less clear, but probably not relevant. I guess that this is something you want to do after your script selected the files
Quote: | I've already thought about any use of xdotool for this | I can't think of anything else. ROX itself provides no way to select/deselect files programmatically.
Quote: | but can't see any solution how to tell xdotool to select a specific file in a ROX filer window. | See below. This works for me.
The script reads file paths from a text file (each file path there on a separate line), then opens a ROX window and selects these files. I hope that this is what you asked for.
Code: | #! /bin/bash
FILES="/tmp/01TEST
/tmp/abTEST
/tmp/cdeTEST"
touch $FILES # Create some test files
LIST="/tmp/00_filelist.txt" # Assign variable LIST
echo "$FILES" > "$LIST" # Write file paths to file LIST
FIRSTFILE=$(head -n1 "$LIST") # Retrieve first file path in LIST
rox -s "$FIRSTFILE" # Open ROX-Filer with FIRSTFILE activated (but not yet selected)
xdotool key question # Shortcut '?' opens the 'Select If' entry field
xdotool type "system(grep \"%\" \"$LIST\")" # Define grep command
xdotool key Return # Run command. ROX selects all files matched in grep command | Please note that the ROX-Filer system command may be named differently, depending on locale. Use the little help button, left of 'Select If', to check the appropriate syntax.
Description |
|
Filesize |
34.31 KB |
Viewed |
284 Time(s) |

|
Last edited by MochiMoppel on Wed 18 Oct 2017, 22:33; edited 1 time in total
|
Back to top
|
|
 |
arivas_2005
Joined: 25 Feb 2007 Posts: 191
|
Posted: Sun 15 Oct 2017, 23:34 Post subject:
|
|
Hello
I need filter many files
Rattlehead wrote: | 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
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 |
I found this but it does not work for me
( nothing happens when you press space or wiht enter always comes the list of sfs)
I need to filter only txt or jpg etc
|
Back to top
|
|
 |
arivas_2005
Joined: 25 Feb 2007 Posts: 191
|
Posted: Mon 16 Oct 2017, 21:29 Post subject:
|
|
Shift+/ is shortkey of 'goto' command.
that's why I did not get the result
I proceeded to create a shortkey for option
right click, display, filter files whit Shift + 8 and
ready. Its Works!
need met!
|
Back to top
|
|
 |
|