Active Topics

 


Reply
Thread Tools
lostinmirkwood's Avatar
Posts: 128 | Thanked: 232 times | Joined on Sep 2009 @ New Jersey, USA
#1
Is there a way to set the current n900 clipboard (copy/paste) through an ssh session?


A little further explanation, I make a lot of use of ssh sessions to my device and quite often I'd like to send some text (a link , get to a web page, etc.) that I have running on my laptop to use it in conversations or browser.

Is there a specific file where the clipboard resides that I can overwrite? or is this solely in memory?
 
Posts: 324 | Thanked: 371 times | Joined on Dec 2009 @ Vancouver, BC
#2
You can try the following bit of code. Copy this to a file (for example copy_clipboard.py), and run it like:
Code:
python copy_clipboard.py "This will be copied to the clipboard"
Code:
import gtk
import sys

arg = sys.argv[1]

def receive(clipboard, text, data):
    gtk.main_quit()

clip = gtk.clipboard_get()
clip.request_text(receive)
clip.set_text(arg)

gtk.main()
 

The Following 4 Users Say Thank You to Slocan For This Useful Post:
lostinmirkwood's Avatar
Posts: 128 | Thanked: 232 times | Joined on Sep 2009 @ New Jersey, USA
#3
wow, that felt good and worked perfectly.
I'm learning python but don't know the ins-and-outs GTK yet.

Thank you, Slocan.
 
Reply


 
Forum Jump


All times are GMT. The time now is 07:35.