change login screen...

I tried to find a topic or some user guide about changing the default login screen, but I didn’t succeded…

so, OpenSuse 11.3 with Gnome, I would like to change login screen.
I found art.gnome.org site, but it didn’t helped me…

(they mention gdmsetup wich is obsolete).
So, is there a dummy-user-guide to changing login screen?

run gnome-appearance-properties as user gdm:
sudo -u gdm gnome-appearance-properties

On 2010-11-29 11:06, please try again wrote:
> sudo -u gdm gnome-appearance-properties

I’ve been told by people “in the know” to “NEVER EVER run X applications
with sudo”

Besides that, the user “gdm” can not login, so in fact it will run as the
user you call su or sudo instead, or fail.

/etc/passwd:
gdm:x:50:109:Gnome Display Manager daemon:/var/lib/gdm:/bin/false

Telcontar:~ # sudo -u gdm gnome-appearance-properties
Cannot open display:

(gnome-appearance-properties:30154): Gtk-WARNING **: cannot open display:
Telcontar:~ # su - gdm -c gnome-appearance-properties
Telcontar:~ #

and it doesn’t run.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

khm, so how could I change login screen?

papperlapapp !

Nope. Besides, I didn’t intend to login as gdm.

Come on, Carlos! You do know how to open the display.
But granted, I should have explained how to do it before (my display is open locally).

So again:

  • open a terminal
  • open the Xorg display to other local users:
    xhost + local:
  • run gnome-appearance-properties as user gdm
    sudo -u gdm dbus-launch gnome-appearance-properties
  • Change background, themes, fonts and restart gdm (or reboot)

Abschleifen, Farbe drauf, fertig!

If you don’t want to use sudo with X applications (because you believe what you’ve been told by people), you can use sudo with gconftool-2, which is NOT a GUI application. Here’s an example (run it as root) :

gdmbg=/usr/local/share/themes/yourgdm/yourbackground.jpg 
pset="sudo -u gdm gconftool-2 --direct --config-source xml:readwrite:/var/lib/gdm/.gconf"
$pset --type=string --set /desktop/gnome/background/color_shading_type "solid" 
$pset --type=string --set /desktop/gnome/background/primary_color "#2a2a58581f1f" 
$pset --type=string --set /desktop/gnome/background/secondary_color "#2a2a5c5c2424"
$pset --type=string --set /desktop/gnome/background/picture_filename "$gdmbg" 
$pset --type=string --set /desktop/gnome/background/picture_options "spanned" 
$pset --type=string --set /desktop/gnome/interface/icon_theme "Gilouche"

If you don’t want to use sudo at all, you can write xml files in /var/lib/gdm/.gconf/desktop/… and subdirectories, then **chown -R gdm:gdm *** *
:wink:

  • from /var/lib/gdm/.gconf/desktop !!!

Hi
@please_try_again: You must have changed something else, it doesn’t work. I get the same result (error) as Carlos both in SLED11 and openSUSE 11.4 M3.

@bongo_zg, use the gconftool method. have a look here https://wiki.archlinux.org/index.php/Gnome_2.28_Changes#Changing_Background_Image

On 2010-11-29 19:36, please try again wrote:
>
> robin_listas;2259196 Wrote:
>> On 2010-11-29 11:06, please try again wrote:
>>> sudo -u gdm gnome-appearance-properties
>>
>> I’ve been told by people “in the know” to “NEVER EVER run X
>> applications with sudo”
>>
>
> papperlapapp !

No kidding. Ask DenverD :wink:

> robin_listas;2259196 Wrote:
>>
>> Besides that, the user “gdm” can not login, so in fact it will run as
>> the user you call su or sudo instead, or fail.
>>
>> /etc/passwd:
>> gdm:x:50:109:Gnome Display Manager daemon:/var/lib/gdm:/bin/false
>>
>
> Nope. Besides, I didn’t intend to login as gdm.

Right, but the thing is, your sudo command line above doesn’t run in my
system. I know why: it is properly configured to require explicitly adding
a line for each command and user - it will not accept root’s password. It
is a restricted sudo configuration.

> robin_listas;2259196 Wrote:
>>
>> Telcontar:~ # sudo -u gdm gnome-appearance-properties
>> Cannot open display:
>>
>> (gnome-appearance-properties:30154): Gtk-WARNING **: cannot open
>> display:
>> Telcontar:~ # su - gdm -c gnome-appearance-properties
>> Telcontar:~ #
>>
>> and it doesn’t run.
>>
>
> Come on, Carlos! You do know how to open the display.
> But granted, I should have explained how to do it before (my display is
> open locally).

I know, but my intention was to point that it only fails with users like
“gdm”, because the password line denies it.

Code:

