13
Aug/09
1

Upgraded “timeleft” script

By request, the “timeleft” script from earlier has been upgraded.

Screenshot of the timeleft program. A progress bar that shows the time left in your day, and text that numerically represents the time left in your day

Screenshot of the timeleft program. A progress bar that shows the time left in your day, and text that numerically represents the time left in your day

It still shows how much time is left in your day (at work or awake) as a progress bar.
However, now it reminds you that the day is over with notify-osd popups, which look really nice in Ubuntu 9.04.

It also, optionally, has an audio reminders, which are numbered ogg files. I have included a personal set of ogg files, and think you may enjoy them. If they don’t fit for you, just replace the set with a different ogg files, or disable the sound notifications.

timeleft.zip

To install, simply extract the above archive in your /home/$USER/bin directory. You may need to get some dependencies, so run this just to make sure you have all of them.

sudo apt-get install python-gtk2 gtk2-engines python-pygame 

It should work, just like that. However, you will want to change the times and maybe a few other settings, so have a look at the top of the /home/$USER/bin/timeleft.py file.

Thats it. Just type timeleft.py to run the program. Write it in the terminal, set it up in your gnome-session, or make a desktop icon. Whatever works for you.

Author: Evan Boldt

Tagged as:
16
Jul/09
0

Time left in your day as a progress bar

This relatively short python script is deceivingly useful. It helps you to pace your workflow, and be more aware of your free time.

Screenshot of the timeleft program. A progress bar that shows the time left in your day, and text that numerically represents the time left in your day

Screenshot of the timeleft program. A progress bar that shows the time left in your day, and text that numerically represents the time left in your day

To install it, simply add the following file to your /home/USER/bin directory, and give it execute permission.

timeleft.py

To customize it, open the file with your favorite text editor and change the times at the top. You may also wish to change the window properties found at the bottom of the file. You can repurpose it to show how much time you have left at work by also changing the notification messages in the middle of the file from “Go to sleep” to “Hurray! Work’s over!”

To run the file in gnome, press ALT + F2, then type “timeleft.py”. You can also run it by double clicking the file, or making a shortcut that runs the command “timeleft.py”

Progress Bar Pulse

When your day is done, the progress bar pulses and the text asks you to go to sleep. In conjunction, the script also sends an unobtrusive popup using notify-send


CC-GNU GPL
The script is licensed under the CC-GNU GPL version 2.0 or later.

Author: Evan Boldt

Filed under: Scripts
14
Jul/09
0

Unlock your screen with ANY USB device

You can have your Linux screen automatically unlock its screen when any USB device is plugged in. You’ll find this usefull espcially if you have a cell phone that you charge using your computer.

All you have to do is type lsusb into the terminal, copy the part after “ID “.
Then paste this into a file in your /home/USERNAME/bin/ directory.

#!/bin/bash

#Replace with the ID of your USB device
id="ID 05ac:1292 Apple, Inc" # Example: id="ID 05ac:1292 Apple, Inc"

#runs every 2 seconds
for ((i=0; i<=30; i++))
do
if [ -z "`lsusb | grep "$id"`" ]
then

echo "Device is NOT plugged in"

if [ -n "`DISPLAY=:0 gnome-screensaver-command --query | grep "is active"`" ]
then
if [ -e /home/evan/bin/autoUnlock.lock ]
then
#stop locking the screen
rm /home/evan/bin/autoUnlock.lock

fi

elif [ -e /home/evan/bin/autoUnlock.lock ]
then

DISPLAY=:0 notify-send -t 5000 –icon=dialog-info “Device Disconnected” “Bye!”

#lock the desktop
DISPLAY=:0 gnome-screensaver-command --lock

rm /home/evan/bin/autoUnlock.lock

fi
else

echo "iPhone IS plugged in"
if [ ! -e /home/evan/bin/autoUnlock.lock ]
then
DISPLAY=:0 gnome-screensaver-command --deactivate
DISPLAY=:0 notify-send -t 5000 --icon=dialog-info "Device Connected" "Welcome Back!"
touch /home/evan/bin/autoUnlock.lock

##Uncomment the 3 following lines if you would like your computer to remind you if you lock your screen without disconnecting the device
#echo "Don't forget your device!" > /home/evan/bin/iPhoneReminder
#DISPLAY=:0 festival --tts /home/evan/bin/iPhoneReminder
#rm /home/evan/bin/iPhoneReminder
fi

fi
sleep 2
done

You should paste the ID you copied earlier to the apropriate place in the top of the file.
If you would like to be reminded in case you forget your device, uncomment the 3 lines in the middle of the file.
Next, have your Linux compter run this script every minute.

crontab -e

add the line:

* * * * * bash /home/username/bin/autoUnlock & >/dev/null 2>&1

That should be all you need!


CC-GNU GPL
The script is licensed under the CC-GNU GPL version 2.0 or later.

Author: Evan Boldt

Filed under: Scripts
14
Jul/09
0

Pidgin: Link warning

Pidgin should check links sent by others to warn users of phoney or misleading links.

If something reads like it’s a URL, it Pidgin should check if the target matches it.

Pidgin should check for phony links

Pidgin should check for phony links

Users should be warned because it is easy to trick users into thinking that a link goes to somewhere they want to go, but then takes them to another place of their choosing.

For example, this link looks like something I might send in an instant message, but notice that the link does not go where you think: http://echowarp.neomenlo.org/

This kind of deception is a problem because the actual target of the link can go anywhere the sender wants, including places that could attempt to install malware, trick users into giving passwords, or just contain a lot of unwanted advertisements.

Show your support, and help spur the development of this Pidgin feature on Ubuntu Brainstorm:

Or add your thoughts on the Pidgin Ticket

Until this feature is implemented, you can check links yourself by hovering over them.

Author: Evan Boldt

Tagged as: