{"id":10,"date":"2014-05-31T08:52:00","date_gmt":"2014-05-30T22:52:00","guid":{"rendered":"https:\/\/www.serenux.com\/?p=10"},"modified":"2021-01-11T09:13:11","modified_gmt":"2021-01-10T23:13:11","slug":"howto-install-the-xscreensaver-packages-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.serenux.com\/index.php\/2014\/05\/31\/howto-install-the-xscreensaver-packages-on-ubuntu\/","title":{"rendered":"HowTo: Install the XScreensaver packages on Ubuntu"},"content":{"rendered":"\n<p>The XScreensaver packages are a series of fancy alternate screensavers that have a popular history. They are much more enjoyable than the boring default Ubuntu screensaver which is just\u2026 a black screen.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/web.archive.org\/web\/20150206051541\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/HypertorousXScreensaver.png\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20150206051541im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/HypertorousXScreensaver.png\" alt=\"The Hypertaurus XScreensaver\" class=\"wp-image-911\"\/><\/a><\/figure><\/div>\n\n\n\n<p>Unfortunately the XScreensavers package hasn\u2019t really been updated in awhile and doesn\u2019t integrate very nicely into the current flavours of Ubuntu without some manual tweaking, so that\u2019s exactly what I\u2019m going to cover right here.<\/p>\n\n\n\n<p><em><strong>Issues to deal with<\/strong><\/em><\/p>\n\n\n\n<p>This document will cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Installing the XScreensaver packages Configuring Ubuntu to use XScreensaver instead of the default gnome-screensaver<\/li><li>Configuring Ubuntu to lock the screen with the XScreensaver<\/li><li>Fixing the bad fonts issue in XScreensaver Setting a custom RSS feed for text-based XScreensaver packages<\/li><\/ul>\n\n\n\n<p>These instructions have been tested on Ubuntu 12.04 (Precise Pangolin) and 14.04 (Trusty Tahr).<\/p>\n\n\n\n<p><em><strong>Making it happen<\/strong><\/em><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open a terminal.<br><\/li><li>Uninstall the boring default Ubuntu screensaver with:<br><br><code>$ sudo apt-get remove gnome-screensaver<\/code><br><\/li><li>Install the XScreensaver packages with:<br><br><code>$ sudo apt-get install xscreensaver*<\/code><br><br>(note the asterisk on the end to install all xscreensaver packages)<br><\/li><li>Open the Dash (Ubuntu logo at the top-left of screen) and type in the word&nbsp;<em>\u201cstart\u201d<\/em>. An icon will appear referring to \u201cStartup Applications\u201d. Click on it.<br><\/li><li>The window that appears shows which applications will be started when you login to your machine. Click on the \u201cAdd\u201d button.<br><\/li><li>In the new window that appears, type&nbsp;<em>\u201cXScreensaver\u201d<\/em>&nbsp;into the Name field, then type in \u201c<em>xscreensaver -nosplash\u201d<\/em>&nbsp;into the Command field, then type in&nbsp;<em>\u201cStart the XScreensaver\u201d<\/em>&nbsp;into the Comment field.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20150206051541im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/StartupApps.png\" alt=\"StartupApps\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\"><li>Click on the&nbsp;<em>\u201cAdd\u201d<\/em>&nbsp;button&nbsp;and then click on the Close button on the previous window.<br><\/li><li>That takes care of starting the XScreensaver, so now let\u2019s fix the lock screen keyboard shortcut. Click on the Dash again and type in&nbsp;<em>\u201ckeyboard\u201d<\/em>&nbsp;and then click on the&nbsp;<em>\u201cKeyboard\u201d<\/em>&nbsp;icon.<br><\/li><li>In the window that appears, click on the&nbsp;<em>\u201cShortcuts\u201d<\/em>&nbsp;tab.<br><\/li><li>At the bottom of the left pane, click on&nbsp;<em>\u201cCustom Shortcuts\u201d<\/em>.<br><\/li><li>Click on the&nbsp;<em>\u201c+\u201d<\/em>&nbsp;button to add a new custom shortcut.<br><\/li><li>Give the shortcut a name, eg:&nbsp;<em>\u201cEnable the lockscreen\u201d<\/em>.<br><\/li><li>In the Command field, type in&nbsp;<em>\u201cxscreensaver-command -lock\u201d<\/em>&nbsp;and then click on the Apply button.<br><\/li><li>You will now see your new shortcut listed, but it doesn\u2019t have a keyboard combo for it yet, so click on the word&nbsp;<em>\u201cDisabled\u201d<\/em>&nbsp;with your mouse and it will change to&nbsp;<em>\u201cNew accelerator\u2026\u201d<\/em>.<br><\/li><li>Now using your keyboard, press the key combo you\u2019d like to use to lock your PC and start the XScreensaver. The default combo is CTRL+ALT+L but you can use any combo you like. If you do use CTRL+ALT+L you will be told that it\u2019s already in use by the Gnome-Screensaver (which you uninstalled earlier, remember?), so just tell it to reassign it to your shortcut.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20150206051541im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/LockScreenKeyboardCombo.png\" alt=\"LockScreenKeyboardCombo\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"16\"><li>Close the keyboard settings window.<br><\/li><li>Now we need to sort out the fonts. The way XScreensaver looks for fonts is not like any other application. It needs to have a predefined list of available fonts, so we need to provide that list. We will get the&nbsp;<em>\u201cUbuntu Font Family\u201d<\/em>&nbsp;(that comes with current releases of Ubuntu)&nbsp;enabled for use in XScreensaver, but you can apply this to any of the font folders on your machine.<br><\/li><li>In your terminal, type in the following:<br><br><code>$ cd \/usr\/share\/fonts\/truetype\/ubuntu-font-family<br>$ sudo mkfontscale<br>$ sudo mkfontdir<\/code><br><\/li><li>Repeat the above for all the fonts you wish to add to your system, eg: substitute the path&nbsp;<em>\/usr\/share\/fonts\/truetype\/msttcorefonts<\/em>&nbsp;for the Microsoft fonts from the u<em>buntu-restricted-packages<\/em>&nbsp;meta-package or the&nbsp;<em>ttf-mscorefonts-installer<\/em>&nbsp;package.<br><\/li><li>Create a new file (or edit any existing file) as follows:<br><br>$ sudo nano \/usr\/share\/X11\/xorg.conf.d\/50-fonts.conf<br><\/li><li>Type\/paste in the following into your new file:<br><br><code>Section \"Files\"<br> &nbsp; &nbsp; FontPath \"\/usr\/share\/fonts\/truetype\/ubuntu-font-family\"<br>EndSection<\/code><br><\/li><li>Add as many FontPath entries you need between the&nbsp;<em>Section\/EndSection<\/em>&nbsp;block for all the fonts you want available that you ran step 18 on.<br><\/li><li>Save your changes with CTRL+X, then \u201cY\u201d and then Enter.<br><\/li><li>Now type in the following to enable the fonts now (or simply reboot):<br><br><code>$ xset +fp \/usr\/share\/fonts\/truetype\/ubuntu-font-family<br>$ xset fp rehash<\/code><br><\/li><li>Repeat the&nbsp;<em>xset +fp &lt;path&gt;&nbsp;<\/em>command as many times as required to add all the fonts you setup in Step 18 before the&nbsp;<em>xset fp rehash<\/em>&nbsp;command, or simply reboot to do them all in one hit from your X11 config file in step 21.<br><\/li><li>Now we\u2019re ready to fix the fonts in XScreensaver. In this example we\u2019re going to fix the fonts in the StarWars screensaver. What exactly is wrong with the fonts in the StarWars screensaver I hear you ask?<br><br>Simply this:<br><a href=\"https:\/\/web.archive.org\/web\/20150206051541\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/StarWarsScreensaver-before.png\"><\/a><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20150206051541im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/StarWarsScreensaver-before.png\" alt=\"Ugly fonts in the StarWars screensaver\"\/><figcaption>Yuck<\/figcaption><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"27\"><li>Click on the Dash and then type in&nbsp;<em>\u201cscreensaver\u201d<\/em>. An icon called&nbsp;<em>\u201cScreensaver\u201d<\/em>&nbsp;will appear below it. Click on it.<br><\/li><li>In the Screensaver Preferences window that appears, scroll down the list of available screensavers to find&nbsp;<em>\u201cStarWars\u201d<\/em>. Click on it to highlight it.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20150206051541im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/XScreensaverPrefsTool.png\" alt=\"The XScreensaver Preferences Tool\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"29\"><li>A preview of the screensaver will appear in the pane on the right. You will notice that the font in the screensaver looks awful as in the above image.<br><\/li><li>Click on the&nbsp;<em>\u201cSettings\u2026\u201d<\/em>&nbsp;button. A new window will appear.<br><\/li><li>In the Settings window, click on the&nbsp;<em>\u201cAdvanced&gt;&gt;\u201d<\/em>&nbsp;button at the bottom. The window content will change.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20150206051541im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/StarWarsPrefs01.png\" alt=\"Star Wars Preferences Advanced Settings\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"32\"><li>You will see the command line that starts the screensaver. Modify the line so that it looks like:<br><br><code>starwars -root -font \"-misc-ubuntu-bold-r-normal--180-0-0-0-p-0-iso8859-1\"<\/code><br><\/li><li>Click OK and repeat this modification to any other screensaver that uses a proportional font in its text, for example the FlipText screensaver.<br><\/li><li>Finally, let\u2019s set a custom RSS feed for the screensavers that use text so that they show something useful. Click on the&nbsp;<em>\u201cAdvanced\u201d<\/em>&nbsp;tab in the Screensaver Preferences window.<br><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20150206051541im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/SettingRSSFeed.png\" alt=\"Setting the RSS Feed for the XScreensaver\"\/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"35\"><li>At the bottom-left in the&nbsp;<em>\u201cText Manipulation\u201d<\/em>&nbsp;section, make sure&nbsp;<em>\u201cURL\u201d<\/em>&nbsp;is selected and change the URL text to your favourite RSS feed\u2019s URL, for example ITNews\u2019 RSS feed for \u201call content\u201d is:<br><br><a rel=\"noreferrer noopener\" href=\"https:\/\/web.archive.org\/web\/20150206051541\/http:\/\/www.itnews.com.au\/RSS\/rss.ashx\" target=\"_blank\"><code>http:\/\/www.itnews.com.au\/RSS\/rss.ashx<\/code><\/a><br><\/li><li>Test the StarWars screensaver now by clicking on&nbsp;the&nbsp;<em>\u201cDisplay Modes\u201d<\/em>&nbsp;tab and then select&nbsp;<em>\u201cStarWars\u201d<\/em>&nbsp;from the left pane to make it appear in the&nbsp;preview window. The time the fonts should look much nicer as follows:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20150206051541im_\/http:\/\/www.serenux.com\/wp-content\/uploads\/2014\/05\/StarWarsScreensaver-after.png\" alt=\"Much nicer\"\/><figcaption>Much nicer!<\/figcaption><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"37\"><li>Now go through the list of screensavers, enabling and disabling those that you want to use. As you click each one, its preview will appear on the right.<br><\/li><li>Set the&nbsp;<em>Blank After, Cycle After<\/em>&nbsp;and&nbsp;<em>Lock Screen After<\/em>&nbsp;values accordingly, eg: 10 minutes a piece.<br><\/li><li>Close the Screensaver Preferences window and test locking your PC by pressing CTRL+ALT+L or whatever combo you set in step 15, and your screen should fade out and start displaying a random screensaver from your list of enabled screensavers. When you move the mouse or press a key, a login prompt should appear.<br><\/li><li>Pat yourself on the back. You are done.<\/li><\/ol>\n\n\n\n<p><em><strong>Choosing your own font to use instead of the Ubuntu Font Family fonts<\/strong><\/em><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Choosing your own font is simple. For each set of fonts that you processed in Step 18, type in the following, using the Ubuntu Font Family as this example:<br><br>$ cat \/usr\/share\/fonts\/truetype\/ubuntu-font-family\/fonts.dir<br><\/li><li>This lists all the possible fonts available for that family. Copy to the clipboard the font description you wish to use.<br><\/li><li>Paste the description as the font argument in the command line of the screensaver you wish to modify.Note that you will need to adjust the font size\/quality value in your command line because they are rendered as scaled bitmaps, not outlines. For example, in Step 32 we specify the font size to be&nbsp;<em>\u201c180\u201d<\/em>&nbsp;so that the fonts appear smooth and clean when scaled. If you don\u2019t specify this, then the font will be generated into a bitmap using the smallest size before being scaled up in the screensaver, resulting in pixelated fonts.<br><br><em>SPECIAL NOTE: Some screensavers require proportional fonts to be used and others require fixed-width fonts. If you try to use the wrong type of font, the screensaver will likely crash.<\/em><br><\/li><li>Choose the appropriate font type from the list of available fonts.<br><\/li><li>Preview your screensaver and make adjustments as required. If you\u2019d like to test the screensaver directly without running up the Preferences tool, launch the screensaver binary in a terminal with the font description as an argument.<br><br>For example, for the StarWars screensaver, you can run it in a window as follows:<br><br><code>\/usr\/lib\/xscreensaver\/starwars -font \"-misc-ubuntu-bold-r-normal--180-0-0-0-p-0-iso8859-1\"<\/code><br><\/li><li>Pat yourself on the back again. You are done.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The XScreensaver packages are a series of fancy alternate screensavers that have a popular history. They are much more enjoyable than the boring default Ubuntu screensaver which is just\u2026 a black screen. Unfortunately the XScreensavers package hasn\u2019t really been updated in awhile and doesn\u2019t integrate very nicely into the current flavours of Ubuntu without some [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":2,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":14,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/10\/revisions\/14"}],"wp:attachment":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}