root 11339 0.0 0.0 26796 1940 ? S Nov27 0:00 /usr/sbin/gdm
root 12316 0.0 0.0 38648 2604 ? S Nov27 0:00 _
/usr/lib/gdm/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1
root 12317 0.8 1.6 273424 133064 tty7 Ss+ Nov27 23:06 _
/usr/bin/Xorg :0 -br -verbose -auth
/var/run/gdm/auth-for-gdm-AiDNwH/database -nolisten tcp vt7
root 12363 0.0 0.0 73608 2776 ? S Nov27 0:00 _
/usr/lib/gdm/gdm-session-worker
gdm 12345 0.0 0.0 15604 764 ? S Nov27 0:00
/usr/bin/dbus-launch --exit-with-session
cer 18132 0.0 0.0 6444 820 pts/19 S+ 22:36 0:00 _
grep gdm

> So again:
>
> - open a terminal
> - open the Xorg display to other local users:
> XHOST + LOCAL:
> - run gnome-appearance-properties as user gdm
> SUDO -U GDM DBUS-LAUNCH GNOME-APPEARANCE-PROPERTIES

This line will mandatorily fail in my system. So, I open visudo, add the
appropiate line:

cer Telcontar = (gdm) NOPASSWD: /usr/bin/gnome-appearance-properties

and try again:

Code:

cer@Telcontar:~> xhost + local:
non-network local connections being added to access control list
cer@Telcontar:~> sudo -u gdm gnome-appearance-properties
Cannot open display:

(gnome-appearance-properties:18769): Gtk-WARNING **: cannot open display:
cer@Telcontar:~>

And no program :slight_smile:

I also tried the dbus-launch variant, same result:

Code:

cer@Telcontar:~> sudo -u gdm /usr/bin/dbus-launch gnome-appearance-properties
Cannot open display:

(gnome-appearance-properties:19561): Gtk-WARNING **: cannot open display:

> If you don’t want to use sudo with X applications (because you believe
> what you’ve been told by people),

No, it is true, sudo doesn’t set the proper environment, like exporting the
display. It is a pity, but that’s it. If it were you or me who said so, I
would doubt it, but knowing who said so, I have to believe it.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Hmm … maybe … that : :open_mouth:

/etc/sudoers
....
%wheel ALL=(ALL) NOPASSWD: ALL

That’s what I’m using too.

I was too lazy again to post the su method and thought sudo would be enough (as it worked for me probably for the reason I just explained). But here’s a method which should work for everyone (if if doesn’t, you’ll tell me)

  • logout from your session to go back to gdm login screen
  • switch to a tty with (I started gdm from tty1)
  • login as normal user and type the following
su -l
usermod -s /bin/bash gdm
passwd gdm
New Password: koeirklfjeoj98!43jfljkuioj_eoklk5
Reenter New Password: koeirklfjeoj98!43jfljkuioj_eoklk5 
exit
export DISPLAY=0:0
su gdm -c gnome-appearance-properties
Password: koeirklfjeoj98!43jfljkuioj_eoklk5
  • switch back to gdm login by pressing
  • set the preferences and click on “close” when you’re done
  • switch back to console with and type
su -l
passwd -d gdm
usermod -s /bin/false gdm
exit
exit
  -  switch back to gdm with <CTRL-ALT-F7> and login as user.

It doesn’t set the environment, for sure. But the login environment is not necessarely required for hacking things like that. Of course you have to use absolute path in commands.

Sorry for the typo here:

It should be:

export DISPLAY=:0.0

On 2010-11-30 01:36, please try again wrote:
>
> robin_listas;2259440 Wrote:
>>
>> No, it is true, sudo doesn’t set the proper environment, like exporting the
>> display. It is a pity, but that’s it. If it were you or me who said so, I
>> would doubt it, but knowing who said so, I have to believe it.
>>
>
> It doesn’t set the environment, for sure. But the login environment is
> not necessarely required for hacking things like that. Of course you
> have to use absolute path in commands.

Some parts are required for using some graphical programs successfully.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

The variable DISPLAY is not defined in the ‘login’ environment. It is set by the X client. Exporting it is all you need to run most GUI applications (I’m not talking about pulse and suches).

On 2010-11-29 20:06, malcolmlewis wrote:
>
> Hi
> @please_try_again: You must have changed something else, it doesn’t
> work. I get the same result (error) as Carlos both in SLED11 and
> openSUSE 11.4 M3.
>
> @bongo_zg, use the gconftool method. have a look here
> http://tinyurl.com/2cpqph8

That’s an interesting link.

A method to do what we want would be to put in
“/usr/share/gdm/autostart/LoginWindow/” the .desktop file we want to use,
like " /usr/share/applications/gnome-appearance-properties.desktop" or
“/usr/share/applications/gconf-editor.desktop”. Then we simply need to
reach the login window, and we should get that program.

Just tried it:

cp /usr/share/applications/gnome-appearance-properties.desktop
/usr/share/gdm/autostart/LoginWindow/
cp /usr/share/applications/gconf-editor.desktop
/usr/share/gdm/autostart/LoginWindow/

And hit the log out - log as another user. Bingo! There they are.

The last step is to remove those files afterwards.

I used the trick to remove the “list of user names”. It is too long - I
would prefer to select what users are displayed and which not.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)