From dc372b427ede06e2f1aa5954116cb46d81a10741 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 17 Dec 2016 13:35:39 +0100 Subject: Auto-(re)attach screen for remote hosts --- bash/.bashrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bash/.bashrc b/bash/.bashrc index eb33c7a..50d8206 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -1,6 +1,14 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return +host=`hostname` + +if [ $host = "automatix" ] || [ $host = "asterix" ]; then + if [ -z "$STY" ]; then + exec screen -R + fi +fi + if [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then exec startx fi -- cgit v1.2.3