Skip to content

Instantly share code, notes, and snippets.

@mrtazz
Created July 4, 2012 22:08
Show Gist options
  • Save mrtazz/3049759 to your computer and use it in GitHub Desktop.
Save mrtazz/3049759 to your computer and use it in GitHub Desktop.
Shortcut for OSX dock to run irssi in tmux with iTerm2

Shortcut for OSX dock to run irssi in tmux with iTerm2

Synopsis

I run irssi inside a tmux session on OSX. I often close the terminal as I usually get notified by growl about important stuff. I don't want to open a terminal and write a command every time I want to check IRC.

The solution

1. Create a shell script with the following content

#!/bin/zsh
/usr/local/bin/tmux attach -d -t irssi || /usr/local/bin/tmux new -s irssi irssi

2. Create a profile in iTerm2 with the name irssi and the shell script as the run command

3. Create an AppleScript with the following content and save as irssi.app

tell application "iTerm"
    activate
    set myterm to (make new terminal)
    tell myterm
        launch session "irssi"
    end tell
end tell

4. Drag irssi.app to the dock

Ways to make it nicer

  • it should be possible to set the tmux commands directly as the iTerm session command but that somehow didn't work for me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment