My Linux Stuff


Not: Türkçe için buradan buyrun.

Welcome to my GNU/Linux stuff page. Here you can find some scripts etc. I've coded myself, collected from the Internet or written by someone else but modified by me.

You can contact me at dcelasun (at) ieee (dot) org.

My Scripts

Auto TinyURL Generator - This script copies the URL in your clipboard and replaces it with a TinyURL. It also notifies you when the TinyURL is generated. You can also use it through the shell with

$ tinyurl <URL>

The script:
#!/bin/sh
#
# title: tinyurl
# author: Can Celasun
# This script, called without an argument, converts the URL in your clipboard
# to a tinyurl and puts it back into your clipboard
# If given a URL as an argument, it also echoes the tinyurl.
# License: WTFPL (http://sam.zoy.org/wtfpl/)

 
if [ "$1" = "" ]; then
  tinyurl=$(curl http://tinyurl.com/api-create.php?url=$(xclip -selection clipboard -o) 2> /dev/null)
  echo $tinyurl | xclip -selection clipboard -i;
  zenity --info --text="The URL is in your clipboard.";
else
  url=$1;
  tinyurl=$(curl http://tinyurl.com/api-create.php?url=${url} 2> /dev/null)
  echo $tinyurl;
  echo $tinyurl | xclip -selection clipboard -i;
fi
 
Paste the above script into a file tinyurl.sh and make sure that it's visible from your PATH. It depends on xclip and zenity.

---

Bluetooth Toggler for ThinkPad laptops - The following script, when executed with root permissions (or sudo, with or without NOPASSWD), will toggle the Bluetooth hardware on/off.

#!/bin/sh
### Start toggle_bt.sh
cat /proc/acpi/ibm/bluetooth |head -1 |grep -q enabled

if [ "$?" -ne "0" ]; then
  echo enabled > /proc/acpi/ibm/bluetooth
  exit 0
fi

echo disabled > /proc/acpi/ibm/bluetooth
### End toggle_bt.sh

---

Conky Config - My conky config consists of several independent config files. It's based on Mira, but I've made significant improvements to it. At the time of writing, the addtional features that my version has are as follows:

Also, you'll need the following for this to work, otherwise some features might not work: Download the config files here and neccessary scripts here. Here's how it looks: