Very crude interface for clipboard sharing between sawfish and OS X
Very crude interface for clipboard sharing between sawfish and OS X
- Subject: Very crude interface for clipboard sharing between sawfish and OS X
- From: "Daniel M. German" <email@hidden>
- Date: Sun, 6 Jul 2003 15:14:58 -0700 (PDT)
I pieced the following sawfish module. It is a hack, but it works. you
need to download xcut from http://people.debian.org/~kims/xclip/
BTW, xcut, pbpaste, and pbcut are all you need to share the clipboard
between both environments.
Save the following into a file called osx-clipboard.jl, put in your
~/.sawfish/lisp directory. See instructions below.
----------------------------------------------------------------------
;;; osx-clipboard.jl v0.1 --- copy and paste between OS X and X11 clipboards
;; Copyright (C) 2003 Free Software Foundation, Inc.
;; Author: Daniel German <email@hidden>
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;
;;; Commentary:
;;
;; WARNING WARNING**********************************
;; Requires: xclip (available on freshmeat)
;; ************************************************
;;
;; This program provides a very simple solution to the fact that X11
;; and OSX clipboards are not shared
;;
;; In OSX two programs provide access to the clipboard: pbpaste and pbcut
;;
;; In X11, xclip (available from freshmeat) does the same
;;
;; These two sawfish functions execute the commands accordingly.
;; It is just a hack, but it works.
;;
;;
;; Usage:
;;
;; (require 'osx-clipboard-spell)
;; (bind-keys global-keymap
;; "F4" osx-clipboard-paste)
;; (bind-keys global-keymap
;; "F3" osx-clipboard-cut)
;;
;; Choose whichever keys you want. You can alternatively use sawfish-ui
;; to bind the keys
;;
;;; Code:
(defun osx-clipboard-copy ()
"Copy X selection to OS X Clipboard"
(interactive)
(system "xclip -o | pbcopy &")
)
(defun osx-clipboard-paste ()
"Copy OS X Clipboard to X selection. Once you run this command you
will need to 'paste' the selection into your application of choice."
(interactive)
(system "pbpaste | xclip -i &")
)
(provide 'sawfish-osx-clipboard)
;;; sawfish-spell.el ends here
----------------------------------------------------------------------
--
Daniel M. German "Reading the best writers is not
The Western Cannon, H. Bloom -> going to make us better citizens"
http://turingmachine.org/
email@hidden
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.