Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Changing background image in xfce

  1. #1
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Changing background image in xfce


    While I was using gnome2 in oS 11.4 I had the background set to a .xml
    file, that simply loaded a background image. I had a cron job that
    changed the contents of that image (the earth rotating according to the
    current time), and simply touching the xml file caused gnome to reload
    the png background image.

    (gnome 2 had a sample xml file that changed the background image during
    the day, darker colours at night. The xml file defined the hours on
    which to do the change and the files to load)


    I want to do something similar in XFCE under oS 12.1. It is simple:
    there is an image that is regenerated every 20 minutes, but I need to
    tell XFCE to reload it somehow.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  2. #2
    Join Date
    Mar 2011
    Location
    Germany
    Posts
    87

    Default Re: Changing background image in xfce

    Carlos E. R. wrote:

    >
    > While I was using gnome2 in oS 11.4 I had the background set to a .xml
    > file, that simply loaded a background image. I had a cron job that
    > changed the contents of that image (the earth rotating according to the
    > current time), and simply touching the xml file caused gnome to reload
    > the png background image.
    >
    > (gnome 2 had a sample xml file that changed the background image during
    > the day, darker colours at night. The xml file defined the hours on
    > which to do the change and the files to load)
    >
    >
    > I want to do something similar in XFCE under oS 12.1. It is simple:
    > there is an image that is regenerated every 20 minutes, but I need to
    > tell XFCE to reload it somehow.
    >


    I think
    Code:
    xfdesktop --reload
    is what you're looking for

    --
    openSUSE Ambassador & Member

    What was that you were saying about Linux being a headache?
    Sorry, I couldn't hear you over the sound of openSUSE being awesome.
    -- Helen South on opensuse-marketing Mailinglist

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Changing background image in xfce

    On 2013-02-14 19:11, tux93 wrote:
    > Carlos E. R. wrote:


    > I think
    Code:
    xfdesktop --reload
    is what you're looking for


    Indeed! It works, thanks :-)

    If anybody is interested, what I do is this. In file "/etc/cron.d/mine"
    I have this line:

    Code:
    -*/20 * * * * cer /usr/share/backgrounds/tierra/generar > /dev/null
    And that script contains:

    Code:
    #!/bin/bash
    
    nice xplanet -verbosity 2 -num_times 1 -output \
    /usr/share/backgrounds/tierra/latierra.png \
    -longitude 0.99167   \
    -range 100000 -radius 30  -label \
    -geometry 1920x1080
    
    # For Gnome
    #touch /usr/share/backgrounds/tierra/tierra.xml
    
    # For XFCE
    xfdesktop --reload

    I still have to see if the xfdesktop call works as cronjob.


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Changing background image in xfce

    On 2013-02-15 00:33, Carlos E. R. wrote:

    > I still have to see if the xfdesktop call works as cronjob.


    No... it does not work :-(

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  5. #5
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,042
    Blog Entries
    14

    Default Re: Changing background image in xfce

    Carlos, I assume you run this cronjob as root, seeing it's located in /etc, is that correct?
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Changing background image in xfce

    On 2013-02-15 14:46, Knurpht wrote:
    >
    > Carlos, I assume you run this cronjob as root, seeing it's located in
    > /etc, is that correct?


    No, it runs as 'cer', notice the 'cer' word in the entry. It is a
    special syntax. I get this error in my email:

    Code:
    
    > Subject: Cron <cer@Telcontar> /usr/share/backgrounds/tierra/generar >> /tmp/generar.log
    >
    > Failed to parse arguments: Cannot open display:
    I think that "xfdesktop" has to run from the desktop.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  7. #7

    Default Re: Changing background image in xfce

    If you have a series of those images with different color settings according to the time of day
    you can load it in the xfce desktop settings and set the time to change images.
    People who do not break things first will never learn to create anything

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Changing background image in xfce

    On 2013-02-16 02:46, conram wrote:
    >
    > If you have a series of those images with different color settings
    > according to the time of day
    > you can load it in the xfce desktop settings and set the time to change
    > images.


    The images are dynamically created, one at the current time, one every
    20 minutes. To do what you say, I would have to create a list of
    hundreds of images in advance, as I don't close my session in weeks if I
    can avoid it.

    That's hardly feasible :-(


    Or... can I generate all images for the current day every day, and will
    it load the correct image at the correct time, somehow?


    I see in the desktop configuration dialog that I can add a list of
    images, one by one. Then there is a setting to change the image every X
    minutes. But I can not set the exact time at which to load each image of
    the list.


    What I have done now is a list of one image, and reload every 20', but
    the generation and the reload will not be in sync.


    It is a very crude interface, compared with gnome 2.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  9. #9

    Default Re: Changing background image in xfce

    Quote Originally Posted by robin_listas View Post
    On 2013-02-16 02:46, conram wrote:
    >
    > If you have a series of those images with different color settings
    > according to the time of day
    > you can load it in the xfce desktop settings and set the time to change
    > images.


    The images are dynamically created, one at the current time, one every
    20 minutes. To do what you say, I would have to create a list of
    hundreds of images in advance, as I don't close my session in weeks if I
    can avoid it.

    That's hardly feasible :-(


    Or... can I generate all images for the current day every day, and will
    it load the correct image at the correct time, somehow?


    I see in the desktop configuration dialog that I can add a list of
    images, one by one. Then there is a setting to change the image every X
    minutes. But I can not set the exact time at which to load each image of
    the list.


    What I have done now is a list of one image, and reload every 20', but
    the generation and the reload will not be in sync.


    It is a very crude interface, compared with gnome 2.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)
    Why hundreds of images?
    If I understand your original post, it is about the 24 hour earth rotation
    of earth and images change accordingly to the time every 20 minutes.
    If my math is right you only need 72 images to complete the 24 hours
    unless there are images that you like to show within a period of one week.
    People who do not break things first will never learn to create anything

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Changing background image in xfce

    On 2013-02-16 16:06, conram wrote:
    > Why hundreds of images?
    > If I understand your original post, it is about the 24 hour earth
    > rotation
    > of earth and images change accordingly to the time every 20 minutes.
    > If my math is right you only need 72 images to complete the 24 hours
    > unless there are images that you like to show within a period of one
    > week.


    As one of my last comments said, I have it running with a /list/ of 1
    image, regenerated each 20 minutes by a cron script. Also, in the
    desktop configuration I tell it to switch the image each 20 minutes.

    So far so good, it works: but the image can be generated at 12:00 and
    not been displayed till 12:19 because both timed processes are not in
    sync (cron and desktop). Of course, I can tell the desktop to refresh
    oftener, but that's a "waste" of resources. Small waste, but a waste.


    In fact, my current background image this minute displays time as 17:00,
    and the local time is 17:25 (I don't know when desktop will refresh). In
    Gnome 2 it would had refreshed at the exact time, triggered by the cron job.

    (refreshed just now, 17:28, so 8 minutes delay on this session)


    This could be solved if we had a sort of "cron" daemon started by the
    desktop and inheriting desktop variables, so that graphical related
    tasks such as
    Code:
    xfdesktop --reload
    would work.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •