How to create a shortcut to copy a password to clipboard (so to be ready to be pasted)


Have you ever dreamed to have one or multiple password ready to be used just making use of a shortcut?

Well if you make use of ubuntu (even in a VM) here is the solution for you!

Install xclip

xclip is an Ubuntu app for dealing with stuff in the “clipboard”. I order to install it, please execute:

sudo apt-get install xclip

Once xclip has been installed you have to create a file that contains the password.

Eg.

echo "the_password" > /home/[username]/.my_unix_password
Creating a shortcut

There is a Keyboard menu in Ubuntu.

  • On the 12.04 the menu is at: Applications > System Tools > System Settings > Keyboard

Steps are:

  1. Select the Shortcuts panel
  2. Select Custom Shortcuts subpanel
  3. Click the +
  4. Enter the name of the shortcut (eg Copy Linux Password to Clipboard)
  5. in the command field enter: “xclip -i /home/[username]/.my_unix_password -selection clipboard”
  6. Click Apply
  7. Right click on Disabled. It should change into New Accelerator
  8. Now press the combination of keys you want to use to copy your password to clipboard (eg. CTRL+ALT+P)
  9. Finally close the keyboard menu

Now open a text editor and press your magic key combination…. now try to paste!

Et voila!

About giannigar

Senior Software Engineer - Groupon - Dublin, Ireland

Posted on August 8, 2012, in Linux, Ubuntu and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Bright Side of Java & Linux

Yet another Java blog

mysoftwarequality

Bringing empathy into knowledge workers life

Jess & the City

Cynical ramblings of a Latin girl living in Dublin

%d bloggers like this: