<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jwsh</id>
	<title>WebOS Internals - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jwsh"/>
	<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/wiki/Special:Contributions/Jwsh"/>
	<updated>2026-04-16T11:41:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Changing_Clipboard_Data_From_The_Shell&amp;diff=5661</id>
		<title>Changing Clipboard Data From The Shell</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Changing_Clipboard_Data_From_The_Shell&amp;diff=5661"/>
		<updated>2009-09-11T16:33:25Z</updated>

		<summary type="html">&lt;p&gt;Jwsh: Version 1.1.0 - use simpler and more reliable get/put functions to update the clipboard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Changing Clipboard Data From The Shell ==&lt;br /&gt;
&lt;br /&gt;
When you use the copy and paste function on your Pre the string has to go somewhere. Right? Well, from what I learned from '''tharris''' which was that the string goes to a file called '''webkit-clipboard''' which is located in the '''/tmp''' directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Manual Steps ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step One:''' Access the Linux portion of your Pre&lt;br /&gt;
&lt;br /&gt;
'''Step Two:''' Edit your clipboard file '''(you need to at least copy and paste something once for the file to show up)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vi /tmp/webkit-clipboard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Step Three:''' Save it.&lt;br /&gt;
&lt;br /&gt;
'''Tip:''' for more info on how to use vi, remember Google is your friend...&lt;br /&gt;
&lt;br /&gt;
By: JRG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== WebOS Clipboard Buddy ==&lt;br /&gt;
&lt;br /&gt;
'''WebOS Clipboard Buddy''' is a very simple pyGTK app that allows you to easily copy data between your desktop's clipboard and the Pre's clipboard. Feel free to improve upon it. Currently this is Linux only, though it should be trivial to get working under windows. It currently requires that you have the SDK installed (specifically that novacom is functional and available at /usr/local/bin/novacom/novacom).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
# Copyright (c) 2009 James Hines&lt;br /&gt;
&lt;br /&gt;
# Permission is hereby granted, free of charge, to any person&lt;br /&gt;
# obtaining a copy of this software and associated documentation&lt;br /&gt;
# files (the &amp;quot;Software&amp;quot;), to deal in the Software without&lt;br /&gt;
# restriction, including without limitation the rights to use,&lt;br /&gt;
# copy, modify, merge, publish, distribute, sublicense, and/or sell&lt;br /&gt;
# copies of the Software, and to permit persons to whom the&lt;br /&gt;
# Software is furnished to do so, subject to the following&lt;br /&gt;
# conditions:&lt;br /&gt;
&lt;br /&gt;
# The above copyright notice and this permission notice shall be&lt;br /&gt;
# included in all copies or substantial portions of the Software.&lt;br /&gt;
&lt;br /&gt;
# THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND,&lt;br /&gt;
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES&lt;br /&gt;
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND&lt;br /&gt;
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT&lt;br /&gt;
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,&lt;br /&gt;
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING&lt;br /&gt;
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR&lt;br /&gt;
# OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
import gtk&lt;br /&gt;
import pygtk&lt;br /&gt;
import commands&lt;br /&gt;
from subprocess import *&lt;br /&gt;
&lt;br /&gt;
DEBUG=True&lt;br /&gt;
&lt;br /&gt;
def quit_cb(widget, data = None):&lt;br /&gt;
    if data:&lt;br /&gt;
        data.set_visible(False)&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
        &lt;br /&gt;
def popup_menu_cb(widget, button, time, data = None):&lt;br /&gt;
    if button == 3:&lt;br /&gt;
        if data:&lt;br /&gt;
            data.show_all()&lt;br /&gt;
            data.popup(None, None, None, 3, time)&lt;br /&gt;
            pass&lt;br /&gt;
&lt;br /&gt;
def pre_to_clipboard_cb(widget):&lt;br /&gt;
    clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)&lt;br /&gt;
    result = commands.getstatusoutput('/usr/local/bin/novacom/novacom get file:///tmp/webkit-clipboard')&lt;br /&gt;
    if DEBUG:&lt;br /&gt;
        print result&lt;br /&gt;
    text = result[1]&lt;br /&gt;
    clipboard.set_text(text)&lt;br /&gt;
&lt;br /&gt;
def clipboard_to_pre_cb(widget):&lt;br /&gt;
    clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)&lt;br /&gt;
    clipboard.request_text(push_to_pre)&lt;br /&gt;
&lt;br /&gt;
def push_to_pre(clipboard, text, data):&lt;br /&gt;
    pre = Popen([&amp;quot;/usr/local/bin/novacom/novacom&amp;quot;, &amp;quot;put&amp;quot;, &amp;quot;file:///tmp/webkit-clipboard&amp;quot;], stdin=PIPE, stdout=PIPE)&lt;br /&gt;
    pre_output = pre.communicate(text)&lt;br /&gt;
    if DEBUG:&lt;br /&gt;
        print pre_output&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
def about_icon_cb(widget, data = None):&lt;br /&gt;
    msgBox = gtk.MessageDialog(parent = None, buttons = gtk.BUTTONS_OK, message_format = &amp;quot;WebOS Clipboard Agent\nVersion 1.1.0\nCopyright 2009, James Hines.&amp;quot;)&lt;br /&gt;
    msgBox.run()&lt;br /&gt;
    msgBox.destroy()&lt;br /&gt;
    &lt;br /&gt;
statusIcon = gtk.StatusIcon()&lt;br /&gt;
    &lt;br /&gt;
menu = gtk.Menu()&lt;br /&gt;
menuItem = gtk.MenuItem(label = &amp;quot;Copy from Pre&amp;quot;)&lt;br /&gt;
menuItem.connect('activate', pre_to_clipboard_cb)&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
menuItem = gtk.MenuItem(label = &amp;quot;Copy to Pre&amp;quot;)&lt;br /&gt;
menuItem.connect('activate', clipboard_to_pre_cb)&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
menuItem = gtk.SeparatorMenuItem()&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
menuItem = gtk.ImageMenuItem(gtk.STOCK_ABOUT)&lt;br /&gt;
menuItem.connect('activate', about_icon_cb)&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT)&lt;br /&gt;
menuItem.connect('activate', quit_cb, statusIcon)&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
    &lt;br /&gt;
statusIcon.set_from_stock(gtk.STOCK_PASTE)&lt;br /&gt;
statusIcon.set_tooltip(&amp;quot;WebOS Clipboard Agent&amp;quot;)&lt;br /&gt;
statusIcon.connect('popup-menu', popup_menu_cb, menu)&lt;br /&gt;
statusIcon.set_visible(True)&lt;br /&gt;
    &lt;br /&gt;
gtk.main()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwsh</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Talk:Changing_Clipboard_Data_From_The_Shell&amp;diff=5216</id>
		<title>Talk:Changing Clipboard Data From The Shell</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Talk:Changing_Clipboard_Data_From_The_Shell&amp;diff=5216"/>
		<updated>2009-09-03T18:19:15Z</updated>

		<summary type="html">&lt;p&gt;Jwsh: New page: I just added '''WebOS Clipboard Buddy''' directly to this page, if someone wants to put it into an appropriate code repository, that's fine by me. I tried to upload it instead of dumping t...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I just added '''WebOS Clipboard Buddy''' directly to this page, if someone wants to put it into an appropriate code repository, that's fine by me. I tried to upload it instead of dumping the code directly in, but .py attachments were not allowed.&lt;/div&gt;</summary>
		<author><name>Jwsh</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Changing_Clipboard_Data_From_The_Shell&amp;diff=5215</id>
		<title>Changing Clipboard Data From The Shell</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Changing_Clipboard_Data_From_The_Shell&amp;diff=5215"/>
		<updated>2009-09-03T18:17:39Z</updated>

		<summary type="html">&lt;p&gt;Jwsh: Added WebOS Clipboard Buddy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Changing Clipboard Data From The Shell ==&lt;br /&gt;
&lt;br /&gt;
When you use the copy and paste function on your Pre the string has to go somewhere. Right? Well, from what I learned from '''tharris''' which was that the string goes to a file called '''webkit-clipboard''' which is located in the '''/tmp''' directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Manual Steps ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step One:''' Access the Linux portion of your Pre&lt;br /&gt;
&lt;br /&gt;
'''Step Two:''' Edit your clipboard file '''(you need to at least copy and paste something once for the file to show up)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vi /tmp/webkit-clipboard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Step Three:''' Save it.&lt;br /&gt;
&lt;br /&gt;
'''Tip:''' for more info on how to use vi, remember Google is your friend...&lt;br /&gt;
&lt;br /&gt;
By: JRG&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== WebOS Clipboard Buddy ==&lt;br /&gt;
&lt;br /&gt;
'''WebOS Clipboard Buddy''' is a very simple pyGTK app that allows you to easily copy data between your desktop's clipboard and the Pre's clipboard. Feel free to improve upon it. Currently this is Linux only, though it should be trivial to get working under windows. It currently requires that you have the SDK installed (specifically that novacom is functional and available at /usr/local/bin/novacom/novacom).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
# Copyright (c) 2009 James Hines&lt;br /&gt;
&lt;br /&gt;
# Permission is hereby granted, free of charge, to any person&lt;br /&gt;
# obtaining a copy of this software and associated documentation&lt;br /&gt;
# files (the &amp;quot;Software&amp;quot;), to deal in the Software without&lt;br /&gt;
# restriction, including without limitation the rights to use,&lt;br /&gt;
# copy, modify, merge, publish, distribute, sublicense, and/or sell&lt;br /&gt;
# copies of the Software, and to permit persons to whom the&lt;br /&gt;
# Software is furnished to do so, subject to the following&lt;br /&gt;
# conditions:&lt;br /&gt;
&lt;br /&gt;
# The above copyright notice and this permission notice shall be&lt;br /&gt;
# included in all copies or substantial portions of the Software.&lt;br /&gt;
&lt;br /&gt;
# THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND,&lt;br /&gt;
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES&lt;br /&gt;
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND&lt;br /&gt;
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT&lt;br /&gt;
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,&lt;br /&gt;
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING&lt;br /&gt;
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR&lt;br /&gt;
# OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
import gtk&lt;br /&gt;
import pygtk&lt;br /&gt;
import commands&lt;br /&gt;
from subprocess import *&lt;br /&gt;
&lt;br /&gt;
def quit_cb(widget, data = None):&lt;br /&gt;
    if data:&lt;br /&gt;
        data.set_visible(False)&lt;br /&gt;
        gtk.main_quit()&lt;br /&gt;
        &lt;br /&gt;
