Archive for July, 2010

Copy/Paste Like An Elephant

Being the avid Ubuntu users you all are, I’m sure you have also noticed one of those glaring bugs (yes, I consider this a bug) that has yet to be completely closed. It has to do with copy/paste. Yes, I know that copy/pasting things works…for the most part. There is that one lingering issue still, and feel free to try it out. Insert short-term memory loss…

Open a text file, copy something, close that window before pasting, open gedit, paste… Did anything happen? Probably not. The reason for this is because when the originating window is closed the clipboard forgets what was copied, thus not allowing a paste. There are programs that can fix this, but I think I may have discovered my favorite. Pastie.

Pastie is a clipboard manager with the memory of an elephant. It resides in your Indicator Applet and allows the ability to remember items that were copied historically. This is nice because you can re-paste items that were copied hours or even days ago. This is great if you’re like me and frequently forget terminal commands. ;-)

Other new features Pastie 0.5.2 (stable) since the last stable version:

  • it’s very easy to use a custom icon for Pastie: simply place the icon you want Pastie to use in the ~/.pastie/ folder (folder does not already exist). The icon must be renamed to “pastie.svg” (“svg” can be any other kind of usable type of image). You can find an Elementary icon here, and mono icons here.
  • you can launch the Pastie preferences dialog using a keyboard shortcut: Ctrl + Alt + P.

It’s a great little program. Here’s how to get it:
sudo add-apt-repository ppa:hel-sheep/pastie && sudo apt-get update
sudo apt-get upgrade
sudo apt-get install pastie

If you want to remove the PPA and downgrade, re-enable the PPA in System > Administration > Software Sources
sudo apt-get update
wget https://launchpad.net/~xorg-edgers/+archive/ppa... && sudo dpkg -i ppa-purge*.deb
sudo ppa-purge ppa:hel-sheep/pastie

And everything will be back as it was.

Caps/Num/Scroll Lock Notifications

I’ve been waiting over a month to write this post. The reason that it’s taken me so long is because of a bug that the Ubuntu Devs. have refused to accept an a bug. It’s not their fault I guess, I’m sure they have their reasons. Well, that time has finally come for this post to happen!

One of the things that I’ve really liked about Ubuntu is the way that notifications are handled. They use a very stylish pop-up in the upper right corner of the screen. Well, for a long time, people have been calling it “broken” because of a feature that seems to have been simply, taken away. The ability to set a timeout for when it will force the pop-up to disappear. It seems kind of silly to me to remove this feature since it really hinders what a developer can do with the integrated notification system in Ubuntu. You know what, I’ll get back this in a moment…

What I wanted to be able to do is have a notification pop any time I pressed one of the following keys:

  • Caps Lock
  • Num Lock
  • Scroll Lock

Well, someone on the Ubuntu Forum (red_five) came up with a pretty handy little bash script that can do this pretty darn nicely. Well, actually, his was for Caps/Num Lock, I was forced to tweak the script and add Scroll Lock as well as fine tune the text to my liking. There was a draw back to this though. The notifications were taking a crazy long time (10 seconds) for them to finally disappear. So lets say that you quickly press the Caps Lock on and then back off, the notification stays up for about 20 seconds. Now, I know that 20 seconds is not a long time, but it sure seems that way when you’re looking at the notification….try it.

Well this is where I can get back to where I left off earlier. WebUpd8 recently had an article that spoke of someone who re-wrote the Notify-Osd source code re-adding back the functionality that was left out…TIMEOUTS!! So without further ado, here are the steps for setting up Notifications for Caps/Num/Scroll Lock.

Step 1: Replace Notify-Osd (Note that this patch is only available for 9.10 and up)

  • Add the new repository:

sudo add-apt-repository ppa:leolik/leolik

  • Update & Upgrade:

sudo apt-get update && sudo apt-get upgrade

  • Restart Notify-Osd:

pkill notify-osd

Step 2: Setting Up The Bash Script

  • Open gedit
  • Copy & Paste this in to a new file:
#!/bin/bash
icon="/usr/share/icons/gnome/scalable/devices/keyboard.svg"
case $1 in
 'scrl')
 mask=3
 key="Scroll"
 ;;
 'num')
 mask=2
 key="Num"
 ;;
 'caps')
 mask=1
 key="Caps"
 ;;
esac
value=$(xset q | grep "LED mask" | sed -r "s/.*LED mask:\s+[0-9a-fA-F]+([0-9a-fA-F]).*/\1/")
if [ $(( 0x$value & 0x$mask )) == $mask ]
then
 output="$key Lock"
 output2="On"
else
 output="$key Lock"
 output2="Off"
fi
notify-send -i $icon "$output" "$output2" -t 1000
  • Save the file as lock_keys to your desktop
  • Make the new file executable:

  • Move it to your /bin folder:

sudo mv ~/Desktop/lock_keys /bin

Step 3: Setting up the key bindings

  • Open CompizConfig Settings Manager
  • Click on Commands
  • Find three blank lines and enter these in them:
    • lock_keys caps
    • lock_keys num
    • lock_keys scrl
  • Click on the Key Bindings tab
  • Link the corresponding Run Command # with the command from the previous tab
    • Click on Disabled
    • Check Enabled
    • Click Grab Key Combination
    • Press the key
  • Close Settings Manager
  • Test

AndroidU1

As you all may have recently been reading, one of my newest toys is my HTC DROID Incredible. Well, as with any other Linux users, I want to find ways to customize my phone to fit my specifications. That means downloading tons of applications, tweaking the themes, and finding as many games as possible. ;-)

Another thing that I love about having an Android device is that I can really stay connected. By connected, I don’t mean HTC’s idea of “connected” (Social), I mean connected to my things. I have several programs that sync with my Ubuntu box and all of them are used for different reasons. One for SSH, one for VNC, one for streaming music, etc…

One of the newest programs that I’ve discovered will allow me to sync to Ubuntu in a different way. More specifically, it connects to my Ubuntu One account. That’s right, Ubuntu One. A user on the Ubuntu Forums, mkarnicki, seems to have seen fit to take it upon himself (Approved by Ubuntu) to create an Android application that would sync an Android phone with a user’s U1 account.

Enter AndroidU1. :-)

AndroidU1 is nowhere near being a completed application, but the creator has taken some huge strides in a very short amount of time. It has great potential to be a really awesome application, and integrate really well with users accounts. I also have it on good authority and in the next day or two, there will be a huge update.

It’s worked well thus far, but has crashed once. Although, that’s to be expected of a program still in Beta a pre-Alpha release, it’s a developer version. For those of you who want more information about the program or want to try it out, here is more information:

AndroidU1 Blog Page: http://android-u1.blogspot.com/
Wiki Page: http://goo.gl/42LU
Launchpad Page: https://launchpad.net/androidu1
Launchpad Team Page (+mailing list): https://launchpad.net/~androidu1-users

Scan & Download

Follow

Get every new post delivered to your Inbox.

Join 25 other followers