summaryrefslogtreecommitdiff
path: root/archive/bin/ii
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-10-30 15:13:45 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-10-31 18:56:00 -0700
commit365a519192fcc4f60f7f63d47a9a4bf51c822af1 (patch)
treec78fb22963dc84f630cece9f4422708833419462 /archive/bin/ii
parent59e405c2ef0da027b6fc5088bc13f70809a601e4 (diff)
downloaddotfiles-365a519192fcc4f60f7f63d47a9a4bf51c822af1.tar.gz
irssi -> rcirc initial configuration
Diffstat (limited to 'archive/bin/ii')
-rwxr-xr-xarchive/bin/ii30
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