Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to run an app with clipboard link as a parameter
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Boshu
n00b
n00b


Joined: 27 Dec 2007
Posts: 22

PostPosted: Sun Feb 24, 2013 10:27 pm    Post subject: How to run an app with clipboard link as a parameter Reply with quote

Hi!

I'm looking for a way to do the following.
After I copy a link using ctrl-c, how do I start an application in a terminal with the link stored in the clipboard as a parameter.
Example:
I copy in clipboard the text '/home/audio.mp3'. When I run 'audacious $clipboard' in terminal, audacious would open the file with the link stored in the clipboard(/home/audio.mp3).
All I need is the variable that passes the clipboard content as a parameter(if there is such a variable). In my example the variable is $clipboard but obviously it doesn't work. :)

Bye!
_________________
Fujitsu Siemens Amilo La 1703
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Feb 25, 2013 12:09 am    Post subject: Reply with quote

Boshu ...

x11-misc/xclip ...

Code:
# echo $(xclip -o)
x11-misc/xclip

Similarly as per your example:

Code:
# audacious $(xclip -o)

The following works here (/bin/zsh)

Code:
$ alias xax='echo $(xclip -o)'
$ xax
hello
# change selection
$ xax
goodbye

HTH & best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
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