[SATLUG] Simple script I wrote for using screen

Howard Haradon hharadon at gmail.com
Tue Nov 27 08:58:19 CST 2012


Chris, Tnx for posting this.
Howard

On Nov 25, 2012 11:38 PM, "Christopher Lemire" <christopher.lemire at gmail.com>
wrote:
>
> 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
> --
> _______________________________________________
> SATLUG mailing list
> SATLUG at satlug.org
> http://alamo.satlug.org/mailman/listinfo/satlug to manage/unsubscribe
> Powered by Rackspace (www.rackspace.com)


More information about the SATLUG mailing list