[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Dosemu, Linux, XyWrite -- another clipboard kludge
- Subject: Dosemu, Linux, XyWrite -- another clipboard kludge
- From: Paul Lagasse pglagasse@xxxxxxxx
- Date: Mon, 03 Dec 2007 23:27:31 -0500
In an attempt to avoid having to open a file to transfer text to/from
XyWrite in Linux, I have come up with with what I think is a somewhat
easier, more automated kludge for transfering text to and from the Linux
clipboard when running XyWrite under Dosemu. This works, at least, in my
Ubuntu installation. It does involve a more complicated one-time setup.
To start, in my keyboard file, I have two lines in my CTRL+ALT table
(keys k and v, respectively, as my c was taken years ago):
37=BX,(,s,a,s,/,n,v, ,\,c,l,i,p,.,t,x,t,)
47=BX,(,m,e, ,\,c,l,i,p,.,t,x,t,)
and I have the file "clip,txt" in my Ubuntu home directory (which under
Dosemu is d:\)
I also have installed xsel, a command-line program that can manipulate
the clipboard (see http://www.vergenet.net/~conrad/software/xsel/). I
used "sudo apt-get install xsel" at a terminal window to install xsel. I
found xsel after some googling.
I wrote two tiny script files; both were written with gedit. You should
note that these two "scripts" now bring my Linux total to two, and I am
basically mimicking what I have read in a manual or two. But they do work.
The first script is toxyclip.sh, and is in its five-line entirety:
#! /bin/bash
#
# copies clipboard contents to ~/clip.txt for XyWrite
#
xsel -b >~/clip.txt
The last line ends with a carriage return. "-b" directs xsel to act on
the clipboard.
The second script is tosysclip.sh. Its contents are
#! /bin/bash
#
# copies clipboard contents from XyWrite's ~/clip.txt to system clipboard
#
xsel -b <~/clip.txt
After writing and saving both scripts, I opened a terminal window and
made the scripts executable by issuing the commands:
chmod u+x toxyclip.sh
chmod u+x tosysclip.sh
I exited the terminal, and rightclicked the desktop and chose "Create
launcher."
In the Create Launcher window, the "Type" is Application, for the
"Command" I browsed for tosysclip.sh, and for the "Name" I entered "To
System Clipboard". For toxyclip.sh, I named it "To XyWrite Clipboard." I
put both completed launchers on the desktop down in one corner so they
would be visible when running XyWrite in a Dosemu window.
To clip to the system, I highlight the text in XyWrite, hit ctrl+alt+k
twice (yes, twice, for some unknown reason: see below), and doubleclick
the "To System Clipboard" icon on my desktop. Then I can use ctrl+v to
insert the text (the Kludge Cargo, if you will) into an editor in Ubuntu.
To clip from say "Firefox," I highlight the text, do ctrl+c, then
doubleclick "To Xywrite Clipboard," and then do ctrl+alt+v to insert the
text in XyWrite.
You save time by having xsel write to and from clip.txt. You don't to
wait for gedit to open clip.txt, don't have to paste the clipboard
contents into clip.txt, and don't have to save clip.txt. All that is
replaced with two mouseclicks (two in my case; maybe just one click for
you).
The carriage return/line feed issue can mess with the text. **And for
some reason I have trouble copying from XyWrite to "clip.txt" using
ctrl+alt+k, and have to hit it twice (the first time I hit it, Dosemu
adds "keyboard grab" to its title bar, the second time I hit it, XyWrite
notes "Done." I seem to have no trouble inserting text into a XyWrite
file, except for the carriage return/line feed issue.
Paul