![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Just Give Me the Beans!
![]() |
EDIT: An improved, multi-user friendly version available on page 3. Clickity:
http://ubuntuforums.org/showthread.p...33#post5427233 ----------------------------------- One of my pet peeves with GDM has been that after logging in, it always turns the screen to a certain color (default = light brown, though this can be changed). I feel that showing the users wallpaper or the users background color, while starting up the session, feels more polished. Here's how to achieve it, if you feel the same way: 1) We need the install the package xloadimage, which contains the app 'xsetbg' Code:
sudo aptitude install xloadimage Code:
sudo gedit /etc/gdm/PostLogin/Default Code:
#!/bin/sh # # Note that output goes into the .xsession-errors file for easy debugging # # Extract the wallpaper filename WALLPAPER="`cat ~/.gconf/desktop/gnome/background/%gconf.xml | sed -n -e 'N s/^[ \t]*<entry name="picture_filename".*\n[ \t]*<stringvalue>\(.*\)<\/stringvalue>.*$/\1/ip'`" # Check if the wallpaper file exists. If yes - draw it, if no - use primary background color if [ -e "$WALLPAPER" ] && [ -f "$WALLPAPER" ] ; then xsetbg -onroot "$WALLPAPER" else PRIMARY_COLOR="`cat ~/.gconf/desktop/gnome/background/%gconf.xml | sed -n -e 'N s/^[ \t]*<entry name="primary_color".*\n[ \t]*<stringvalue>\(.*\)<\/stringvalue>.*$/\1/ip'`" xsetroot -cursor_name left_ptr -solid "$PRIMARY_COLOR" fi exit 0 This script will check for a wallpaper setting, and use 'xsetbg' to draw it to the root window. If a wallpaper image does not exist, it will fill the screen with the desktop background color. Don't forget to make this script executable: Code:
sudo chmod +x /etc/gdm/PostLogin/Default Code:
sudo mv -v /etc/gdm/PreSession/Default /etc/gdm/PreSession/Default.bak Problems There are three problems that this script doesn't or can't handle. 1) If you use a gradient as your desktop background, it will not be displayed. The screen will be filled with just one color (the primary color in the gradient) 2) If your wallpaper is scaled to fit, I suggest you resize it so that it matches your desktop as this script will not do that for you. You can, in theory, use the '-background' switch, coupled with '-border black', '-smooth' and (for png's) '-gamma 2.0', but I've found that 'xsetbg' can't properly scale to fit a lot of images (depending on their resolution, it may leave empty vertical/horizontal space at the edges) and the quality of scaled images is sub-par. I suggest you just resize the wallpaper to fit your resolution in GIMP. 3) If you use desktop effects then at one point the desktop might turn black. I haven't figured out yet, how to avoid this. There you go, I hope this is useful for somebody (Tested on Hardy Heron, but should work on older versions too.) Update: Instructions on how to reverse the modifications If for some reason the script isn't working out for you (due to the black screen problem or for whatever other reason), you can revert the effect with: Code:
sudo rm /etc/gdm/PostLogin/Default sudo mv /etc/gdm/PreSession/Default.bak /etc/gdm/PreSession/Default Last edited by kirsis; July 21st, 2008 at 02:59 AM.. Reason: Updated instructions |
|
|
|
|
|
#2 |
|
Way Too Much Ubuntu
![]() |
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
|
|
|
|
|
|
#3 |
|
Just Give Me the Beans!
![]() |
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
Damn, ADHD strikes again
The PostLogin/Default file has to be executable, thanks for catching that |
|
|
|
|
|
#4 |
|
Way Too Much Ubuntu
![]() Join Date: Mar 2007
Location: Glasgow
Beans: 285
Ubuntu Jaunty Jackalope (testing)
|
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
I have been looking for something like this for ages.
I even asked for something simliar to be intergrated into gutsy at the time. Thanks. |
|
|
|
|
|
#5 |
|
5 Cups of Ubuntu
![]() Join Date: Jun 2007
Beans: 44
|
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
Worked perfectly (after I resized my wallpaper to my resolution, as you suggested)!!! I have compiz enabled, and the graphical blinks/redraws are minimal (using a ATI Radeon 9200).
|
|
|
|
|
|
#6 |
|
Just Give Me the Beans!
![]() |
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
Glad you like it, guys
The compiz effect differs from PC to PC. For me the screen turns black for a few seconds, but for my buddy, who is also using this trick + compiz, the screen doesn't turn black at any point. |
|
|
|
|
|
#7 |
|
A Carafe of Ubuntu
![]() Join Date: Mar 2008
Location: Vimercate (MI), Italy
Beans: 126
Ubuntu 8.10 Intrepid Ibex
|
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
I'm running Hardy, and I already get this "effect" out of the box, by just setting the login background as my desktop background (speaking of colors)
Instead, following your how-to just gives me a black screen until gnome is fully loaded Btw: I too noticed that compiz turns the background black, but it happens just sometimes
__________________
2B OR (NOT 2B) That is the question. The answer is FF |
|
|
|
|
|
#8 |
|
Just Give Me the Beans!
![]() |
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
Setting the log in screen background to your desktop doesnt work as nicely for multiple users on one computer. This way every user sees his/her wallpaper + you dont have to think about matching gdm themes/backgrounds
It's odd that you got a persistent black screen. Is your desktop background color set to black (if its not using a wallpaper)? It appears to me that xsetbg fails to find your wallpaper and instead sets your desktop to the primary background color. If your background color is not black, then it must be some external effect, because AFAIK if xsetbg failed, you should be seeing what you always saw before it. At any rate, you can revert to your previous configuration with: Code:
sudo rm /etc/gdm/PostLogin/Default sudo mv /etc/gdm/PreSession/Default.bak /etc/gdm/PreSession/Default |
|
|
|
|
|
#9 |
|
Ubuntu Extra Shot
![]() Join Date: Mar 2007
My beans are hidden!
|
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
Why is this nasty hack needed when in feisty the wallpaper worked right?
|
|
|
|
|
|
#10 | ||
|
Just Give Me the Beans!
![]() |
Re: HOWTO: (GDM) Show the user wallpaper/background color, while logging in
Quote:
Quote:
|
||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|