scientificlinuxforum.org QR code
Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> Login Screen & Terminal placement
Slevin
 Posted: Aug 9 2012, 02:23 PM
Quote Post


SLF Newbie


Group: Members
Posts: 12
Member No.: 1773
Joined: 6-August 12









Hello again =)

I adjusted a little bit my SL5.6 system, but I don't know how to do the following:
1) I want to change the background picture of the login screen
2) on every startup, when user X is logging in, there shall be 4 terminals be active on the screen: each with top left, top right, bottom left & bottom right. And at one of these terminals (e.g. bottom right) there shall "tail -F /var/log/messages" be executed. How can I achieve that?
PM
^
zxq9
 Posted: Aug 9 2012, 03:05 PM
Quote Post


SLF Advocate
*****

Group: Members
Posts: 367
Member No.: 611
Joined: 5-August 11









For GDM backgrounds, try looking in /usr/share/backgrounds. I don't remember which set is the GDM default (I think just *default.{jpeg,png} but play to make sure), but its in there, I think.

As for logging in to a desktop that has 4 terminals open, there are a few ways to do that. If I understand what you want, you want a user to log in to a Gnome2 desktop (just the default) and have the act of logging in span 4 terminal sessions, one of which has a specific script already running.

If this is just one person who needs this, then I would suggest writing a little script that spawns your desired terminal sessions. Something like:
CODE
#! /bin/bash

# 4sessions script. Save this in ~/bin/4sessions if you want to use it as an arbitrary
# command of your own.

x=800
y=500

gnome-terminal --geometry=80x24+0+0
gnome-terminal --geometry=80x24+$x+0
gnome-terminal --geometry=80x24+0+$y
gnome-terminal --geometry=80x24+$x+$y -e "tail -F /var/log/messages"


Of course, the -e command can be anything, and the geometry of your screen will determine whether or not the x and y values make sense or the 80x24 size is good for you or whatever. But this will do what you want.

Once this is done, then you could add the 4sessions command to System > Preferences > Startup Applications. That would work only for Gnome only for one user. If you want it to be more universal you'd probably want to put it in .xsessions or in the system-wide xsessions startup script. If you decide you don't actually like that to happen by default every time you log in, you could assign an icon launcher from your desktop to that script -- which would probably be my preference since I don't want all that stuff flying around when I'm just logging in for a second to check email or whatever.

An alternative to opening four gnome-terminal sessions is to open one full-screen terminal and use screen to emulate 4 screens within one terminal.

Ah... one more thing... I don't think you can read /var/log/messages without being root, so you'll probably need to add the user to wheel or come up with something similar to make this work for you, because logging in as root to gnome is a very bad idea for the same reasons using Windows as administrator (like everybody in Windows land seems to do) is stupid.
PMEmail PosterUsers Website
^
Slevin
 Posted: Aug 9 2012, 04:46 PM
Quote Post


SLF Newbie


Group: Members
Posts: 12
Member No.: 1773
Joined: 6-August 12









thank you very much!

But it works not correctly: I've done what you've said and the result is:
After login, there is only one terminal at top left position. When I close this one, the second terminal appears at the top right position. When I close the 2nd terminal, the 3rd terminal appears at bottom left and so on.
But my goal is, that all 4 terminals appears simultaneously after login.
PM
^
zxq9
 Posted: Aug 9 2012, 08:53 PM
Quote Post


SLF Advocate
*****

Group: Members
Posts: 367
Member No.: 611
Joined: 5-August 11









Sorry, I didn't test it. You might need to put the jobs in the background by adding " &" to the end of the lines with gnome-terminal in them:
CODE
gnome-terminal --geometry=80x24+0+0 &
gnome-terminal --geometry=80x24+$x+0 &
gnome-terminal --geometry=80x24+0+$y &
gnome-terminal --geometry=80x24+$x+$y -e "tail -F /var/log/messages" &

This should get them running at the same time. If not, let me know -- I'd be interested to discover why.
PMEmail PosterUsers Website
^
Slevin
 Posted: Aug 10 2012, 09:30 AM
Quote Post


SLF Newbie


Group: Members
Posts: 12
Member No.: 1773
Joined: 6-August 12









yeah, this works! thank you again!

I had the fear, that there could be another problem:
As root I did:
CODE
tar czvf home.tar.gz /home/*

and entered the following in /etc/rc.d/rc.local:
CODE
rm -rf /home
cd /
tar xzvf /root/home.tar.gz

But surprise, the 4session startapplication still works =)
PM
^
Slevin
 Posted: Aug 16 2012, 12:38 PM
Quote Post


SLF Newbie


Group: Members
Posts: 12
Member No.: 1773
Joined: 6-August 12









I have an additional question to that:
This only works, if I copy any existing script (e.g. /usr/bin/puplet), paste it in ~/bin/ then rename it into "4sessions" and change the content of the script (paste your commands from above).
It does not work if I create an empty file and name it "4sessions" and put your content into the file.
So what's the problem there?
PM
^
zxq9
 Posted: Aug 17 2012, 12:49 AM
Quote Post


SLF Advocate
*****

Group: Members
Posts: 367
Member No.: 611
Joined: 5-August 11









Your newly created files are not executable by default. You need to do this:
CODE
chmod +x ~/bin/4sessions
to make them executable.

This is a Unix file permissions thing. You can learn more about that here. Its an important subject to understand if you are new to Unix environments.
PMEmail PosterUsers Website
^
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll