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 0x0+[%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.

      • It still may be a good idea to include an option to toggle 12 hour cycle on and off as well as an option to select position, even if its just for top right and bottom right. There are idiots like me that can’t seem to change it otherwise, even though I open up the config file, change %H to %I, and save the file. Not sure what I am doing wrong.

  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 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’

      • Thank you for this wonderful application first.
        My question is: I don’t quite follow the instruction concerning the clock placement. All eight [%HOFFSET+X]+[%VOFFSET+Y] settings need to be configured, right?
        But the placement changes with wallpapers, does it not? So how do I have a clock placement fixed whether the wallpaper is paysage or portrait?
        Thank you.

        • -gravity SouthEast is the more important placement parameter than the offsets. You are correct that the clock is drawn on the wallpaper image. But the clock drawing logic takes this into account, and compensates for it when the wallpaper display mode is the default for Ubuntu – Zoom. Hence the presence of those %HOFFSET, %VOFFSET parameters which Variety replaces dynamically depending on the image and screen proportions. However, if you use any of the other wallpaper display modes (e.g. Scale, Fill, etc.), you are on your own with the placement. gravity Center will result in a more “stable” clock in this case.

  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…

  19. como puedo hacer q el reloj se muestre bien en mis 2 monitores? desde que le istale un monitor adicional el reloj esta mal colocado solo se mira una peque?a parte en cada monitor

  20. Peter, is there a way to add the filename of the photo displayed? Is there a way to define a file name variable that can be added to the .conf file?

  21. Hi, I am trying to configure the clock and I am having issues. I open up the config file and changed the default to the following:
    clock_filter = “-density 100 -font `fc-match -f ‘%{file[0]}’ ‘%CLOCK_FONT_NAME’` -pointsize %CLOCK_FONT_SIZE -gravity NorthEast -fill ‘#00000044’ -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+108] ‘%I:%M %p’ -fill white -annotate 0x0+[%HOFFSET+60]+[%VOFFSET+110] ‘%I:%M %p’ -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'”

    I changed SouthEast to NorthEast, the clock is still in the bottom right of the Desktop. I changed the %H to %I for the 12 hour clock, and it is still the 24 hour one. What am I doing wrong?

    • Also experiencing this in the terminal when I try to open the config file. This is on my laptop.

      dxjeckel@DxJeckel:~$ gedit ~/.config/variety/variety.conf
      Gtk-Message: Failed to load module “overlay-scrollbar”

      ** (gedit:11193): WARNING **: Couldn’t register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

      ** (gedit:11193): WARNING **: Can’t load fallback CSS resource: Failed to import: The resource at ‘/org/gnome/adwaita/gtk-fallback.css’ does not exist

      ** (gedit:11193): WARNING **: Can’t load fallback CSS resource: Failed to import: The resource at ‘/org/gnome/adwaita/gtk-fallback.css’ does not exist

      (gedit:11193): Gtk-WARNING **: Attempting to read the recently used resources file at `/home/dxjeckel/.local/share/recently-used.xbel’, but the parser failed: Failed to open file ‘/home/dxjeckel/.local/share/recently-used.xbel’: Permission denied.

    • And this is what I get on my Desktop runnin Makulu 7 XFCE

      Desktop:~$ leafpad ~/.config/variety/variety.conf

      (leafpad:24615): Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”,

      (leafpad:24615): Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”,

      (leafpad:24615): Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”,

      • These are warnings logged by GEdit and leafpad while you are editing a text file (specifically variety.conf). They are unrelated to Variety, and are most probably harmless.

    • These looks correct, but if the clock stays unchanged, then you are missing something and Vairety is not picking this change. When you run Variety in a terminal, you should see log messages about what clock filter it tries to run. Check if it matches the one above.

      • Thanks for the reply. I figured out what was going on, sort of. So I changed the config file, but nothing was changing. Went into the Variety GUI unchecked the enable clock option and then checked it again to enable it and the changes went into effect.

  22. I just started using MakuluLinux, which comes pre-installed with Variety. Great piece of code, I’m having fun with it! I wanted the clock/date to resemble a Rainmeter theme I used to use in Win7 called “Pileus”, and thought it was original enough to share:

    • Very nice! Can you please share the clock_filter you used so others can use it too – I will even put it in the article above and in the Wiki so more users find it.

      • Sure thing- note I had to hard-code pointsize variables to get this effect. I’m not sure how this will translate to other resolutions (should be fine, but mine is 1920×1080); here’s the entire thing:

        clock_filter = “-density 100 -font `fc-match -f ‘%{file[0]}’ ‘%CLOCK_FONT_NAME’` -pointsize 88 -gravity NorthEast -fill ‘#00000044’ -annotate 0x0+[%HOFFSET+130]+[%VOFFSET+13] ‘%I:%M’ -fill white -annotate 0x0+[%HOFFSET+132]+[%VOFFSET+11] ‘%I:%M’ -font `fc-match -f ‘%{file[0]}’ ‘%CLOCK_FONT_NAME’` -pointsize 60 -fill ‘#00000044’ -annotate 0x0+[%HOFFSET+0]+[%VOFFSET+20] ‘%p’ -fill yellow -annotate 0x0+[%HOFFSET+2]+[%VOFFSET+18] ‘%p’ -font `fc-match -f ‘%{file[0]}’ ‘%CLOCK_FONT_NAME’` -pointsize 30 -fill ‘#00000044’ -annotate 0x0+[%HOFFSET+10]+[%VOFFSET+90] ‘%Z’ -fill orange -annotate 0x0+[%HOFFSET+12]+[%VOFFSET+88] ‘%Z’ -font `fc-match -f ‘%{file[0]}’ ‘%DATE_FONT_NAME’` -pointsize 25 -fill ‘#00000044’ -annotate 0x0+[%HOFFSET+115]+[%VOFFSET+140] ‘%A’ -fill yellow -annotate 0x0+[%HOFFSET+117]+[%VOFFSET+138] ‘%A’ -font `fc-match -f ‘%{file[0]}’ ‘%DATE_FONT_NAME’` -pointsize 40 -fill ‘#00000044’ -annotate 0x0+[%HOFFSET+115]+[%VOFFSET+161] ‘%B’ -fill orange -annotate 0x0+[%HOFFSET+117]+[%VOFFSET+159] ‘%B’ -font `fc-match -f ‘%{file[0]}’ ‘%DATE_FONT_NAME’` -pointsize 75 -fill ‘#00000044’ -annotate 0x0+[%HOFFSET+0]+[%VOFFSET+120] ‘%d’ -fill white -annotate 0x0+[%HOFFSET+2]+[%VOFFSET+118] ‘%d'”

        The font is called “Times New Yorker”, download here:

  23. I wanted to edit the placement of the clock to the top of the screen but when I edit ……………. -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+58] ……………. to -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+0] to place the clock at the top it is still placing the clock way towards the centre as shown in the screenshot below.
    I want to place the clock higher than what is shown in the screenshot. Can I set the value of Y to a negative number?

    • Do you use two or more monitors? Clock placement may be off on multi-monitor setups. Also, the wallpaper display mode plays a role – Variety’s calculations work best when the mode is ‘Zoom’ (which is the default setting in Unity and GNOME).

      Also, what gravity setting do you use – you should be using North or NorthEast or NorthWest.

      ImageMagick does not like minuses in the offset expression within the brackets, and Variety calculates and uses a positive number for %VOFFSET. But you can replace the whole +[%VOFFSET+0] part with a specific number like +20 or -20 – here minus signs are OK. The issue with this might be that the clock would jump up and down between wallpaper changes.

      • Yes I am using a 2 monitor setup and my wallpaper display mode is zoom. Is there anyway to correct clock placement on a dual monitor setup?

        • Clock is drawn on the image itself. If the two monitors are not equal, the image will be scaled differently on both, so clock position will be off at least on one of them, this is unavoidable currently. If both are the same, you may manually tweak the clock_filter’s offsets to achieve better results than the default behavior.

  24. Default settings of Variety and clock is off the screen on my primary monitor (1920×1200) but fine on the secondary (1920×1080)

  25. Hi.
    Thank you for your work. I really like Variety.
    I’m using Variety on my Ubuntu(14.04) machine.

    I want ask you about date setting. I wish I could add a word on the clock_filter, but it is automatically erased.
    The reason I want to do is, in Korean lauguage, %A, %B %d are translated to ‘???, 11? 17’. ‘???, 11?’ is ok, but 17 is awkward.
    17 shuld be ’17?’, which is the right expression. ‘?’ means day.

    I want to add ‘?’ after %d, but it’s not possible. I know it is the matter of python(?) module, but adding a word can be a good work-around.

    Can it be possible?

  26. Thanks.
    I subscribed it.

    I wrote Korean letters, but all are broken, however I’m glad you understood what I meant.

  27. Using the shadow technique, I often found it hard to read with white backgrounds, so I changed the clock filter:

    clock_filter = “-density 100 -font `fc-match -f ‘%{file[0]}’ ‘%CLOCK_FONT_NAME’` -pointsize %CLOCK_FONT_SIZE -gravity SouthEast -stroke ‘#000C’ -strokewidth 6 -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+20] ‘%I:%M %p’ -stroke none -fill grey -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+20] ‘%I:%M %p’ -font `fc-match -f ‘%{file[0]}’ ‘%DATE_FONT_NAME’` -pointsize %DATE_FONT_SIZE -stroke ‘#000C’ -strokewidth 3 -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+120] ‘%A, %B %d, %Y’ -stroke none -fill grey -annotate 0x0+[%HOFFSET+58]+[%VOFFSET+120] ‘%A, %B %d, %Y'”

    Notice the date has a smaller strokewidth for the smaller font and the fill colors can be changed to whatever you want. clock_font = DejaVu Sans Oblique 70, clock_date_font = DejaVu Serif Bold Italic 25

Leave a Reply

Required fields are marked *.