summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-02-24 20:05:19 +0900
committerSean Whitton <spwhitton@spwhitton.name>2015-02-24 20:05:48 +0900
commitc3d9fd85805fe55788839c6d85770a83e0252075 (patch)
tree53a47a4b4d53005b77f963420b62723c1714b761
parent7bcca5f15656716ca3833d9e291f0a5b135ef7b2 (diff)
downloaddotfiles-c3d9fd85805fe55788839c6d85770a83e0252075.tar.gz
rt script & crontab it on artemis
rtorrent run-and-maybe-attach script based off old hestia-startup script crontab on artemis because it's always on a connection where that's okay atm
-rw-r--r--.config/cron/swhitton/artemis.silentflame.com2
-rw-r--r--.zshrc1
-rwxr-xr-xbin/rt15
3 files changed, 17 insertions, 1 deletions
diff --git a/.config/cron/swhitton/artemis.silentflame.com b/.config/cron/swhitton/artemis.silentflame.com
index 39c83e45..2f48b738 100644
--- a/.config/cron/swhitton/artemis.silentflame.com
+++ b/.config/cron/swhitton/artemis.silentflame.com
@@ -3,3 +3,5 @@
*/15 * * * * chronic doccheckin
*/10 * * * * chronic offlineimap
+
+@reboot rt
diff --git a/.zshrc b/.zshrc
index eeed4aeb..98afad7d 100644
--- a/.zshrc
+++ b/.zshrc
@@ -54,7 +54,6 @@ alias screen="screen -U" # enable UTF-8
alias tmux="tmux"
alias rax="screen -URaAx"
alias ta="tmux attach"
-alias rt="screen -t rtorrent dtach -a $HOME/local/rt/session/dtach.socket"
alias blogdates="rdate.py-dir ~/html/blog/entries"
alias httpdir="sudo python -m SimpleHTTPServer 80"
diff --git a/bin/rt b/bin/rt
new file mode 100755
index 00000000..f31f996d
--- /dev/null
+++ b/bin/rt
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# start rtorrent under dtach if it's not running
+
+if ! pgrep -u $LOGNAME rtorrent >/dev/null; then
+ rm -f $HOME/local/rt/session/dtach.socket
+ TERM=xterm /usr/bin/nice -n 19 /usr/bin/dtach -n $HOME/local/rt/session/dtach.socket /usr/bin/rtorrent
+fi
+
+# 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
+
+if [ -t 1 ]; then
+ dtach -a $HOME/local/rt/session/dtach.socket
+fi