News about Variety Wallpaper Changer

Configuring the Clock


The clock_filter setting

Clock’s appearance and placement are determined by the clock_filter setting in Variety’s config file ~/.config/variety/variety.conf. There are comments there to guide you. If you don’t see any comments there, please find them in ~/.config/variety/variety_latest_default.conf (but make changes in variety.conf, not here – this file is there just for your reference).

The clock filter is quite hairy, but don’t get scared, you don’t need to edit everything. Here it is, as of version 0.4.12:

clock_filter = "-density 100 -font `fc-match -f '%{file[0]}' '%CLOCK_FONT_NAME'` -pointsize %CLOCK_FONT_SIZE -gravity SouthEast -fill '#00000044' -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+108] '%H:%M' -fill white -annotate 0x0+[%HOFFSET+60]+[%VOFFSET+110] '%H:%M' -font `fc-match -f '%{file[0]}' '%DATE_FONT_NAME'` -pointsize %DATE_FONT_SIZE -fill '#00000044' -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+58] '%A, %B %d' -fill white -annotate 0x0+[%HOFFSET+60]+[%VOFFSET+60] '%A, %B %d'"

The clock and date texts appear twice, at slightly offset positions – this is to get a slight shadow effect.

Note: If you have come up with something original and nice-looking for the clock, please share it in the comments below along with a link to a screenshot. Thanks.


On a recent installation (after version 0.4.12), you will see several %FONT variables – these are replaced with the fonts and sizes for the clock and the date, as configured in Variety’s preferences GUI. If these variables are not present and specific font names and sizes are used instead, then the font settings in the GUI won’t work.

Clock and date text format

The variables %H, %M, etc. in the clock filter are replaced with hours, minutes, etc. from the current date and time (localized for your computer’s locale setting). The full list of variables you can use there can be seen here:

The most common request is to have 12-hour format clock: You need to replace %H:%M with %I:%M %p in clock_filter – %I is for hours (12), %p – for the locale-specific string for AM or PM.


Clock placement is determined by the gravity parameters – SouthEast means the lower right corner, and the offset from the edge specified by X and Y in the 0x0+[%HOFFSET+X]+[%VOFFSET+Y] parameters.

A full-blown ImageMagick command

After all the variables are filled in, the line is sent to ImageMagick, so you may be really creative here, use this guide to get ideas and as a reference:
You can get a very uniquely looking clock with some of the more advanced techniques (e.g. circle-shaped text, interesting colors and shading, etc….).

Here are the comments from variety.conf, if you don’t find them:

