LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 08-23-2018, 08:50 PM   #1
dracut
LQ Newbie
 
Registered: Jul 2018
Distribution: Debian
Posts: 6

Rep: Reputation: Disabled
Question Configuring xinitrc to spawn virtual term and display MOTD on Debian Stretch


Hey guys,
was wondering if anyone knew how to configure xinitrc in such a way that I could display some sort of MOTD in a virtual terminal that is spawned when x11 is started. The use case here is to display a todo list in the terminal when I startup X11.
 
Old 08-24-2018, 02:09 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
https://wiki.debian.org/xinit?highlight=%28startx%29
why isn't /etc/motd sufficient?
 
Old 08-24-2018, 08:31 AM   #3
dracut
LQ Newbie
 
Registered: Jul 2018
Distribution: Debian
Posts: 6

Original Poster
Rep: Reputation: Disabled
What I actually meant by "virtual terminal" was "psuedo terminal". I was under the impression that when logging on through a virtual terminal (/dev/tty#) /etc/motd is read, however for any given psuedo terminal (/dev/pts/#) spawned under the virtual terminal /etc/motd
isn't read. I'm assuming rlogin reads from /etc/motd, which isn't called when spawning a new psuedo terminal.

I've tried to simulate some sort of MOTD within xinitrc by redirecting output to the appropriate /dev/pts/# but nothing shows up when done using xinitrc.

Last edited by dracut; 08-24-2018 at 09:30 AM.
 
Old 08-25-2018, 12:53 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
so you want that motto of the day only once after logging into the graphic session?
why don't you just open a terminal that executes a script that prints that out?
via xinitrc, or via your window manager's / desktop environment's startup mechanism?

Quote:
Originally Posted by dracut View Post
I've tried to simulate some sort of MOTD within xinitrc by redirecting output to the appropriate /dev/pts/# but nothing shows up when done using xinitrc.
show us.
 
Old 08-25-2018, 05:47 AM   #5
dracut
LQ Newbie
 
Registered: Jul 2018
Distribution: Debian
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
so you want that motto of the day only once after logging into the graphic session?
Exactly, it would be shown in the first psuedo terminal (/dev/pts/0).
Quote:
Originally Posted by ondoho View Post
why don't you just open a terminal that executes a script that prints that out?
via xinitrc, or via your window manager's / desktop environment's startup mechanism?
This is what I am attempting to do, though I am not sure if I am doing it correctly.

Here are the relevant parts of my .xinitrc:

Code:
/usr/local/bin/st &   #term
motd="message"
exec dwm
echo "$motd" >> /dev/pts/0

Last edited by dracut; 08-25-2018 at 06:05 AM.
 
Old 08-26-2018, 05:57 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by dracut View Post
Code:
/usr/local/bin/st &   #term
motd="message"
exec dwm
echo "$motd" >> /dev/pts/0
strange. can't work.

why not just:
Code:
/usr/local/bin/st -e sh -c "echo message;read" &
exec dwm
???
(i don't use st; this command works for urxvt though. also, isn't /usr/local/bin/ in your $PATH?)
 
  


Reply

Tags
motd, terminal, x11, xinitrc



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Configuring Debian with FQDN, Dynamic IP, virtual hosts mpyusko Linux - Server 7 09-27-2013 04:13 AM
LXer: Virtual Appliances Spawn New Class of Linux Distros LXer Syndicated Linux News 0 10-12-2007 03:10 PM
configuring the display in Debian control center Bill_Hwy Debian 9 05-03-2007 05:33 PM
how to display motd bhert Linux - Newbie 3 09-22-2006 02:46 AM
Debian Display on Virtual PC 2004 nyrangerz1 Linux - Newbie 2 08-31-2004 12:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 03:42 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