[Solved]Cron - feh wallpaper changer

I tried the following script from the feh wiki page to change my wallpaper:
#!/bin/sh
WALLPAPERS="/mnt/path/to/wallpapers"
ALIST=( `ls -w1 $WALLPAPERS` )
RANGE=${#ALIST[*]}
SHOW=$(( $RANDOM % $RANGE ))
feh --bg-scale $WALLPAPERS/${ALIST[$SHOW]}
Here's the cron job (trying to run it every two minutes)
*/2 * * * * /usr/local/bin/wallpaper.sh
Why doesn't it work from cron? If I run the script from the command line, it works fine.
Any ideas?
Thanks, Scott
Last edited by firecat53 (2008-09-04 00:10:44)

Ok, I changed the script with su, but it's still not working. As an idiot check, I looked, and the cron deamon is indeed running
If I try to run the script from the command line now, it asks me for my user password . . . and I'm already running as that user.
I tried a test cron :
*/1 * * * * /bin/date >> /home/firecat53/date.txt
And it worked fine. The permissions on date.txt were firecat53:users 644. So doesn't that mean that that cronjob is executed as me? If I edited crontab like
sudo crontab -e
then I think it would create a job as the root user.
Could this have something to do with somehow needing to recognize a running X session, since feh is an X application?
#!/bin/sh
WALLPAPERS="/mnt/ubuntu-home/firecat53/docs/wallpapers"
ALIST=( `ls -w1 $WALLPAPERS` )
RANGE=${#ALIST[*]}
SHOW=$(( $RANDOM % $RANGE ))
su -c 'feh --bg-scale $WALLPAPERS/${ALIST[$SHOW]}' firecat53
I'm afraid I'm still stumped!
Thanks!
Scott
Last edited by firecat53 (2008-09-03 22:40:35)

Similar Messages

  • [SOLVED] XFCE Slideshow Wallpaper - Fade animations

    Dear forums
    As the title says, I wonder if there is any way to get nice fade animations like in Gnome or KDE for XFCE. I remember there being an inbuilt option in XFCE making it possible to select some images which would be cycled through, but other than using e.g. Variety on Ubuntu, there is no animation when the wallpaper changes. Does this depend on some library? Could it be that Ubuntu has a configuration which makes it possible to use those animations automatically in XFCE too?
    I'm seriously considering leaving Ubuntu for good and use Arch Linux again, but since I'm using my Computer every day, I'd like my Desktop to look pretty.
    Thanks in advance!
    Last edited by alexftw (2014-03-16 04:43:48)

    twelveeighty wrote:http://www.linuxjournal.com/content/cre … ounds-xfce
    This only explains how to get a slideshow with xfdesktop, I know that already. My question was how to get fancy animations when the wallpaper changes.
    progandy wrote:You could try shantz-xwinwrap-bzr to force a window in the background.
    What a coincidence, I just figured that out myself!
    In case anyone will need this:
    xwinwrap -b -fs -sp -fs -nf -ov -- feh --bg-fill /path/to/your/wallpapers/
    xwinwrap will say that feh died but the exit code is 0 so there's nothing to worry about (does feh run as a daemon in the background?). Fade duration is specified by the compositor itself (now the only thing that'd make it perfect would be making compton use a longer fade duration on feh only), for automatic switching I'll use this for now, file "wallpaper_randomizer":
    #!/bin/bash
    while true; do
    xwinwrap -b -fs -sp -fs -nf -ov -- feh --randomize --bg-fill /home/alexander/Bilder/Wallpapers/
    sleep 600
    done
    chmod +x wallpaper_randomizer
    I'm using the XFCE settings to start it automatically, but adding it to .xinitrc would probably work too (useful if not using XFCE):
    compton -b &
    /path/to/wallpaper_randomizer &
    exec start_xfce4
    That makes me really happy somehow. Thank you, progandy, that would've really helped me if I've given up searching for a solution already.

  • Random wallpaper change greatly slows down my compoter?

    Hey everyone I'm using the random wallpaper changer built into the Mac 10.5 operating system. But the problem seems that it's taking a LOT of the computer power/resources to change the wallpaper. So if it's changing while I'm in the process of watching a youtube video, or typing, everything seems to pause and just REALLY slows down. I have it set to change 1 per min, so the only "solution" is to make it move farther back to like 1 an hour or something like that, but still it'd still slow down when it goes to change. So it's a big annoyance! I really like this application because I can never settle on one wallpaper, but I wish there was a way to change wallpapers without it slowing down my computer.
    Are there any "3rd party" applications? Thanks everyone!

    I have a MBP that sounds like your problem.
    If I ran a heavy video with the desktop change going everything would slow down. It was especially noticeable with the keyboard.
    I have been working with AppleCare and they decided that the MBP was a lemon. I just got another MBP and it seems to be working fine.
    I would suggest that you contact AppleCare and let them know the issues you are having.
    good luck

  • Execute script on wallpaper change event

    My wallpaper is set to change every 30 mins.
    How do I catch the wallpaper change event and execute a script when the wallpaper changes?
    -R

    Your understanding/use of with timeout in incorrect.
    with timeout tells AppleScript how long to wait for applications to execute the specified commands. Therefore in your example:
    with timeout of 0 seconds
    tell application "Finder" to set current_pic to desktop picture
    You're saying 'wait indefinitely for the Finder to get the current desktop picture'. Under normal circumstances that task would take a few milliseconds, at worst, so setting a timeout doesn't make much sense. You're also checking the desktop picture twice per iteration, which is approximately double the amount of work you need to do.
    Your script would be better written using an idle handler, like:
    global old_pic
    on run
      tell application "Finder" to set old_pic to desktop picture as alias
    end run
    on idle
      tell application "Finder" to set current_pic to desktop picture as alias
      if current_pic is not old_pic then
        display dialog "Desktop pattern is different"
        set old_pic to current_pic
      end if
      return 10 -- check again in 10 seconds
    end idle
    In this way the desktop picture that's current when the script is launched is stored in a global variable. For each iteration of the idle handler the script gets the then-current desktop pattern and compares it against the original (so it only gets the desktop pattern once per iteration).
    If they differ then the script posts a dialog (could be any action you want to take) and resets old_pic to reference the current desktop picture (so that next time around it compares the desktop to what we have now, not the original one when the script launched).
    Finally the return 10 tells AppleScript to check again in 10 seconds (could be any time interval you like, depending on how soon you want to detect changes).
    The ObjC solution is neater since it adds a hook into the system to call your code when the system environment changes. Not as clear/legible as AppleScript, of course, but it doesn't offer an even more elegant solution.

  • Cron feh background display [SOLVED]

    I use feh to set the desktop background and cron to change it every hour.  The following command
    DISPLAY=:0.0 feh --bg-scale /home/tri/.wallpaper
    used to work, but recently stop working.  The cron log show the following error "feh ERROR: Can't open X display. It *is* running, yeah?"  X is running  and "echo $DISPLAY" shows ":0"  I'm wondering if anyone is experiencing this issue.
    Last edited by tri1976 (2011-04-29 20:24:18)

    Why use a cron job?
    I just execute this script:
    wallpaper.sh
    #!/bin/bash
    shopt -s nullglob
    cd ~/.wallpaper
    while true; do
    files=()
    for i in *.jpg *.png; do
    [[ -f $i ]] && files+=("$i")
    done
    range=${#files[@]}
    ((range)) && feh --bg-fill "${files[RANDOM % range]}"
    sleep 15m
    done
    xinitrc:
    . ~/.wallpaper/wallpaper.sh &
    .wallpaper is my wallpaper directory.  Just replace that with whatever directory you are using for your wallpaper and it should work.
    Last edited by the sad clown (2011-04-10 21:11:24)

  • [SOLVED]Feh wallpaper problem

    This used to work and it isn't now. It's pissing me off. Here are my configuration files. The wallpaper gets displayed for like 1-2 seconds after I login with SLIM and then it autosets to the default openbox, semi-gray black.
    .xinitrc
    http://pastebin.com/LVfAzGtJ
    .fehbg
    http://pastebin.com/1VnGEygf
    The file wallpaper exists in the location in .fehbg. why doesn't work? I don't understand...as it displays 1-2 seconds on startup.
    Last edited by Supernova (2011-10-18 06:19:54)

    rozanbiology wrote:
    What worked for me was instead of editing .xinitrc
    put this in ~/.config/openbox/autostart
    eval $(cat ~/.fehbg)&
    Hope it works for you.
    It worked fine. thank you!

  • Gempaper - shadow generating wallpaper changer

    My very first Ruby script.
    Unfortunately only after I put it on Github I realized I should have called it papergem.
    So, I like to have shadows on my panels, and I like to change my wallpapers a lot. The solved the first problem by adding shadow to my wallpaper in Gimp. But since I'm way to lazy to do that everytime I want to change the wallpaper, I wrote a script that does it for me.
    It's pretty simple, actually. What it does - it takes an image (either specified via CLI argument, or random from a directory), resizes it to fit the screen's resolution, and adds a pre-made .png containing shadows to it. Then it saves the new image, and sets it as wallpaper via feh. BAM!
    Also, it can list and preview available images.
    As mentioned above, it's my first Ruby script, so it might not be too elegant. But it works. Any critique is welcomed, though.
    I'm also thinking about ways to make this a little smarter, too. I was thinking something along the lines of having it figure out a good shading for the shadow, depending on brightness of the wall, and maybe being able to tell it to set a light/dark wallpaper, and it would randomly choose a light/dark one. Maybe even extend that to colors. But I'm afraid that would require a database to keep image information, otherwise it might take too long if it has to scan all images every time it's started.
    Needs:
    Ruby, RMagick, feh
    Get it on Github
    Screenshot:
    Last edited by k3ttc4r (2011-01-25 15:03:05)

    Compositing is just complete overkill if all I want are some shadows on my panels
    First post updated with screenshot. I thought I didn't need one, since it's a CLI app. I don't have a LOT of shadows, but if you look close enough, you will see them.
    Also, I just remembered that I can actually draw using [Image|R]Magick, so I guess I'll have to update the script to draw them by itself, instead of still having to use Gimp to create an overlay...

  • IPhone 4 Default Wallpaper change to a Caucasian Man after update to 4.3.1

    Hi, actually i am not sure what is going on here as after i updating my iOS 4.2.1 to 4.3.1, the Default Wallpaper will automatic become a Caucasian Man with some wording "is never going to give you" on the Top of the wallpaper. I had try to change the wallpaper and after restart the phone, The Wallpaper will automatic change to the Caucasian Man agaan. I feel very fed up now and i hope there is someone can help me to solve this problem. I had try 2nd time Restore but it is still the same. Somebody told me this is Virus. So, please help me.
    Thank you.

    Hey, ericcyh77
    You have jailbroken your phone, right, so that bug comes with it, I think it is a photo of one of the Jailbreakers.
    Just make a clean install from tunes, and enjoy!

  • [solved]script fails when changing profile through powerdevil.

    i use ondemand governor and i want to change up_threshold value.
    Whenever i change profile through powerdevil up_threshold gets its default vaule of 80.
    what i did was to create a script named threshold containing the lines:
    #!/bin/bash
    sudo sh -c 'echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold'
    i have also set through /etc/sudoers that this script is passwordless for my user.
    if i run the script, it successfully changes the value. It also runs successfully if i put it in startup.
    My problem is that it fails to run when i choose it to run when a profile loads through powerdevil. I am refering to the feature shown below :
    at first i thought that this function has a problem. so i chose to run kate, and when i changed profile, kate started immediately. So i guess that there is a problem with my script.
    Any ideas?
    Last edited by mechmg93 (2009-10-20 20:14:30)

    I hope someone reads this thread also its already marked as solved...
    Anyway, i would like to use CPU frequency scaling, but in the powermanagement settings,
    i cant shoose anything for frequency scaling.
    What do i have to do to be able to set "ondemand" or "always lowest frequency"?
    Wich daemons and/or modules do i have to activate to change the frequency policy?
    Would be very nice if someone could help me.

  • [SOLVED] I want to change my tty resolution

    Just that, I want to change my console resolution (NOT the font size) cause it doesn't use my whole screen.
    I've reading about KMS and i know there's incomplete documentation. I understand this
    https://wiki.archlinux.org/index.php/KMS wrote:
    The format is: video=<conn>:<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]
    <conn>: Connector, e.g. DVI-I-1, see your kernel log.
    But where in my kernel i can see which connector. I'm using a laptop and would like to use a resolution 1680x800@60
    Any idea on how to know this or how to solve my issue?
    Thanks in advance
    Last edited by dgarcia (2011-05-22 19:37:36)

    If you are using an open-source driver(e.g. nouveau) you should have a good tty resolution out of the box, if not, you can do this (i use this for my tty resolution):
    pacman -S v86d
    And then edit /etc/modprobe.d/uvesafb.conf
    nano /etc/modprobe.f/uvesafb.conf
    In the line that says "mode_option" set your resolution, e.g.
    options uvesafb mode_option=1280x800-32 scroll=ywrap
    Edit /etc/mkinitcpio.conf
    nano /etc/mkinitcpio.conf
    and add "v86d" to the hooks array after udev hook,e.g.
    HOOKS="base udev v86d ..."
    Finally rebuild the kernel image:
    mkinitcpio -p kernel26
    That's all...this is the preferred method for the framebuffer.
    More information here:
    https://wiki.archlinux.org/index.php/Uvesafb

  • (Solved)Xorg virtual res.change

    How do i get the virtual resolution change by ctrl+alt+(numpad)+ to work? (not real change as with xrandr, this is more like zooming)
    This is the first install i have experienced where this is not working with the settings i have used for many years.
    This is what i use
    Section "Screen"
    Identifier "Screen1"
    Device "NVIDIA"
    Monitor "SyncM"
    DefaultDepth 24
    Subsection "Display"
    Depth 24
    Modes "1280x960" "1024x768" "800x600"
    EndSubsection
    EndSection
    Another strange thing is that my screen goes about 20 pixels off screen to the left with the above, but if i comment out just the Modes line it becomes normal and keeps within the borders, but that Modes line needs normally to be there to have different virual resolutions.
    Last edited by steelneck (2011-08-27 22:48:24)

    Solved!
    Now i can zoom by ctrl-alt-keypad+
    This had something to do with the nouveau Nvidia kernel driver. I changed the driver in the xorg.conf to the old "nv" and blacklisted nouveau in the /etc/modprobe.d/modprobe.conf, since xorg refused to use nv as long as the nouveau was loaded in the kernel. So this actually looks like kernel driver bug.
    Last edited by steelneck (2011-08-27 22:49:22)

  • [solved] cron refuses to run a command

    For some reason, cron just won't run a one particular command.
    Here's my crontab:
    */1 * * * * /usr/bin/modprobed_db store &> /dev/null
    */1 * * * * touch ~/.config/modopodo &> /dev/null
    The second command is there just to check cron is working. And yes, it works. Each minute it creates that file.
    But the first one just won't work.
    I moved it underneath the second command - no difference.
    I changed cronie to dcron - no difference.
    But when I try this command in terminal - it works perfectly fine.
    Why?
    Last edited by Lockheed (2013-11-28 07:32:18)

    @WonderWoofy, that is a good point. I installed the new version and now it seems to work with cron.
    However, I am still puzzled why the last one didn't work in cron, while it worked in terminal.

  • [SOLVED]How Can I change language on Google in Opera?

    Hello, I have a problem with Opera. I try to change de language of google to another language, but it has no effect:
    As you can see, I tried to change the language of google (it's for now in spanish) but it never changes. In konqueror and Firefox it changes correctly.
    Cookies on Opera are activated.
    What must I do to solve this problem? Maybe a bug?
    Greetings
    Last edited by Davigetto (2007-11-16 15:14:17)

    Well, cookies were activated, I have made all I could..., but nothing work.
    I have solved the problem at "brutal mode", I have erased all .opera folder xDDD, now google can change Language
    Strange...
    Thank You for all your help
    Last edited by Davigetto (2007-11-16 15:13:44)

  • [SOLVED] cronie reports "/usr/sbin/run-cron: No such file or directory

    Hi, I just made a fresh install of Arch Linux x86_64 on my PC and I'm having troubles with cronie.
    cronie emails say:
    /bin/sh: /usr/sbin/run-cron: No such file or directory
    In crond.log I have:
    Jan 2 22:01:01 localhost /USR/SBIN/CROND[4691]: (root) CMD (run-parts /etc/cron.hourly)
    Jan 2 22:47:56 localhost /usr/sbin/crond[5529]: (CRON) STARTUP (1.4.8)
    Jan 2 22:47:56 localhost /usr/sbin/crond[5529]: (CRON) INFO (Syslog will be used instead of sendmail.): No such file or directory
    Jan 2 22:47:56 localhost /usr/sbin/crond[5529]: (CRON) INFO (running with inotify support)
    Jan 2 22:47:56 localhost /usr/sbin/crond[5529]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
    Jan 2 23:00:01 localhost /USR/SBIN/CROND[5733]: (root) CMD (ID=sys-hourly /usr/sbin/run-cron /etc/cron.hourly)
    Jan 2 23:00:01 localhost /USR/SBIN/CROND[5732]: (root) CMDOUT (/bin/sh: /usr/sbin/run-cron: No such file or directory)
    Jan 2 23:01:01 localhost /USR/SBIN/CROND[5748]: (root) CMD (run-parts /etc/cron.hourly)
    I've changed very little of the configuration files provided with the package: root's crontab is completely empty, and cron.hourly only contains the original untouched 0anacron file.
    I have the same basic setup on another machine and I don't have such errors.
    Any hints?
    Thanks
    Last edited by Venator85 (2012-01-03 20:26:16)

    [karol@black ~]$ nosr /usr/sbin/run-cron
    extra/dcron
    community/fcron
    Seems that file is provided by other cron implementations.

  • Openbox feh wallpaper overwritten

    It's a very strange thing that's happening. feh loads the correct initial wallpaper, but this mild grey 'wallpaper' covers it. And after some programs load (like aMSN), I have to drag, for example, aMSN around the screen to 'clean' off the grey wallpaper to reveal the desired background. I've disabled xcompmgr, and moved around my .xinitrc startup procedures, but none have worked. I like a good clean desktop, but this is going too far!
    Any suggestions?

    I had the same problem before where both nitrogen and pcmanfm were trying to set the wallpaper, resulting in neither working right.
    I guess you just have to find out what else is trying to controll the background.

Maybe you are looking for

  • In Answers am seeing "Folder is Empty" for Logical Fact and Dimension Table

    Hi All, Am working on OBIEE Answers, on of sudden when i clicked on Logical Fact table it showed me as "folder is empty". I restarted all the services and then tried still showing same for Logical Fact and Dimension tables but am able to see all my r

  • What is wrong with my app store?

    What is wrong with my app store? I am trying to update my apps and purchase a new one but it is not working on my iPad. It is working on my iPhone 4 though. I have tried turning my iPad off then on, I have tried re booting it by holding the 2 buttons

  • Login ID best practice. Windows 8, Office 365 with SkyDrive and SkyDrive PRO

    I have had many confusing issues with multiple and conflicting ID's. I have just spent 3 hours online with MS technical support to discover that a document can be edited in Word and saved to Sharepoint365 but if it is synched with the desktop and tha

  • Outbound idoc control recorderror - REFINT field

    I am trying to send orders.orders05 idoc from ecc to xi the message that I get in we02 in ECC is EDI: Field REFINT in control record with value 'T080902134731A ' is invalid Does somebody knows where this field is configured ? when I edited this idoc

  • HT1926 problems with installing updates

    Tried to install the latest update for itunes on 2/2/2014. Received  two error messages every time I tried to update. ===================================== Error Message #1 Runtime Error! Program: C/Program Files (x86)\iTunes\iTunes.exe R6034 An appl