Making productive use of the XScreenSaver to display text instead of Conky

Forum Forums General Tips and Tricks Making productive use of the XScreenSaver to display text instead of Conky

Tagged: ,

  • This topic has 48 replies, 6 voices, and was last updated Jun 13-5:47 pm by BobC.
Viewing 15 posts - 1 through 15 (of 49 total)
  • Author
    Posts
  • #9931
    Moderator
    BobC

      Concept: I really don’t care that much about screen space when the screensaver is running. What a great opportunity to display things I want to know, things I need to remember, or some fun things here or there, too… And can it look appealing, too?

      So Xscreensaver has on the advanced tab a Text Manipulation option that includes the ability to display a file or even run a program and display what would normally go to standard output.

      I never could remember the Keyboard shortcuts for IceWM because I don’t see them and never use them. Its a viscous circle because not using them, or seeing them, I’ll never learn them, either.

      Why not use the screensaver to teach me things that I want to learn or remember, but never have time to?

      So 736 graciously wrote a Python to take the ~/.icewm/keys file and make readable text out of the key assignments. I’ve been wanting to learn Python, so that’s really pretty cool.

      I’m also learning shell scripting, and have a bloated conky that has a news feed and weather, both of which would be nice parts of a sceensaver text sequence, and could be made to popup on demand with a button, menu option or shortcut key.

      And what about a daily events calendar? To do list? Multiple news feeds?

      So, I’m thinking about it as a shell program that runs a script that processes all the executable files in a folder, like /etc/xscreensaver.d, sorted, and each program that runs sends its output to the standard output and appears as the text in the screensaver.

      For example:

      0010dispicekeys.sh
      0020dispicepreferences.sh
      0030dispnewsfeednpr.sh
      0040dispnewsfeedbbc.sh
      0050dispcurrentweather.sh
      0060dispweather7d.sh
      0070disptodolist.sh
      0080disptodaysevents.sh
      0090dispcalendar.sh

      Add a screensaver that displays text in a cool way like Starwars, tweak the scroll speed, and it will both look nice as well as be functional and configurable.

      • This topic was modified 5 years ago by BobC.
      #9934
      Member
      sleekmason
        Helpful
        Up
        0
        ::

        Bob, that would be really neat. Cool idea!

        #9936
        Moderator
        BobC
          Helpful
          Up
          0
          ::

          I think if you install this package, it will install the rest that are needed.

          sudo apt-get update
          sudo apt-get install xscreensaver-gl-extra

          Once installed its on the menu under Applications, Preferences, then Screensaver.

          I haven’t written the script that runs all the programs in the directory in numerical order, yet, just experimenting with a simpler script currently.

          What else is nice about it is that it uses no system resources at all while you are working, and only runs when the system is bored.

          PS: One more thought. If I make a Links file with URL links as one of the files to be displayed, then I could assign a key, like Ctrl-Alt-F1 to run the program that generates everything for the screensaver, redirected to a file, and then open that file in a browser and be able to search or scroll through it, or click a link for something, all on demand, from one key. I could easily get to the story from a news feed, or help file, or wiki, or FAQ page, etc.

          • This reply was modified 5 years ago by BobC.
          • This reply was modified 5 years ago by BobC.
          • This reply was modified 5 years ago by BobC.
          #9943
          Moderator
          Brian Masinick
            Helpful
            Up
            0
            ::

            Interesting approach! I usually just display the system info along with the date and time, slowly moving back and forth across the screen; nothing fancy.

            I’d love to see an example and the scripts you are using and decide if I will *change my approach* to my screensaver.

            --
            Brian Masinick

            #9944
            Moderator
            BobC
              Helpful
              Up
              0
              ::

              Ok, at this point I have:
              keys
              preferences
              master help key
              current weather
              7 day weather forecast

              Working on:
              news feeds

              Here is a pic of what it looks like now…

              #9946
              Forum Admin
              Dave
                Helpful
                Up
                0
                ::

                That is very interesting. Cannot wait for you to share the finished product!

                Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

                #9950
                Member
                ohh
                  Helpful
                  Up
                  0
                  ::

                  BobC,

                  That is really cool, I look forward to the finished script.

                  cheers,
                  ohh

                  Every matter requires prior knowledge.

                  - Du Mu
                  The Art of War

                  #9957
                  Moderator
                  BobC
                    Helpful
                    Up
                    0
                    ::

                    I decided that it should take the text file and save it to /tmp including links etc, and filter out links (and maybe other stuff, maybe optionally, like news feed details) before sending to the screen saver feed.

                    On the popup of the file in the browser, it should create a current file, and then generate a main page and sidebar, where the main page is links to all the main help stuff (a premade page inserted from a file), and the sidebar is a generated index of the pages from the programs that ran to create the text, so that way you can easily jump to any of the pages, in case you want to click a link from one or search from there.

                    What should I call this? Sounds like a dumb question, but because I have such a Vanilla mentality about such things, I know what I want, but can’t think a good name for it.

                    Any suggestions? my first thought is ScreenSaverTextnBrowse or SSTnBrowse for short, and program name sstnbrowse

                    PS: to any of you that know coding in the Linux world, any suggestions, comments or criticisms on the idea or how to do it, before I create all this would be appreciated

                    Ok, here is my idea for an rss feed, 3 parameters, 1-URL 2-baseoffilename 3-maxlines. Command loading 3 variables (this is just for experimenting, as they would normally be passed as parameters, I think, allowing one rss feed script to bring in many feeds and making it easy for the user to add new ones) and running test follows to get first 25 lines of BBC news feed. Note that I’m also storing the raw file to be used when you hit the hotkey to bring everything up in the browser so that you have all the other fields and links when you do that.

                    $ myurl=http://feeds.bbci.co.uk/news/rss.xml && \
                    > myfile=0200rssBBC && \
                    > mymaxlines=25 && \
                    > curl -s $myurl > /tmp/sstnb_rss_raw_$myfile.xml && cat /tmp/sstnb_rss_raw_$myfile.xml | grep "<title>" | \
                    > sed "s/^ \+<title><\!\[CDATA\[//g;s/\]\]><\/title>//;" | grep -v "<title>" | head -n $mymaxlines > /tmp/sstnb_rss_text_$myfile.txt && \
                    > cat /tmp/sstnb_rss_text_$myfile.txt

                    BBC News – Home
                    UK-EU customs partnership ‘still on table’
                    ‘Promising’ boy, 17, dies in Southwark shooting
                    Bank Holiday weekend brings blue skies and sunshine
                    Air France could ‘disappear’ as more strikes begin
                    Near miss for Tour de Yorkshire volunteer
                    Facebook privacy: Survey suggests continuing US loyalty
                    Junior doctors’ job offers withdrawn after blunder
                    Tories urged to act in ‘racist joke’ row at Pendle Council
                    Sir Alex Ferguson: Former Manchester United boss remains in intensive care
                    Doctor Foster star Suranne Jones pulls out of West End play
                    Boys aged 12 and 15 shot in north-west London
                    Andrew Marr to have kidney operation
                    Arsenal score five in Wenger’s Emirates farewell
                    Royal baby photo brings back precious memories for families
                    Friendly seal nuzzles up to diver in Isle of Man
                    Helping young people see poetry in their daily lives
                    Isla, 7, is creating her own legacy with painted stones
                    Japan bus drivers: Strikes with a difference
                    The café staffed by disabled people
                    Prince Louis and Princess Charlotte seen at home in new photos
                    Fishing nets and false teeth: Meet the beach debris hunters
                    Harry and Meghan souvenir mugs are Derek’s bestseller
                    ‘Pinhole photography’ from our readers
                    Survival and division in Iraq after IS
                    $

                    • This reply was modified 5 years ago by BobC.
                    • This reply was modified 5 years ago by BobC.
                    • This reply was modified 5 years ago by BobC.
                    #10044
                    Moderator
                    BobC
                      Helpful
                      Up
                      0
                      ::

                      I got the screen saver itself working pretty well now. Need to work on the web browser idea more and create modularized scripts and the directory processor. Here is a high speed video of it and the script used to create it thus far. The scripts for the weather related pages are in the recent conky thread.

                      posting video from phone will add script here.  My apologies to 736, i have to come back to the python later after I have this working...
                      
                      echo  > ~/.icewm/icekeys.txt
                      echo 'IceWM - Keyboard Shortcut from Keys' >> ~/.icewm/icekeys.txt
                      cat /home/bobc/.icewm/keys | sed -e '/^#key /Id' | sed -e '/^###/d' | sed -e 's/^key //Ig' | sed -e 's/\"//g' >> ~/.icewm/icekeys.txt
                      echo  >> ~/.icewm/icekeys.txt
                      echo 'IceWM - Keyboard Shortcuts from Preferences' >> ~/.icewm/icekeys.txt
                      cat /home/bobc/.icewm/preferences | grep -e '^Key' | sed -e 's/Key//g' | sed -e 's/\"//g' | sed -e 's/\=/ /g' >> ~/.icewm/icekeys.txt
                      echo  >> ~/.icewm/icekeys.txt
                      echo 'Chicago Weather Conditions and 7 day Forecast' >> ~/.icewm/icekeys.txt
                      /bin/bash getweatherc.sh KORD >> ~/.icewm/icekeys.txt
                      echo  >> ~/.icewm/icekeys.txt
                      cat /var/tmp/getweather7d.tmp05.txt >> ~/.icewm/icekeys.txt
                      echo  >> ~/.icewm/icekeys.txt
                      
                      myrssheading='BBC News Feed'
                      myurl=http://feeds.bbci.co.uk/news/rss.xml && \
                      myfile=0200rssBBC && \
                      mymaxlines=25 && \
                      myshowdescr=yes && \
                      echo  > /tmp/sstnb_rss_raw_$myfile.xml
                      echo " <title><![CDATA[$myrssheading - $myurl]]></title>" >> /tmp/sstnb_rss_raw_$myfile.xml
                      curl -s $myurl >> /tmp/sstnb_rss_raw_$myfile.xml
                      if [[ "$myshowdescr" == "yes" ]]; then
                      	cat /tmp/sstnb_rss_raw_$myfile.xml | grep -E "<title>|<description>" > /tmp/sstnb_rss_text_$myfile.tmp10 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp10 | sed "s/^ \+<title><\!\[CDATA\[//g;s/\]\]><\/title>//;" > /tmp/sstnb_rss_text_$myfile.tmp20 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp20 | sed "s/^ \+<description><\!\[CDATA\[/   /g;s/\]\]><\/description>//;" > /tmp/sstnb_rss_text_$myfile.tmp30 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp30 | grep -v "<title>" | head -n $mymaxlines > /tmp/sstnb_rss_text_$myfile.txt && \
                      	cat /tmp/sstnb_rss_text_$myfile.txt >> ~/.icewm/icekeys.txt
                      else
                      	cat /tmp/sstnb_rss_raw_$myfile.xml | grep -E "<title>" > /tmp/sstnb_rss_text_$myfile.tmp10 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp10 | sed "s/^ \+<title><\!\[CDATA\[//g;s/\]\]><\/title>//;" > /tmp/sstnb_rss_text_$myfile.tmp20 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp20 | grep -v "<title>" | head -n $mymaxlines > /tmp/sstnb_rss_text_$myfile.txt && \
                      	cat /tmp/sstnb_rss_text_$myfile.txt >> ~/.icewm/icekeys.txt
                      fi
                      echo  >> ~/.icewm/icekeys.txt
                      
                      myrssheading='ABC World News Feed'
                      myurl=https://abcnews.go.com/abcnews/internationalheadlines && \
                      myfile=0200rssABCW && \
                      mymaxlines=25 && \
                      myshowdescr=no && \
                      echo  > /tmp/sstnb_rss_raw_$myfile.xml
                      echo " <title><![CDATA[$myrssheading - $myurl]]></title>" >> /tmp/sstnb_rss_raw_$myfile.xml
                      curl -s $myurl >> /tmp/sstnb_rss_raw_$myfile.xml
                      if [[ "$myshowdescr" == "yes" ]]; then
                      	cat /tmp/sstnb_rss_raw_$myfile.xml | grep -E "<title>|<description>" > /tmp/sstnb_rss_text_$myfile.tmp10 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp10 | sed "s/^ \+<title><\!\[CDATA\[//g;s/\]\]><\/title>//;" > /tmp/sstnb_rss_text_$myfile.tmp20 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp20 | sed "s/^ \+<description><\!\[CDATA\[/   /g;s/\]\]><\/description>//;" > /tmp/sstnb_rss_text_$myfile.tmp30 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp30 | grep -v "<title>" | head -n $mymaxlines > /tmp/sstnb_rss_text_$myfile.txt && \
                      	cat /tmp/sstnb_rss_text_$myfile.txt >> ~/.icewm/icekeys.txt
                      else
                      	cat /tmp/sstnb_rss_raw_$myfile.xml | grep -E "<title>" > /tmp/sstnb_rss_text_$myfile.tmp10 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp10 | sed "s/^ \+<title><\!\[CDATA\[//g;s/\]\]><\/title>//;" > /tmp/sstnb_rss_text_$myfile.tmp20 && \
                      	cat /tmp/sstnb_rss_text_$myfile.tmp20 | grep -v "<title>" | head -n $mymaxlines > /tmp/sstnb_rss_text_$myfile.txt && \
                      	cat /tmp/sstnb_rss_text_$myfile.txt >> ~/.icewm/icekeys.txt
                      fi
                      echo  >> ~/.icewm/icekeys.txt
                      	
                      cat ~/.icewm/icekeys.txt
                      
                      

                      https://youtu.be/oeF9fxku95w

                      • This reply was modified 4 years, 12 months ago by BobC.
                      #10135
                      Moderator
                      BobC
                        Helpful
                        Up
                        0
                        ::

                        I have it working now for text and rss feeds, but not html pages, as I haven’t worked on converting them to text acceptable by the xscreensaver run program option, yet…

                        I also need to figure out how to make the text files into html in order to add my browse hotkey into browser view mode to be able to click the links…

                        It creates a log when it runs (was needed to debug)

                        gen_sstnb - xscreensaver.d run list processing starting at 2018-05-10 02:02:53 with output to txt
                           processing 0300.txt.iceprefkhelp next
                           processing 0300.txt.iceprefkhelp now
                           processing 0320.txt.icekeyshelp next
                           processing 0320.txt.icekeyshelp now
                           processing 0400.txt.weatherconditions next
                           processing 0400.txt.weatherconditions now
                           processing 0420.txt.weatherforecast next
                           processing 0420.txt.weatherforecast now
                           processing 0440.html.wttrinforecast next
                           processing 0440.html.wttrinforecast now
                           processing 0500.xml.abcworldnews next
                           processing 0500.xml.abcworldnews now
                           processing 0520.xml.bbcnews next
                           processing 0520.xml.bbcnews now
                        gen_sstnb - xscreensaver.d processing completed at 2018-05-10 02:02:56 with output to txt

                        Here is the program that runs the programs in /etc/xscreensaver.d

                        #!/bin/bash
                        # gen_sstnb - generate screen saver output to display or browse 
                        # parm1 = mode, www if browse, else generate text
                        datetime=<code>date '+%Y-%m-%d %H:%M:%S'</code>
                        format=$1
                        if [[ "$format" != "www" ]]; then
                        	format=txt
                        fi
                        # run all executable files in the current directory
                        cd /etc/xscreensaver.d
                        printf "\n\ngen_sstnb - xscreensaver.d run list processing starting at $datetime with output to $format\n" >> /tmp/gen_sstnb.log
                        for runfile in *
                        do
                        	printf "   processing $runfile next\n" >> /tmp/gen_sstnb.log
                        	if [ -x "$runfile" ]; then
                        		printf "   processing $runfile now\n" >> /tmp/gen_sstnb.log
                        		./$runfile $format
                        	else
                        		printf "   ERROR cannot process $runfile - not executable\n" >> /tmp/gen_sstnb.log
                        	fi
                        done
                        datetime=<code>date '+%Y-%m-%d %H:%M:%S'</code>
                        printf "gen_sstnb - xscreensaver.d processing completed at $datetime with output to $format\n\n" >> /tmp/gen_sstnb.log

                        And here is the program it runs for the ~/.icewm/keys file

                        #!/bin/bash
                        # Parm 1 - www if xml for browser output wanted, otherwise txt
                        format=$1
                        if [[ "$format" != "txt" ]]; then
                        	format=www
                        fi
                        printf "\n\nIceWM - Keyboard Shortcuts from Keys file\n" > /tmp/sstnb_icekeyshelp.txt
                        # we only want active keyboard shortcuts, show comment lines that don't start with ###, strip off key and quotes
                        cat /home/bobc/.icewm/keys | sed -e '/^#key /Id' | sed -e '/^###/d' | sed -e 's/^key //Ig' | sed -e 's/\"//g' >> /tmp/sstnb_icekeyshelp.txt
                        # what you cat is what you get
                        cat /tmp/sstnb_icekeyshelp.txt
                        • This reply was modified 4 years, 12 months ago by BobC.
                        • This reply was modified 4 years, 12 months ago by BobC.
                        • This reply was modified 4 years, 12 months ago by BobC.
                        #10196
                        Moderator
                        BobC
                          Helpful
                          Up
                          0
                          ::

                          I got it working. I decided just to limit it to feeding the screensaver, figuring that the URL’s of the pages to load won’t change much, and so I could just create a hotkey to open a browser with those tabs, and that will be good enough. I’ll post the code in a tar or zip file and a video of it running later tonight. Thanks for the ideas and help, everyone.

                          #10207
                          Moderator
                          BobC
                            Helpful
                            Up
                            0
                            ::

                            See the last post for the zip file, it includes examples.

                            Any executable file in /etc/xscreensaver.d will be processed, and whatever is sent to std output will go to the screensaver
                            and any .txt file put there will go to the screensaver

                            There are scripts there for icewm keys and preferences.

                            If a line begins with #key it will be ignored, so commented out keys don’t get displayed
                            if you add comments to the end of key assignment lines with a # with a space on each side they will appear nicely as — to separate the key from its function

                            There are examples of news feeds, which are basically rss feeds from a web URL. If you want a different one, copy one and change the copy. There are options for the maximum number of lines and whether or not to show description lines

                            I also included 3 examples of weather conditions and forecasts, basically just taking the text, adjusting it so it looks better and sending it to std output

                            On xscreensaver you need the starwars screensaver installed and selected, go to it on the select screen, see pic starwars_sst

                            If you go to the settings tab it should look like the settings pic

                            If you find that the text is misaligned, maybe try using a different font, which you can change using the advanced button off the settings tab and adding -font -xos4-terminus-medium-r-normal–32-320-72-72-c-160-iso10646-1 to the command line as shown in the addfont pic. If you actually find a font that can display wttr.in correctly, please post it here. I spent many hours trying and had to settle for ugly boxes due to UTF-8 not being properly handled by anything that I could find.

                            I will have to add the zip file to a different post, as I can’t add any more attachments to this one

                            On the xscreensaver program you need to go to the advanced tab and change it to run a program called gen_sst, see pic gen_sst

                            • This reply was modified 4 years, 11 months ago by BobC.
                            #10212
                            Moderator
                            BobC
                              Helpful
                              Up
                              0
                              ::

                              See the last post for the zip file.

                              • This reply was modified 4 years, 11 months ago by BobC.
                              #10215
                              Moderator
                              BobC
                                Helpful
                                Up
                                0
                                ::

                                I did find a site that explains how to install fonts for xscreensaver, and I actually did get one I had hoped would solve it installed and in use, but it was worse instead. Oh well, another 3 hours wasted on it. Reposting here in case that post goes away. Its close enough to be able to make it work if you had a font that worked…

                                https://freakarian.blogspot.com/2015/01/howto-install-xscreensaver-packages-on.html

                                HowTo Install the XScreensaver packages on Ubuntu

                                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… a black screen.

                                Unfortunately the XScreensavers package hasn’t really been updated in awhile and doesn’t integrate very nicely into the current flavours of Ubuntu without some manual tweaking, so that’s exactly what I’m going to cover right here.

                                Issues to deal with

                                This document will cover the following:
                                Installing the XScreensaver packages Configuring Ubuntu to use XScreensaver instead of the default gnome-screensaver
                                Configuring Ubuntu to lock the screen with the XScreensaver
                                Fixing the bad fonts issue in XScreensaver Setting a custom RSS feed for text-based XScreensaver packages

                                These instructions have been tested on Ubuntu 12.04 (Precise Pangolin) and 14.04 (Trusty Tahr).

                                Making it happen
                                Open a terminal.
                                .
                                Uninstall the boring default Ubuntu screensaver with:$ sudo apt-get remove gnome-screensaver

                                Install the XScreensaver packages with:$ sudo apt-get install xscreensaver*

                                (note the asterisk on the end to install all xscreensaver packages)
                                .
                                Open the Dash (Ubuntu logo at the top-left of screen) and type in the word“start”. An icon will appear referring to “Startup Applications”. Click on it.
                                .
                                The window that appears shows which applications will be started when you login to your machine. Click on the “Add” button.
                                .
                                In the new window that appears, type “XScreensaver” into the Name field, then type in “xscreensaver -nosplash” into the Command field, then type in“Start the XScreensaver” into the Comment field.
                                Click on the “Add” button and then click on the Close button on the previous window.
                                .
                                That takes care of starting the XScreensaver, so now let’s fix the lock screen keyboard shortcut. Click on the Dash again and type in “keyboard” and then click on the “Keyboard” icon.
                                .
                                In the window that appears, click on the “Shortcuts” tab.
                                .
                                At the bottom of the left pane, click on “Custom Shortcuts”.
                                .
                                Click on the “+” button to add a new custom shortcut.
                                .
                                Give the shortcut a name, eg: “Enable the lockscreen”.
                                .
                                In the Command field, type in “xscreensaver-command -lock” and then click on the Apply button.
                                .
                                You will now see your new shortcut listed, but it doesn’t have a keyboard combo for it yet, so click on the word “Disabled” with your mouse and it will change to “New accelerator…”.
                                .
                                Now using your keyboard, press the key combo you’d 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’s already in use by the Gnome-Screensaver (which you uninstalled earlier, remember?), so just tell it to reassign it to your shortcut.
                                Close the keyboard settings window.
                                .
                                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 “Ubuntu Font Family” (that comes with current releases of Ubuntu) enabled for use in XScreensaver, but you can apply this to any of the font folders on your machine.
                                .
                                In your terminal, type in the following:$ cd /usr/share/fonts/truetype/ubuntu-font-family $ sudo mkfontscale $ sudo mkfontdir

                                Repeat the above for all the fonts you wish to add to your system, eg: substitute the path /usr/share/fonts/truetype/msttcorefonts for the Microsoft fonts from the ubuntu-restricted-packages meta-package or the ttf-mscorefonts-installer package.
                                .
                                Create a new file (or edit any existing file) as follows:$ sudo nano /usr/share/X11/xorg.conf.d/50-fonts.conf

                                Type/paste in the following into your new file:Section “Files” FontPath “/usr/share/fonts/truetype/ubuntu-font-family” EndSection

                                Add as many FontPath entries you need between the Section/EndSectionblock for all the fonts you want available that you ran step 18 on.
                                .
                                Save your changes with CTRL+X, then “Y” and then Enter.
                                .
                                Now type in the following to enable the fonts now (or simply reboot):$ xset +fp /usr/share/fonts/truetype/ubuntu-font-family $ xset fp rehash

                                Repeat the xset +fp <path> command as many times as required to add all the fonts you setup in Step 18 before the xset fp rehash command, or simply reboot to do them all in one hit from your X11 config file in step 21.
                                .
                                Now we’re ready to fix the fonts in XScreensaver. In this example we’re going to fix the fonts in the StarWars screensaver. What exactly is wrong with the fonts in the StarWars screensaver I hear you ask? Simply this:

                                Yuck
                                Click on the Dash and then type in “screensaver”. An icon called “Screensaver”will appear below it. Click on it.
                                .
                                In the Screensaver Preferences window that appears, scroll down the list of available screensavers to find “StarWars”. Click on it to highlight it.
                                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.
                                .
                                Click on the “Settings…” button. A new window will appear.
                                .
                                In the Settings window, click on the “Advanced>>” button at the bottom. The window content will change.
                                You will see the command line that starts the screensaver. Modify the line so that it looks like:starwars -root -font “-misc-ubuntu-bold-r-normal–180-0-0-0-p-0-iso8859-1”

                                Click OK and repeat this modification to any other screensaver that uses a proportional font in its text, for example the FlipText screensaver.
                                .
                                Finally, let’s set a custom RSS feed for the screensavers that use text so that they show something useful. Click on the “Advanced” tab in the Screensaver Preferences window.
                                At the bottom-left in the “Text Manipulation” section, make sure “URL” is selected and change the URL text to your favourite RSS feed’s URL, for example ITNews’ RSS feed for “all content” ishttp://www.itnews.com.au/RSS/rss.ashx

                                Test the StarWars screensaver now by clicking on the “Display Modes” tab and then select “StarWars” from the left pane to make it appear in the preview window. The time the fonts should look much nicer as follows:

                                Much nicer!
                                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.
                                .
                                Set the Blank After, Cycle After and Lock Screen After values accordingly, eg: 10 minutes a piece.
                                .
                                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.
                                .
                                Pat yourself on the back. You are done.

                                Choosing your own font to use instead of the Ubuntu Font Family fonts
                                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:$ cat /usr/share/fonts/truetype/ubuntu-font-family/fonts.dir

                                This lists all the possible fonts available for that family. Copy to the clipboard the font description you wish to use.
                                .
                                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“180” so that the fonts appear smooth and clean when scaled. If you don’t 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.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.
                                .
                                Choose the appropriate font type from the list of available fonts.
                                .
                                Preview your screensaver and make adjustments as required. If you’d 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.For example, for the StarWars screensaver, you can run it in a window as follows:/usr/lib/xscreensaver/starwars -font “-misc-ubuntu-bold-r-normal–180-0-0-0-p-0-iso8859-1”

                                Pat yourself on the back again. You are done.
                                Posted 9th January 2015 by Md Ainul Moin Noor Chandan

                                #10216
                                Moderator
                                BobC
                                  Helpful
                                  Up
                                  0
                                  ::

                                  I think what I need to use for a font is the same one that the wttr.in web site is using/expecting, then it will all display correctly.

                                  … and the solution was just that… fonts that worked correctly were

                                  -font -*-dejavusansmono-bold-r-*-*-*-*-*-*-*-*-iso10646-*
                                  -font -*-dejavusansmono-medium-r-*-*-*-*-*-*-*-*-iso10646-*

                                  Please note that xfonsel shows them with spaces in the font names and when you paste it into the starwars screensaver settings you have to remove the spaces

                                  ie wrong= -*-dejavu sans mono-bold-r-*-*-*-*-*-*-*-*-iso10646-*

                                  so, after creating/loading .ttf fonts, from each /usr/share/font/truetype folder
                                  sudo mkfontscale
                                  sudo mkfontsdir
                                  then cd ..
                                  ls -l
                                  copy the folder names

                                  Create a new file (or edit any existing file) as follows:$ sudo nano /usr/share/X11/xorg.conf.d/50-fonts.conf

                                  Type/paste in the following into your new file, and put in a line for each folder :

                                  Section "Files" 
                                        FontPath "/usr/share/fonts/truetype/foldername" 
                                  EndSection

                                  Save the file and exit

                                  then for each /usr/share/font/truetype folder
                                  xset +fp /usr/share/fonts/truetype/foldername

                                  then
                                  xset fp rehash

                                  then try xfontsel and see if the fonts show up…

                                  wttr.in needs a UTF 8 Font that is mono or fixed with the line draw characters.

                                  OMG, it all works. Sometimes things just aren’t as easy as I wish, but now than I hacked a path, saved the breadcrumbs and drew a map, hopefully it will be easier for the next person, probably 15 min if they have the .ttf file already…

                                  • This reply was modified 4 years, 11 months ago by BobC.
                                  • This reply was modified 4 years, 11 months ago by BobC.
                                Viewing 15 posts - 1 through 15 (of 49 total)
                                • You must be logged in to reply to this topic.