# clock_filter = <an ImageMagick filter, read below>
# The filter defines the ImageMagick command that Variety uses to render the clock on the wallpaper.
# First some scaling is applied to get the image down to the screen size – this ensures
# the final drawn clock won’t be rescaled by the desktop wallpaper system.
# Easiest way to see what’s happening is to run variety with -v, enable clock and see what ImageMagick
# commands Variety dumps in the log.
# The user may want to customize the following aspects:
# fill – color of “filling”
# stroke – color of outline
# strokewidth – width of outline
# gravity – in which corner to display the clock – SouthEast, NorthEast, SouthWest, NorthWest
# annotate – these must be in the form 0×0+[%HOFFSET+X]+[%VOFFSET+Y], where you can edit X and Y – distance from the screen corner defined by gravity. Write them in even if they are 0.
# The %HOFFSET and %VOFFSET parameters are there for Variety to replace in order to compensate for the diferent dimensions of every image and screen
# The several %FONT parameters are there for Variety to replace with the font settings from the GUI.
# The texts can contain these symbols:
# %H – hours (24), %I – hours (12), %p – am or pm, %M – minutes,
# %A – day of week (full), %a – day of week abbreviation, %B – month name, %b – month abbreviation, %d – day of month, %Y – year.
# The full list for these can be seen here:
# Have in mind that Variety will not update the clock more often than once every minute, so using seconds (%S) for example is pointless
# A tutorial on “annotating” with ImageMagick that you may use as a reference:
# You can get a very uniquely looking clock with some of the more advanced techniques (e.g. circle-shaped text, interesting colors and shading, etc….).


  1. Pingback: Variety 0.4.12 released, adds Quotes support | Variety

  2. Pingback: Variety 0.4.12 Dynamic Wallpaper Changer With Overlay Quotes | LinuxNov

  3. Thanks to this and I love this app. I hope there will be more improvements to come, like an interface to set the time format in the “Effect” tab on the “Preferences” settings.

    Variety rocks!

  4. I can not get the clock to revert to 12-hour am/pm format from the military time. I’ve changed the %H:%M to %I:%M %p in the variety.conf file but it didn’t change for me.

    • Please make sure you are replacing all %H:%M occurrences in clock_filter in ~/.config/variety/variety.conf, not just one of them. Just tried it again here to confirm nothing has broken since I’ve written the instructions and it still works.

      • Thank you for replying. I am making edits to the file called variety.conf and I’ve replaced the string ‘%H:%I’ with ‘%I:%M %p’ in two places within the ‘clock_filter’ section of the code.
        Other than the clock setting being moderately irritating, I love my new Ubuntu desktop. I don’t yet know how or if it will tax the performance, like Webshots did on my old Windows PC a few years ago but, man it is so cool. I really love it and thank you for replying and trying to help me.

    • how did you get to the config file iam lost on that

      • In terminal enter the following:

        gedit ~/.config/variety/variety.conf

        (may need to be sudo)
        Replace ‘gedit’ with the name of your text editor, and Peter is right – it’s hairy in there :)

        Regards – Dave

  5. Great app. Though it would be nice to have different wallpaper changing on multi-monitor setups. But very nice app so far.

  6. Is it possible to remove the clock ONLY from the login screen? Because it’s always showing the hour and date of when the computer was shut down for the last time… It’s quite annoying. Thank you!

    • Agree, and I would have it this way if I knew how to do it. When Variety is shut down properly, it will remove the clock before it exits. But I can’t figure out the proper way to handle the UNIX termination signals that are supposed to be received during shutdown – there are some problems with the combination of GTK + Unix signals that I can’t find information how to resolve.

      • Oh… I understand. I’ll just remove the clock, then… Thank you anyway!

      • Actually I finally made some progress on this, and now the trunk version exits properly when pressing Ctrl-C or calling “killall variety”.

        However, this does not solve the issue with removing clock/quotes on session logout – it seems that in this case we don’t get any UNIX signals, we just get killed. The way to solve this seems to be to listen to DE-specific session-related events… It seems Linux has a lot of enthusiasm behind it to be able to progress despite such stupidities.

        • Can’t you remove the clock/quote when a SIGTERM is received and save the wallpaper for lightDM to pick up?

          • I handle SIGTERM, SIGINT, SIGQUIT properly. But none of them is received on logout/shutdown, the application is obviously killed directly.

  7. I love this app, and love the clock…but I’m running eOS and the lightdm has a clock on the login screen too….so annoying

  8. (ESPA?OL)

    El programa es demaciado bueno me gusta es uno de los mejores, lo prob? en LUBUNTU 12.10 con el ppa y funciona 1 A.

    En un sitio llamado taringa, lo dar? a conocer aunque de hecho en Taringa fu? donde lo encontr? .

    Algo que me llam? la atenci?n fu? la HORA, excelente .

    Deberas gracias gracias uno de los mejores que he probado.

    Tengo una pregunta :

    El relog se le puede cambiar la posici?n y el color?

    De resto (congratulations).


    The program is way too good, I like is one of the best, I tried it on Lubuntu 12.10 with ppa and runs 1 A.

    In a place called taringa will declare Taringa but in fact was where I found it.

    Something that struck me was the excellent TIME.

    Deberas thank you one of the best I’ve tried.

    I have a question:

    The relog i can change the position and color?

    For the rest (congratulations).

    • Not sure I understood? You want to change the position and color of the clock? Please read carefully the article above, this is described there. There is no GUI option for this. You may need to get acquainted with ImageMagick, there are tutorials on the web.

  9. is there a way to configure the clock/date further?
    Perhaps offer a way to configure via the GUI rather than the .conf file manually?
    Also, offer more configuration options such as ‘Thursday, 5th December’ rather than ‘Thursday December 05′?

    • There is a multitude of possible configurations for the clock/date and even a complex GUI will cover just a fraction of them, so I don’t plan on spending more time on the GUI for this for now. Editing the conf file provides enormous flexibility in this aspect, but you’ll have to do some reading.

      5th December vs December 05 – I agree this probably looks better in English, but day and date are shown in the system language and this logic is English-specific. Providing similar logic for other languages will be too difficult, and I don’t want to discriminate based on system language.

  10. as I can put a personalized quote? and do not ever delete ie that only this single

  11. Can you please give an example how to put the clock on the top right corner of the screen, maybe with a few pixels distance from the screen edge, but not too much away from the edge. I am not able to figure it out, the clock always is too far away from the screen, nearly in the middle.

    Also I do not understand how to define %HOFFSET – is this a literal text that must be in the filter command or should this variables be replaced and if yes how to define them?


    • You should be able to just change the ‘SouthEast’ portion of the text to ‘NorthEast’. Then you can set how far away from the corner it will be with the %HOFFSET and %VOFFSET parts.

      I pasted the default string below, with the change.

      clock_filter = “-density 100 -font `fc-match -f ‘%{file[0]}’ ‘%CLOCK_FONT_NAME’` -pointsize %CLOCK_FONT_SIZE -gravity NorthEast -fill ‘#00000044′ -annotate 0×0+[%HOFFSET+58]+[%VOFFSET+108] ‘%H:%M’ -fill white -annotate 0×0+[%HOFFSET+60]+[%VOFFSET+110] ‘%H:%M’ -font `fc-match -f ‘%{file[0]}’ ‘%DATE_FONT_NAME’` -pointsize %DATE_FONT_SIZE -fill ‘#00000044′ -annotate 0×0+[%HOFFSET+58]+[%VOFFSET+58] ‘%A, %B %d’ -fill white -annotate 0×0+[%HOFFSET+60]+[%VOFFSET+60] ‘%A, %B %d’

  12. Sir,
    I have installed Variety Wallpaper Changer on Fedora 20. Everythings are okay. But the clock is not showing. I’ve checked evrything. Nothing left. Will you help me?

    • Please make sure ImageMagick is installed. Most probably for some reason it did not get installed together with Variety (not sure which installation procedure you followed to install it on Fedora 20).

  13. I type in ~/.config/variety/variety.conf and I keep getting the same answer “command not found”. can anyone help with this? I want the clock to show 12 hour time instead of 24.

    • That’s a text file you have to edit, not a command. Try gedit ~/.config/variety/variety.conf

      • hahahaha can you tell I’m new to all this? It worked; however, now when I change the clock to %I, it does not change on the desktop.

  14. AWESOME!!! Was looking for something like this and WHOOMP – there it is! My favorite LinuxMint 16 app by far. Can now just turn on the PC and watch it. Well done and thank you!

  15. Hi, I’ve installed Variety in ubuntu 14.04 and works flawlessly except for one thing, playing with the variety.conf file to set the date and the time, there is no way to make appear the PM or AM text, I can change the order of the parameters and add any text that I want, but the %p parameter is not working for me. Thank you for any advise and congratulations for your program?

    • Are you sure you changed both occurrences of %H:%M in the clock filter?

      • Yep I’m pretty sure, actually I have noticed that the first occurrence is for the shadow and the second one is for the main text. I have tried with a lot of combinations like: ‘%H:%H %H’, ‘%M:%M %M’, ‘%I:%H %M’, ‘%p:%M %I’, ‘%M@%H;%I’, etc. and all the parameters and inserted texts are respected no matter the order (except for the %p). It looks a little weird to see the minutes three times, or to have in the main text the hours and the minutes in the shadows, but it helps to understand the function of each thing.

        Anyway, if I try to use for example ‘%p:%p %p’ the only thing displayed is ‘:’. I want to know if the language could be the problem, my system is in spanish.

  16. Hi, it will be good if you include utf-8 support for your next versions, there is encoding problem with persian language (UTF) when you enable calendar display wallpaper.

    • There is UTF-8 support, it may be failing in some situation due to a bug. Please report this as a bug in Launchpad and give me steps to reproduce it. Also please make sure to run with “-v” and include the log file with the bug report – there are full instructions when you open a new bug, please read them.

  17. Hello, at 1st I’d like to say, taht your programm is perfect, and it works just fine, exepted that my clock is gone, after a few days, and after a few installation of diffrent files.
    So I tried to fix the clock manually, but it doesn’t compute. So what can I do. I installed also the other file that was descriped earlier, and nothing changed. I changed the font, too. Nothing happens.
    By the way, I have absolut no Idea what to do ? So, please help me, if you can.

    cheers Toni

    PS: Sorry for my english, but it is a long time ago, since I wrote a letter, smile

    • I don’t know what you have done, but your best bet would be to start Variety with a clean state: stop it, rename the folder ~/.config/variety to variety_bak and start it again. If you still miss the clock, you may have a broken ImageMagick installation and you’ll have to reinstall it. Regards, Peter.

  18. I changed the time format to 12-hour with no problems. But is there a way to suppress the leading zeros, so that “05:21 PM Wednesday, July 02″ appears as “5:21 PM Wednesday, July 2″? Thanks…

Leave a Reply

Required fields are marked *.