Results 1 to 10 of 10

Thread: Paste text strings with hotkeys

  1. #1
    Join Date
    Feb 2010
    Beans
    4

    Paste text strings with hotkeys

    Hey folks, some time ago, I developed an easy way to put commonly used strings of text into my clip board to be pasted into emails and such. I thought it might be helpful to some of you folks who get tired typing the same URL, etc. over and over again. I figured it out thanks to some other posts of a similar nature here.

    I first created a script of file name "pasties" in my home directory:

    #!/bin/bash
    TEXTARR[0]="http://www.flickr.com/photos/playful_geometer/"
    TEXTARR[1]="http://sites.google.com/site/cosmicspacecrafts/"
    TEXTARR[2]="http://playful-geometer.deviantart.com/"
    TEXTARR[3]="http://www.openprocessing.org/portal/?userID=4655"
    TEXTARR[4]="http://www.facebook.com/group.php?gid=150658771621486"
    TEXTARR[5]="http://cosmic-spacecrafts.blogspot.com"
    echo ${TEXTARR[$1]} | xclip -selection "clipboard"
    Then in System->Preferences->Compiz->Commands I created a series of shortcuts i.e. Shift+Ctrl+F1 : ./pasties 0.

    So now I can press that hotkey and the first link will go into my cllip board to be pasted. It would be great if Glipper could do something like that for those who aren't so geeky though.

    Take a look at my digital art in the links above if you will. I owe it all to Open Source software !

    Cheers,
    ~The Playful Geometer~

  2. #2
    Join Date
    Nov 2010
    Location
    In front of my computer?
    Beans
    209
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Paste text strings with hotkeys

    That's.... pretty cool.

    I'm saving this, do you mind? I'll only use it for framework.
    Imitation is suicide...To be great is to be misunderstood.

    ~Ralph Waldo Emerson

  3. #3
    Join Date
    Feb 2010
    Beans
    4

    Re: Paste text strings with hotkeys

    Shared in the spirit of Software Freedom

  4. #4
    Join Date
    Mar 2011
    Location
    Vancouver, WA
    Beans
    14
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Paste text strings with hotkeys

    Hey thanks for the nice trick!

    The only thing I'd like to add to this is a way to have have the text get pasted immediately to the cursor's location. If I find a way to do it elegantly I'll post it!

  5. #5
    Join Date
    Feb 2008
    Location
    Mine goes to 11
    Beans
    3,754

    Re: Paste text strings with hotkeys

    Quote Originally Posted by playful_geometer View Post
    Take a look at my digital art in the links ...
    +2, 1 for Mad Art and 1 for a Mad script.

    Edit: and what a difference 727 days makes
    Last edited by Habitual; August 15th, 2012 at 02:29 AM.
    Earache, my eye.

  6. #6
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    822
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Paste text strings with hotkeys

    Quote Originally Posted by playful_geometer View Post
    Hey folks, some time ago, I developed an easy way to put commonly used strings of text into my clip board to be pasted into emails and such. I thought it might be helpful to some of you folks who get tired typing the same URL, etc. over and over again. I figured it out thanks to some other posts of a similar nature here.

    I first created a script of file name "pasties" in my home directory:

    Then in System->Preferences->Compiz->Commands I created a series of shortcuts i.e. Shift+Ctrl+F1 : ./pasties 0.

    So now I can press that hotkey and the first link will go into my cllip board to be pasted. It would be great if Glipper could do something like that for those who aren't so geeky though.

    Take a look at my digital art in the links above if you will. I owe it all to Open Source software !

    Cheers,
    ~The Playful Geometer~
    This is pretty cool, bummer that I can't seem to get it to work.
    I tried the commands as you have them.
    Code:
    ./pasties 0
    and I also put a copy of the script in my preferred folder which is called scripts (~/scripts).
    I tried running the commands with the script there and changing the command in Compiz to both:
    Code:
    ~/scripts/pasties 0
    and
    Code:
    home/john/pasties 0
    but I can't copy the url from the pasties script by pressing the keys I assigned.
    Last edited by GrouchyGaijin; January 10th, 2013 at 10:31 AM. Reason: [code] bracket was missing
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

  7. #7
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Paste text strings with hotkeys

    Works here with ~/scripts/pasties 0 as the command.
    Make sure the script is executable and you have xclip installed.

    Glipper now has a snippets plugin where you can add often used phrases.
    Attached Images Attached Images
    Last edited by stinkeye; January 10th, 2013 at 01:06 PM.

  8. #8
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    822
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Paste text strings with hotkeys

    Quote Originally Posted by stinkeye View Post
    Make sure the script is executable and you have xclip installed.
    Dou!!
    I works so much better if you have all the components installed.
    My mistake
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

  9. #9
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Paste text strings with hotkeys

    Quote Originally Posted by GrouchyGaijin View Post
    Dou!!
    I works so much better if you have all the components installed.
    My mistake
    .

  10. #10
    Join Date
    Dec 2012
    Beans
    8

    Re: Paste text strings with hotkeys

    Is there any Text Editor which has a built-in clipboard monitor? Instead of using a clip manager. In Windows, there is Editplus, Exdor etc. I use autocopy add-on in Firefox and keep the clipboard monitor on in the Text editor. So I just need to keep selecting text in the browser, and it keeps pasting in the background on my Text editor. I can edit the text anytime, put separators, dates, add text etc in the Text Editor every once in a while. Would love to see such a feature in some Text Editor in Ubuntu.
    Last edited by avsprasad; January 14th, 2013 at 06:53 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •