Startup script for i3 with Conditional Execution

I’ve been using the i3 window manager for roughly a couple of years now and have enjoyed playing with all the ways I’ve found to extend it through startup scripts, keybindings, etc. This little hack for enabling or disabling the launch of a group of applications at login is one of my favorites and I thought I’d share.

I’ve got a script in my i3 configuration directory called launch.sh that fires up a number of persistent applications and launches things I normally use.

The first thing it does is load a saved layout and launch terminals with htop, dmesg –follow, and tail -f /var/log/syslog . I use this as a general system monitor workspace, a dedicated place I can go to see what’s happening on my system.

Next, it switches to a workspace I use as a dedicated terminal and launches urxvt, then switches to the workspace I use for my browser, switches the layout to tabbed, then launches my browser.

Then it loads up the scratchpad text app I use (Fromscratch), udiskie for managing removable media, the mpd daemon, and after some delay to make sure everything else is finished loading, dropbox.

I’ve been happy with this arrangement, but really wanted to find a way to keep it from launching some of those items on startup in case I wanted to do something more system intensive and didn’t need those things right away or want to do some kind of benchmarking and want fewer things tying up RAM.

Continue reading “Startup script for i3 with Conditional Execution”