pastey paste

Oh yes. This currently rocks my world. (YMMV, of course.)

Place the following in a shell script:

xclip -o | xclip -i -selection secondary
echo -n "http://www.srcf.ucam.org/~hmw26/" | xclip
xsendkeys Shift_L+Insert
xclip -o -selection secondary | xclip -i

and run tpb -t “/bin/sh $PATH_TO_SCRIPT”.

My “Access IBM” key now pastes http://www.srcf.ucam.org/~hmw26/ into the window currently in focus. No more typing my URL into IRC, email etc. everytime I upload something. Kick ass.

6 Responses to “pastey paste”

  1. segphault Says:

    Very clever! I’ll have to remember that xsendkeys command, I’ve never seen that used before.

  2. Karl Says:

    Neat. But I’ll keep mine ifuping eth1. Not only is it useful, it might actually be accessing IBM. If, er, I’m ever allowed on the wireless network at some IBM site. Which may or may not ever happen.

  3. Bill Says:

    hanna is a bananah weenie

  4. Kevin Says:

    Hi Hanna, I also found xclip helpful when I needed to get a clipboard entry from X into a vim session on the console. Yea for xclip!

  5. Ilian Says:

    Cute and useful! Thanks.

  6. Iain Says:

    Coincidentally I was also playing with my keyboard setup this week. I discovered the Mode_switch keysym, which can be mapped using xmodmap. This allows you to add an extra two characters to most keys. Now some diacritics and special characters are easier for me to type: àäáçèëéïöü®ß§¡¿µ–—«»·‘’“” :-).

Leave a Reply