Seriously...

I almost thought I had to change my blog name. Then I remembered that none of you would find this useful in the near future.

Simple shell scripts, and I hope by doing so I am repaying the community which has nurtured me.
But then again, I still got info from many places, including here.

All the below require libnotify (for notify-send, but its already on 9.04 anyway)

Fortune v2 (added timeout depending on text length)

#!/bin/bash
fort=$(fortune)
/usr/bin/notify-send -t $((1000+300*`echo -n $fort | wc -w`)) "Fortune" "$fort"


Reminder (change remind_icon and say_on_every to whatever you like)
#!/bin/bash
msg=$(zenity --entry --title=$rem --text="Task to remind")
tim=$(zenity --entry --title=$rem --text="Time to wait")
rem="Reminder"
remind_icon="~/remind.png"
say_on_every="Ding Ding Ding, time is up."
espeak -a 200 -p 90 -s 155 -k10 -w ~/remind.wav "$say_on_every $msg"
notify-send -i $remind_icon $rem "Reminder set for $msg in $tim"
(sleep $tim && notify-send -i $remind_icon $rem "$msg" && aplay ~/remind.wav) &


ReadThis (requires xclip. Reads from Text Selection buffer)
#!/bin/bash
stuff=$(/usr/bin/xclip -o)
if (!$stuff)
then
stuff="nothing"
else
espeak -a 200 -p 90 -s 150 -k10 -v m4 -w ~/espeak.wav "$stuff"
notify-send "Saying" "$stuff" & aplay ~/espeak.wav
fi


Yayzors. My exp increased by 5. 95 moar to next level. For full documentation request plox.

0 comments: