diff options
Diffstat (limited to 'archive/bin/ii')
-rwxr-xr-x | archive/bin/ii | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/archive/bin/ii b/archive/bin/ii new file mode 100755 index 00000000..d3176ad8 --- /dev/null +++ b/archive/bin/ii @@ -0,0 +1,30 @@ +#!/bin/bash + +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 there's no root tmux daemon yet, ensure it has a normal PATH. + if ! tmux info >/dev/null 2>&1; then + source /etc/profile + source $HOME/.shenv + fi + # 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 + mosh athena /home/spwhitton/src/dotfiles/bin/ii +fi |