def popup_menu_cb(widget, button, time, data = None):&lt;br /&gt;
    if button == 3:&lt;br /&gt;
        if data:&lt;br /&gt;
            data.show_all()&lt;br /&gt;
            data.popup(None, None, None, 3, time)&lt;br /&gt;
            pass&lt;br /&gt;
&lt;br /&gt;
def pre_to_clipboard_cb(widget):&lt;br /&gt;
    clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)&lt;br /&gt;
    result = commands.getstatusoutput('/bin/echo &amp;quot;cat /tmp/webkit-clipboard; exit&amp;quot; | /usr/local/bin/novacom/novacom open tty://0')&lt;br /&gt;
    text = result[1].split(&amp;quot;\n&amp;quot;, 1)[1].rstrip(&amp;quot;\r\n&amp;quot;)&lt;br /&gt;
    print text&lt;br /&gt;
    clipboard.set_text(text)&lt;br /&gt;
&lt;br /&gt;
def clipboard_to_pre_cb(widget):&lt;br /&gt;
    clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)&lt;br /&gt;
    clipboard.request_text(push_to_pre)&lt;br /&gt;
&lt;br /&gt;
def push_to_pre(clipboard, text, data):&lt;br /&gt;
    pre = Popen([&amp;quot;/usr/local/bin/novacom/novacom&amp;quot;, &amp;quot;-t&amp;quot;, &amp;quot;open&amp;quot;, &amp;quot;tty://0&amp;quot;], stdin=PIPE, stdout=PIPE)&lt;br /&gt;
    eof_marker = &amp;quot;CLIPBOARDEOFMARKER&amp;quot;&lt;br /&gt;
    pre_output = pre.communicate(&amp;quot;cat &amp;lt;&amp;lt;&amp;quot; + eof_marker + &amp;quot;&amp;gt; /tmp/webkit-clipboard\n&amp;quot; + text + &amp;quot;\n&amp;quot; + eof_marker + &amp;quot;\nexit\n&amp;quot;)&lt;br /&gt;
    print pre_output&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
def clipboard_cb(clipboard, text, data):&lt;br /&gt;
    print text&lt;br /&gt;
&lt;br /&gt;
def about_icon_cb(widget, data = None):&lt;br /&gt;
    msgBox = gtk.MessageDialog(parent = None, buttons = gtk.BUTTONS_OK, message_format = &amp;quot;WebOS Clipboard Agent\nVersion 1.0.0\nCopyright 2009, James Hines.&amp;quot;)&lt;br /&gt;
    msgBox.run()&lt;br /&gt;
    msgBox.destroy()&lt;br /&gt;
    &lt;br /&gt;
statusIcon = gtk.StatusIcon()&lt;br /&gt;
    &lt;br /&gt;
menu = gtk.Menu()&lt;br /&gt;
menuItem = gtk.MenuItem(label = &amp;quot;Copy from Pre&amp;quot;)&lt;br /&gt;
menuItem.connect('activate', pre_to_clipboard_cb)&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
menuItem = gtk.MenuItem(label = &amp;quot;Copy to Pre&amp;quot;)&lt;br /&gt;
menuItem.connect('activate', clipboard_to_pre_cb)&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
menuItem = gtk.SeparatorMenuItem()&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
menuItem = gtk.ImageMenuItem(gtk.STOCK_ABOUT)&lt;br /&gt;
menuItem.connect('activate', about_icon_cb)&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT)&lt;br /&gt;
menuItem.connect('activate', quit_cb, statusIcon)&lt;br /&gt;
menu.append(menuItem)&lt;br /&gt;
    &lt;br /&gt;
statusIcon.set_from_stock(gtk.STOCK_PASTE)&lt;br /&gt;
statusIcon.set_tooltip(&amp;quot;WebOS Clipboard Agent&amp;quot;)&lt;br /&gt;
statusIcon.connect('popup-menu', popup_menu_cb, menu)&lt;br /&gt;
statusIcon.set_visible(True)&lt;br /&gt;
    &lt;br /&gt;
gtk.main()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwsh</name></author>
	</entry>
</feed>