10-07-2012, 03:50 PM | #1 |
Junior Member
Posts: 1
Karma: 6666
Join Date: Oct 2012
Device: Kindle3 3Ggb
|
Copy & Paste
Hi,
I've been lurking around on this forum for about a month now, trying out various hacks and having a good deal of fun pimping my Kindle 3. So I thought it was about time I developed some ideas of my own and posted them. Copy and Paste functionality is something that I often wish the Kindle had so I decided to have an initial stab at putting something together this afternoon. It can no doubt be improved but I think it's usable enough to be worthwhile sharing what I have so far. Installation Copy and paste the texts below into a text editor and save them somewhere on the Kindle. In my examples I'll assume that you put them somewhere on the system path and chmoded the two shell scripts to make them executable (if necessary). (I have /mnt/us/system on my path and put my shell scripts in there.) Usage Copying and Pasting One Piece of Text at a Time To copy a single piece of text: Use the Kindle's highlighting feature to highlight the text that you wish to copy. The last highlight or bookmark created is the text in the "clipboard". To append the contents of the "clipboard" onto a file (pre-existing or not) called foo.txt in the Kindle's documents directory type the following in a terminal window: paste2doc.sh foo To paste just the highlighted text without the citation information: paste2doc.sh -o foo To paste the contents of the "clipboard" into a KindleNote document called foo: paste2doc.sh -n foo Batch Copying and Pasting To begin copying a batch of items at once, run: startcopy.sh and then highlight all the pieces of text that you want to copy. To paste all of the items in the batch at once: paste2doc.sh -m foo or, paste2doc.sh -n -m foo Practical Usage Set up launchpad commands for pasting into your favourite documents (todo list, shopping list, whatever). Source Code paste2doc.sh (Unix line endings): Code:
#!/bin/sh if [ "$1" == '-n' ] ; then PASTE_DIR=/mnt/us/developer/KindleNote/work shift else PASTE_DIR=/mnt/us/documents fi if [ "$1" == '-m' ] ; then BEGIN_LINE=`grep -n <'/mnt/us/documents/My Clippings.txt' '^___BEGIN_COPY_AND_PASTE___' | tail -n 1 | cut -d: -f1` BEGIN_LINE=$((BEGIN_LINE+5)) shift else BEGIN_LINE=`grep -n <'/mnt/us/documents/My Clippings.txt' '^==========' | tail -n 2 | head -n 1 | cut -d: -f1` BEGIN_LINE=$((BEGIN_LINE+1)) if [ "$1" == '-o' ] ; then CITATION=no shift fi fi if [ "$1" == '-n' ] ; then PASTE_DIR=/mnt/us/developer/KindleNote/work shift fi if [ "$1" == '' ] ; then echo >&2 "Usage $0 [-n] [-m|-o] memoname" exit 1 fi if [ "$PASTE_DIR" == '/mnt/us/documents' -a ! -e "/mnt/us/documents/$1.txt" ] ; then REFRESH=yes fi if [ "$CITATION" == 'no' ] ; then BEGIN_LINE=$((BEGIN_LINE+3)) tail '/mnt/us/documents/My Clippings.txt' -n +$BEGIN_LINE | grep -v '^==========' >>"$PASTE_DIR/$1.txt" else tail '/mnt/us/documents/My Clippings.txt' -n +$BEGIN_LINE >>"$PASTE_DIR/$1.txt" fi if [ "$REFRESH" == 'yes' ] ; then dbus-send --system /default com.lab126.powerd.resuming int32:1 fi Code:
#!/bin/sh cat >>'/mnt/us/documents/My Clippings.txt' `dirname $0`/startcopy.txt Code:
___BEGIN_COPY_AND_PASTE___ - Bookmark Loc. 1 | Added on Monday, November 19, 2007, 07:30 AM ==========
|
10-07-2012, 04:00 PM | #2 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
10-07-2012, 04:15 PM | #3 |
Zealot
Posts: 124
Karma: 178472
Join Date: Jul 2012
Device: Kindle 4
|
welcome thanks for sharing!
|
10-07-2012, 04:39 PM | #4 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
top banana
would be a good idea with the unix filesystem and all.
a real pain accessing files with spaces in, in the main. other than that. top banana Elizabeth I personally Use Cntrl + C , Cntrl + v via vnc which works surprisingly in the main. Obviously that does not work for all cases : ) Appreciate you sharing your source. |
10-07-2012, 04:41 PM | #5 |
Official Lurker
Posts: 1,050
Karma: 7096675
Join Date: Apr 2012
Device: Kindle 3.4
|
Thanks! +3000 Karma for you!
|
10-08-2012, 01:23 AM | #6 |
e-bookworm
Posts: 86
Karma: 630090
Join Date: Sep 2012
Device: PW2, K3, KF2, Touch (dying)
|
|
10-08-2012, 07:00 AM | #7 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
yep. TAB is your friend.
|
10-08-2012, 07:28 AM | #8 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Any character, except the one having a byte value representation of 0 (zero) may be used, but (mis-)using the input field separator characters (space, tab, new-line) is consider at the very least "bad form". The (mis-)using of characters that are assigned a special purpose in any language, natural or other, in the place of the general purpose characters should only be done when no alternative is available. Last edited by knc1; 10-08-2012 at 08:02 AM. |
|
10-08-2012, 07:54 AM | #9 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
spaces are bad. m'kay???
|
10-08-2012, 08:02 AM | #10 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
10-08-2012, 08:36 AM | #11 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
This took far too long to do... (I suck at unix image tools)
but I meant... enc... (I'm particularly proud of the terrible text overlay, shameful!) Last edited by twobob; 10-08-2012 at 08:37 AM. Reason: the shame |
10-08-2012, 10:09 AM | #12 |
Official Lurker
Posts: 1,050
Karma: 7096675
Join Date: Apr 2012
Device: Kindle 3.4
|
Hahaha I love it! (its better than anything I could ever do, i have no artistic talent.)
|
10-09-2012, 01:00 AM | #13 |
e-bookworm
Posts: 86
Karma: 630090
Join Date: Sep 2012
Device: PW2, K3, KF2, Touch (dying)
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copy and Paste | JDavid | Sigil | 4 | 08-23-2012 04:02 PM |
Copy Paste | giosa | Sony Reader Dev Corner | 0 | 03-24-2012 06:17 PM |
iBooks: No Support for Selection & Copy/Paste Operations of SVG Texts on EPUB | reuben | ePub | 2 | 09-22-2010 08:06 AM |
Copy and Paste | Gunnerp245 | enTourage eDGe | 1 | 04-03-2010 02:45 PM |