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 Sun 22 Oct 2017, 09:46
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Capture selected-files with key press in rox
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
arivas_2005

Joined: 25 Feb 2007
Posts: 189

PostPosted: Today, at 00:13    Post subject:  Capture selected-files with key press in rox  

regards
reading the pages

How to select files inside a ROX window by a bash script?
http://www.murga-linux.com/puppy/viewtopic.php?t=86079
picture: ROX-Filer_selection.png

Drag, drop and go
http://www.murga-linux.com/puppy/viewtopic.php?t=107816&start=30
pag 3, picture: drag-and-drop.png

I have the curiosity to try another way (with its support, of course!)
I want to capture the 'names selected' with a script launched by the F2 key

For example, using the figure : ROX-Filer_selection.png
a) to capture them with right click use in script I use listfiles = @
b) with drag-drop - I use a variable (F.E. "${DROP_ZONE// \//\n/}" in drag&drop)
c) with control + c, I can use something with xdotool key
but, ??
how do I capture it with a script launched with a key F2 (assigned to F2 key)?
-- how to detect the files that are selected in rox with the script (launch pressed F2 key) --

Thanks you
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1370
Location: Japan

PostPosted: Today, at 02:26    Post subject:  

Try
Code:
#!/bin/bash
SRC=$(xclip -o)        # Assign names (full paths) of selected files to variable
SRC=${SRC// \//$'\n'/} # Put every file name on new line
Xdialog -left -backtitle "You selected:" -msg "$SRC" x
The script requires xclip to be installed. It's included in most Puppies, some use xsel which in this case uses same syntax.
I assume that you know how to assign a keyboard shortcut to scripts, so I don't explain it here but I strongly recommend not to use F2 or any other function key.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 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.0257s ][ Queries: 11 (0.0048s) ][ GZIP on ]