#!/bin/bash . $HOME/.shenv if [ "$(hostname -f)" = "athena.silentflame.com" ]; then # start irssi under tmux if it's not running # we used to use dtach, but then dtach+mosh started to mispaint irssi if ! tmux list-sessions | grep -Eq "^irssi:"; then # if I change timezone, patch the following line on 'athena' # branch of dotfiles repo; e.g. `TZ=Asia/Taipei`. Then in # running session, do e.g. /script exec $ENV{'TZ'}='Asia/Taipei'; SHELL=/bin/bash TZ=MST tmux new-session -d -s irssi irssi fi # disable the status bar tmux set -t irssi status off # if we're not at a dumb terminal (so this script can be shoved in a # crontab), try to attach what we (maybe) just made. # following line is a bashism if [ -t 1 ]; then tmux attach-session -t irssi fi else # on a workstation, get connected to athena if [[ $- == *i* ]]; then mosh athena /home/spwhitton/src/dotfiles/bin/ii else xfce4-terminal --title="irssi" -x /bin/sh \ -c "mosh athena /home/spwhitton/src/dotfiles/bin/ii" fi fi