Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to automate split-screens in GNU Screen?

Tags:

gnu-screen

I know this is possible manually via ctrl commands using gnu screen for linux but I cannot seem to find a way to do this using only a script.

What I am trying to accomplish is via script having gnu screen split my terminal screen horizontally and run two separate commands on each screen at the same time.

For instance using two separate watch ls folder commands


[screen 1] watch ls folder1


[screen 2] watch ls folder2


like image 937
user1313546 Avatar asked Apr 04 '12 18:04

user1313546


1 Answers

Your .screenrc file gets interpreted in order, sort of like running the Ctrl-A commands yourself.

$ cat .screenrc
screen -t folder1 1 watch ls /path/to/folder1
screen -t folder2 2 watch ls /path/to/folder2
sessionname Hello
split
select 1
focus
select 2
startup_message off
like image 138
ghoti Avatar answered Oct 03 '22 21:10

ghoti