LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-01-2020, 12:11 PM   #1
dormant
LQ Newbie
 
Registered: May 2003
Posts: 19

Rep: Reputation: 0
Scripting to a second screen in text mode


I want to use an old screen as a text-display showing the output of scripts or commands. It will be attached to a Linux workstation which is using its man display for various tasks..

The screen would be split into four, with two instances of tty-clock running. The other two areas would show the output of scripts I provide.

I can do basic scripting (bash, Perl, Python) but I am getting very lost and confused when I search for help on this project.

The basics I need are:

1 - how to configure Linux to use the screen as an output device and not as a second display
2 - how to script to a split screen.

Any help would be appreciated.
 
Old 09-01-2020, 12:53 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,365
Blog Entries: 3

Rep: Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767Reputation: 3767
I'm not sure I understand the overall task. Are you asking about a terminal or about the console?

Either way, you can split them with tmux and then run separate processes in each pane or window.

It can be scripted but some of it can be added to .tmux.conf.

Here is one example:

Code:
tmux new-session -d -s demo 

tmux new-window -t demo -n foo \; \
     new-window -t demo -n bar

tmux split-window -v -t demo:foo.0 -l 10 \; \
     split-window -h -t demo:foo.1 -p 50 \; \
     split-window -h -t demo:foo.0 -p 50

tmux clock-mode -t demo:foo.1

tmux send-keys -t demo:foo.3 "ping -i 2 www.example.com" C-m

tmux send-keys -t demo:bar "top" C-m

tmux select-window -t demo:foo

tmux attach-session -t demo
The first line starts a session named "demo"

The second one adds a second and third window, one named "foo" and the other "bar"

The third splits the named window "foo" into four panes.

The fourth puts a digital clock into pane 1 (counting from 0).

The fifth sets ping running in the last pane in the window named "foo"

The sixth sets top running in the full named window "bar"

The last one connects to the session and allows interaction.

See "man tmux" but also see any of the many tutorials online.
 
Old 09-01-2020, 01:05 PM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,059

Rep: Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349
that is mainly redirection:
Code:
whatever command > /dev/pts/<terminal>
and the output will be displayed on the given tty.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set text mode 132x60, i.e., VESA text mode 268 (010Ch), upon startup from Grub? MdAyq Linux - Kernel 7 07-27-2020 04:36 AM
How to transfer permissions to text file and from text file to second system? orthograph Linux - Newbie 7 06-07-2012 04:37 PM
flickering of screen while returning back to GUI mode from Text mode using Ctl+Alt+F7 varun_shrivastava Linux - Newbie 1 03-30-2007 10:12 AM
how to change some text of a certain line of a text file with bash and *nix scripting alred Programming 6 07-10-2006 11:55 AM
After logging off from KDE/GNOME a Second time, text mode is mangled lavie Linux - General 5 12-22-2005 07:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration