[SATLUG] Simple script I wrote for using screen

Christopher Lemire christopher.lemire at gmail.com
Sun Nov 25 23:37:55 CST 2012


I wrote a simple but useful script for those who like to always have a
graphical terminal emulator running screen. I set Cinnamon and Gnome3
in Fedora to run this script on startup instead of just running
gnome-terminal --command screen because relogging in would cause a
second screen session to start and apps in .screenrc to be ran twice.
This script fixes that by checking for a screen session. If one is
running, open a terminal emulator and connect to it. Otherwise open a
terminal emulator and create a new screen. This may need adjusting if
you like to have more than one screen session or prefer a different
terminal emulator.

[bull:~]$ cat bin/gtermwrapper
#!/bin/bash
dimensions="--geometry=132x43"
screen -ls | grep 'No Sockets' 1>/dev/null 2>&1
if [ $? -eq 0 ]; then
  gnome-terminal $dimensions --command "screen -S xyz"
else
  gnome-terminal $dimensions --command "screen -x"
fi


Christopher Lemire <christopher.lemire at gmail.com>
Ubuntu 64 bit Linux Raid Level 0

Gnu Privacy Guard Key Fingerprint = 3E1A 9103 EF3D 4885 6866  E9DE
C69F 18B3 E13B 0909

Web: http://linuxinnovations.blogspot.com
Jabber: recursivequicksort at jabber.org


More information about the SATLUG mailing list