Mar 182013

Cuttlefish is a tool which can execute various actions when specific events are triggered, and it allows you to create events that only happen under certain circumstances

For example, you could set a condition/reaction such as “when the lan network is connected start Transmission”, or “Unmute the audio when I start Banshee and mute it when I close Banshee”.
The nice things of this program is that it’s completely configurable via a nice graphical interface that makes the creation of any task extremely easy and intuitive.
The software is wrote in python, open source and is born on Ubuntu as “Ubuntu app” and so it’s easily installable on this distribution or Derivate, there is a package from AUR for Arch Linux and I’m sure soon you’ll find it for any distribution.

Cuttlefish is very powerful in what it can do, you can do things like opening your browser when Ubuntu connects to your wireless LAN, or automatically lock your screen when a USB stick is unplugged (this is a great idea for computers in public places like in work), the basic concept are really simple, you create a basic condition (known as stimulus) that once met will trigger another action (known as reflexes)

These are the conditions (Stimulus) that are supported:

  • Startup / shutdown application
  • Connect / disconnect Bluetooth device (you can choose)
  • On / off Bluetooth
  • Connection / disconnection of the wireless network (you can choose which one)
  • The power cord is connected / disconnected
  • The screensaver is activated / deactivated
  • A USB device is connected / disconnected (you can also choose the device)

Once one of these conditions is met, whichever of them you have set, you can make do one of the following actions (Reflexes):

  • Startup / shutdown of an application (you can also set the advanced parameters, with additional scripts, setting details, working directory, etc.).
  • Set the volume
  • Activate / deactivate Bluetooth
  • Changing the default printer
  • Change the background
  • Changing the proxy mode
  • waiting
  • Change the status of Pidgin
  • Hibernate, reboot, power off, suspend
  • To enable / disable WLAN
  • Activating / deactivating the screensaver (screen lock)

Let’s see a basic example, start Firefox when WLAN is connected:


Open Cuttlefish and click on New.
Give it a name, and change Activated by stimulus option to ON.


Click on Stimulus, select the category Network and type Connect to WLAN. Click OK.


You can also select the SSID of wireless network and you have an option of whether or not to check this on startup.


Now you will have to specify a reaction. Go to Reaction tab, and click add. Select Applications from the category and Start Application(in advanced mode) from type.


Now specify the script which you want to run in executable option. You can even pass parameters to the script.


And that’s it! Also make sure that you add Cuttlefish in startup applications. Go to Edit > Preferences and enable the autostart option.


If the tasks scheduled through cron or incron are not enough for you, Cuttlefish can be of help and allows easy programming of actions/reactions that would otherwise be very difficult to express in another manner.


how to run a script every time internet connects

Popular Posts:

Flattr this!

  One Response to “Automate easily your tasks on Ubuntu with Cuttlefish”

  1. I had this idea way back in 2010. Unfortunately, circumstances prevents me in realizing my goal even up to now.

    It’s depressing that people are coming up with the same idea left and right (TaskRabbit comes to mind) but actually making progress while I still yet have to figure out how and when to start 🙁

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>