]> gitweb.fluxo.info Git - termplex.git/commitdiff
Restore term title
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 16 Oct 2014 14:09:01 +0000 (11:09 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 16 Oct 2014 14:09:01 +0000 (11:09 -0300)
shell

diff --git a/shell b/shell
index aa1b8d2eebed6f3d2e8482eebfb6494a93421060..0d6758e50cc700cc29994dc34c36035e69d2b2c9 100755 (executable)
--- a/shell
+++ b/shell
@@ -8,11 +8,13 @@ BASENAME="`basename $0`"
 DEST="$1"
 COMMAND="$2"
 
-# Set screen title
+# Set window title
 # http://stackoverflow.com/questions/899609/gnu-screen-run-script-that-sends-commands-to-the-screen-session-it-is-being-run
-function screen_title {
+function window_title {
   if [ -n "$STY" ]; then
     screen -p $WINDOW -X title $1
+  else
+    xtitle $1
   fi
 }
 
@@ -22,7 +24,7 @@ if [ -z "$DEST" ]; then
 fi
 
 # Set default screen title
-screen_title $DEST
+window_title $DEST
 
 # Dispatcher
 if [ "$BASENAME" == "shells" ]; then
@@ -38,11 +40,11 @@ else
     wscreen $DEST
   elif [ -z "$COMMAND" ] && [ "$DEST" == "root" ]; then
     # Local root shell
-    screen_title root
+    window_title root
     sudo screen -x
   elif [ "$DEST" == "local" ]; then
     # Local screen shell
-    screen_title $COMMAND
+    window_title $COMMAND
     wscreen $COMMAND
   else
     # Remote shell using autossh
@@ -51,4 +53,4 @@ else
 fi
 
 # Restore screen title
-screen_title terminal
+window_title terminal