mostly profanity and fixes
[distro-setup] / prof
diff --git a/prof b/prof
new file mode 100755 (executable)
index 0000000..cb951d2
--- /dev/null
+++ b/prof
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+
+set -e; . /usr/local/lib/err; set +e
+
+dossh=true
+if (( $# >= 1 )); then
+  remote=$1
+else
+  remote=b8.nz
+  if systemctl --quiet is-active profanity || [[ $HOSTNAME == kd ]]; then
+    dossh=false
+  fi
+fi
+
+if $dossh; then
+  # IANK_BASHRC_RUN because if prof-remote dies for some reason, we
+  # I dont want konsole to disappear.
+  export IANK_BASHRC_RUN="prof-remote $remote"
+  konsole --profile profanity
+else
+  konsole --profile profanity -e screen -RD -S profanity
+fi