34

when I lock my screen, I don't get the nice login dialog which is present after my laptop reboot. I get something ugly similar to this:

enter image description here

I googled this picture, it is not exact screenshot, but it is almost the same. How can I fix this? Is it standard behaviour or did I break something? The picture of burning screen scares me, but I repeat myself "Don't panic!" and it kinda helps a little.

  • It is ugly.
  • It does not look like the 99% of my environment.
  • I use multiple keyboard layouts. When typing password, I need to see which one is active, because otherwise I make typos in my password and have to try login multiple times. With this screen, I usually end up in exactly 3-5 tries, as I make wrong guesses and other accidental typos caused by nervousness.
  • Why is it called XScreenSaver? I disabled screensavers. I hate them. I want only to lock my computer while I go to bathroom or for a lunch. I want my login screen.
3
  • 1
    I had the same issue in Lubuntu, there is some discussion of it here: ubuntuforums.org/showthread.php?t=1908141 Check the link in his second post for more details.
    – Veazer
    Nov 12, 2012 at 19:00
  • Sounds reasonable. The only issue then is usability. Is there a way how to display which keyboard layout am I currently using? (However, I still think that 'consistency' has a huge usability impact too. It is not so much about cosmetics, it is also about navigation of the user etc.) Nov 12, 2012 at 21:15
  • I have no idea, I hadn't considered the keyboard issue. I moved back to gnome fallback after playing with xfce and lxde.
    – Veazer
    Nov 12, 2012 at 21:25

4 Answers 4

29

Remove xscreensaver and install gnome-screensaver which has a more polished look:

sudo apt-get remove xscreensaver
sudo apt-get install gnome-screensaver

You can also set a shortcut to lock the screen with the keyboard:

Start > Settings Manager > Keyboard > Application Shortcuts > Add

Command: xflock4

ShortCut: <Super>l ; (e.g. press the "Windows key" + l)

NOTE: The only potential downside to this is that gnome-screensaver will pull the gnome dependencies which in a very minimalistic desktop might not already be present. But on most average systems the gnome libraries are already installed anyway so there is no overhead.

6
  • Although you did not provide nice clarification as green7 did, I got solution of my issues from you, which I actually value more. Thus, I will accept your answer. The best answer would be combination of you two, but I have to choose one :) Feb 16, 2013 at 11:50
  • 1
    Nice to know: if you already have a full Xubuntu desktop, gnome-screensaver won't need any additional dependency. It will look nice without requiring too many additional resources.
    – gerlos
    Apr 17, 2014 at 12:03
  • 1
    There is no exactly screen saver in gnome-screensaver, only 'screen blanker'. Oct 12, 2017 at 7:02
  • @Serge: since we are getting down to terminology here, then if the app is not blanking the display then it is not really 'saving' your screen and your battery; you probably need an idle-display-energy-waster.
    – ccpizza
    Oct 12, 2017 at 11:09
  • I meant there is no xscreensaver-like functionality in gnome-screensaver. Also I see no keyboard layout indicator on gnome-screensaver lock screen. Oct 13, 2017 at 4:01
7

Xscreensaver is a package which is an extensible screen saver framework, and locks the computer.

According to this linuxfromscratch.org page.

The XScreenSaver is a modular screen saver and locker for the X Window System. It is highly customizable and allows the use of any program that can draw on the root window as a display mode. The purpose of XScreenSaver is to display pretty pictures on your screen when it is not in use, in keeping with the philosophy that unattended monitors should always be doing something interesting, just like they do in the movies. However, XScreenSaver can also be used as a screen locker, to prevent others from using your terminal while you are away.

I don't know the reason why it is used in Lubuntu and Xubuntu, but it might be because of the its popularity, stability, and probably it is light weight.

It also reduces the burden of building a new package to replace already existing software.

1
  • 1
    Thank you for explanation. You answered my question "Why is it called XScreenSaver?" and couple of my others to clear my confusion. However, you provided no solution for my issues, so I will accept ccpizza's answer. Feb 16, 2013 at 11:48
7

Do you like black? Try slock, it's the best example of the KISS principle.

To install it: sudo apt-get install suckless-tools

Then, the easiest way to configure it in xubuntu is: sudo apt-get remove xscreensaver

This is because by default xscreensaver takes precedence over other screensavers, slock among them. Once removed, you can either kill the xscreensaver thread already running in background or just restart.

Enjoy simplicity.

3
  • 1
    Simplicity is nice as far as it does not kill usability. In my question I mentioned I need to see which keyboard layout is active. Feb 16, 2013 at 11:44
  • Welcome to Ask Ubuntu! Please avoid posting the same answer in more than one place. When tempted to do so, this typically means: (1) the answer should be customized to account for what is different about the different questions, (2) one question should be flagged for closure as a duplicate of another question (you can flag posts with 15 reputation), (3) the answer should really be a comment, or (4) the answer should be posted in the most appropriate place, and one-line comments posted on the other questions summarizing and linking to it. Feb 16, 2013 at 14:16
  • Thanks, at first I was worried that it would also install the 9base tools, but these are in a different package. This is a very minimal solution and tough I use different layouts I'm not worried about that missing functionality. Arch wiki says it's not able to block tty access (sflock apparently does). Instead of uninstalling xscreensaver which would have — broken a meta package on GalliumOS — I commented out the section about the other lock_cmds in /usr/bin/xflock4.
    – LiveWireBT
    Oct 25, 2016 at 14:40
0

It's a bit easier to use the stock "White on Black" or "Black on Black" lock screens in X/Ubuntu 18.04.2 LTS using xfce4. This also applies to xfce4 installed on top of Ubuntu without the xubuntu-desktop package.

Package xscreensaver-data contains the default "White on Black" theme at /etc/X11/app-defaults/XScreenSaver.

Package xubuntu-default-settings contains /etc/skel/.Xdefaults, copied to ~/.Xdefaults during creation of any user account, which contains the "Black on Black" theme.

/etc/xdg/xfce4/xinitrc loads ~/.Xdefaults with code:

 # Has to go prior to merging Xft.xrdb, as its the "Defaults" file
 test -r "/etc/xdg/xfce4/Xft.xrdb" && XRESOURCES="$XRESOURCES /etc/xdg/xfce4/Xft.xrdb"
 test -r $HOME/.Xdefaults && XRESOURCES="$XRESOURCES $HOME/.Xdefaults"

 # ~/.Xresources contains overrides to the above
 test -r "$HOME/.Xresources" && XRESOURCES="$XRESOURCES $HOME/.Xresources"

To go back to default, delete ~/.Xdefaults.

To use the dark theme, use a command like:

 (mkdir -p /tmp/xubuntu-default-settings && cd /tmp/xubuntu-default-settings && apt download xubuntu-default-settings && dpkg -x xubuntu-default-settings*.deb . && cp etc/skel/.Xdefaults $HOME/)

Or:

 deb=xubuntu-default-settings ; apt download "$deb" && ar x "$deb"*.deb data.tar.xz && tar -C $HOME/ -xJf data.tar.xz ./etc/skel/.Xdefaults --strip-components=3 && rm data.tar.xz "$deb"*.deb

Use ~/.Xdefaults as a simple way to retheme the xscreensaver lock-screen based on the contents of the files previously noted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .