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)

Similar Messages

  • How do I remove the background display in the upper and lower parts of the page?

    The upper and lower ends have a background display when a new version was updated.I wish to remove the display.
    == This happened ==
    Every time Firefox opened
    == Today

    Sounds that you installed a Persona.
    You can uninstall that Persona and revert to the ''Default'' theme (Tools > Add-ons > Themes).
    See [[Using themes with Firefox]] and http://kb.mozillazine.org/Themes (Lightweight theme)

  • HT4623 my new iphone(4S) background display color is light yellow instant of white.

    my new iphone(4S) background display color is light yellow instant of white.

    Today after more than 45 minutes, talking to Apple Web, they decide to send me a new iPhone 4s. Good luck to everyone.

  • Feh Not setting background image[SOLVED]

    I don't know what is going on but feh absolutely refuses to set the bg image on x starting up.  I can set it manually just fine but it will not reset it on xstart.  Here is my .xinitrc:
    \#!/bin/sh
    # ~/.xinitrc
    # Executed by startx (run your window manager from here)
    #exec xterm
    exec openbox-session
    eval 'cat ~/.fehbg' &
    And ~/.fehbg has the command that I use to set the background, which works just fine if I execute the command after I am in x so I have no idea why it isn't working.  Every resource I have looked at on the net says to simply add the "eval 'cat ~/.fehbg' &" line to .xinitrc after you set the background image with feh but I cannot for the life of me figure out what is going on.  Thanks in advance.
    Last edited by isolier (2008-01-11 08:55:41)

    I think you need to use  `s instead of 's around your cat ~/.feghbg
    Also, Archon is probably right, since you are exec'ing the openbox session and leaving it in the foreground, your command will never execute until openbox-session is done
    Last edited by underpenguin (2008-01-11 08:16:06)

  • [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)

  • GDM and OpenBox - Wallpaper and background problem [SOLVED]

    I have a strange problem.
    I am using GDM as login manager. And I am using OpenBox as a window manager.
    As soon as GDM appears on the screen, my wifi connection is connected... so its good.
    But, when I login Feh loads my background picture and it disappears after few seconds..... I solved this modifying the autostart script (adding the sleep).
    Now background stays, BUT not always. Sometimes it disappears.... sometimes not.
    It seams that this problem is appearing randomly.
    So my question is:
    Is there a way to disable Gnomes (GDMs) background color and picture after loading openbox through GDM?
    Last edited by webmasteryoda (2011-06-26 10:50:10)

    azleifel wrote:
    It will apply to gnome as well, so if gnome-settings-daemon is your problem then you either need to choose one environment or perhaps do some settings adjustment with gconftool-2 when you log into each environment.  I didn't try this but settings for openbox could be changed with a couple of gconftool-2 lines in autostart.sh, e.g.
    gconftool-2 --set --type bool /desktop/gnome/background/draw_background "false" &
    and settings for gnome could be changed from a DE-specific ("OnlyShowIn=GNOME") .desktop file or two in $HOME/.config/autostart.
    I tried this, but it didnt work. Its a Gnome 3.
    I dont understand second part of your post... ("OnlyShowIn=GNOME")

  • Report ALV printing in background -display only 1 line for header

    Hi,
    We are running a ALV report (transaction code ME2N) in background and when we get  the Graphical display of the spool request, the number of columns of the header are limited and divided in 3 lines. It means that when exporting the report to excel, is quite hard to arrange it, as we get 3 lines for the same record. We need to have it directly in the same line.
    When we are programming the job, in  the u201CSpool Request Attributesu201D we are using as format  u201CX_65_255u201D.  What can we do?
    Thanks in advance,
    Lígia Moreira
    Edited by: Lígia Moreira on Sep 20, 2010 6:35 PM

    Hi,
    We are running a ALV report (transaction code ME2N) in background and when we get  the Graphical display of the spool request, the number of columns of the header are limited and divided in 3 lines. It means that when exporting the report to excel, is quite hard to arrange it, as we get 3 lines for the same record. We need to have it directly in the same line.
    When we are programming the job, in  the u201CSpool Request Attributesu201D we are using as format  u201CX_65_255u201D.  What can we do?
    Thanks in advance,
    Lígia Moreira
    Edited by: Lígia Moreira on Sep 20, 2010 6:35 PM

  • How do i change the background display to white with black text. It is white text on blackbackground right now

    Why is my screen display black background with white text?  How can i change back to black text on white background?

    Change it in Settings > General > Accessibility.

  • Configuring cronie for mailing output [solved]

    Hi,
    I am having a hard time setting up cronie for mailing output. Jump to the last sentence for the actual question.
    From man 8 cron, I read that the -m option "allows you to specify a shell command to use for sending Cron mail output instead of using sendmail(8). This command must accept a fully formatted mail message (with headers) on standard input and send it as a mail message to the recipients specified in the mail headers". I do have msmtp installed. I can do this and receive email successfully:
    $ msmtp -t << eof
    > To: <my address>@gmail.com
    >
    > test
    > eof
    Thus I know that msmtp -t is the command I must provide with the -m option.
    Then, I followed these instructions and created /etc/systemd/system/cronie.service.d/mailing.conf which contains:
    [Service]
    ExecStart=
    ExecStart=/usr/bin/crond -n -m 'msmtp -t'
    Note: the first, empty ExecStart cancels the former one from the original .service file.
    After starting cronie.service, this is the result of systemctl status cronie.service:
    cronie.service - Periodic Command Scheduler
    Loaded: loaded (/usr/lib/systemd/system/cronie.service; enabled)
    Drop-In: /etc/systemd/system/cronie.service.d
    └─mailing.conf
    Active: active (running) since Mon 2013-06-24 22:58:24 EDT; 2s ago
    Main PID: 1457 (crond)
    CGroup: name=systemd:/system/cronie.service
    └─1457 /usr/bin/crond -n -m msmtp -t
    Jun 24 22:58:24 electron systemd[1]: Started Periodic Command Scheduler.
    Jun 24 22:58:24 electron crond[1457]: (CRON) INFO (Syslog will be used instead of sendmail.)
    Jun 24 22:58:24 electron crond[1457]: (CRON) INFO (running with inotify support)
    Jun 24 22:58:24 electron crond[1457]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
    It seems that systemd drops the single quotes and takes -t as it's own parameter instead of passing it to msmtp. You can also see that crond logged "Syslog will be used instead of sendmail". I can actually see the output of my commands in /var/log/crond.log. How should I quote the space between msmtp and -t in the ExecStart line of my .service file?
    Last edited by a_neutrino (2013-06-30 21:54:53)

    Hi,
    Thanks a lot for your help. The issue is [solved].
    dif wrote:You have to create a file /etc/aliases that holds the addresses where e-mail notifications will be sent to when a user's cronjob creates an output.
    It seems unnecessary. The MAILTO variable set in the crontab accepts a complete email address.
    dif wrote:Contrary to Wiki, there are no commas separating e-mail addresses if there are a few in a line.
    The msmtp man page also says to put commas.
    dif wrote:
    There is a special script distributed with Arch that is able to scan /etc/aliases for a valid domain address and then calls msmtp. Here is its path
    /usr/share/doc/msmtp/find_alias/find_alias_for_msmtp.sh
    Copy it to /usr/bin/ and create a simlink:
    sudo cp /usr/share/doc/msmtp/find_alias/find_alias_for_msmtp.sh /usr/bin/find_alias_for_msmtp.sh
    sudo ln -s /usr/bin/find_alias_for_msmtp.sh /usr/bin/sendmail
    Why didn't you just :
    chmod +x /usr/share/doc/msmtp/find_alias/find_alias_for_msmtp.sh
    ln -s /usr/share/doc/msmtp/find_alias/find_alias_for_msmtp.sh /usr/bin/sendmail
    Also, I had to modify the find_alias_for_msmtp.sh script a little because cronie calls sendmail without any parameters:
    diff --git a/scripts/find_alias/find_alias_for_msmtp.sh b/scripts/find_alias/find_alias_for_msmtp.sh
    index fb485dd..346f313 100644
    --- a/scripts/find_alias/find_alias_for_msmtp.sh
    +++ b/scripts/find_alias/find_alias_for_msmtp.sh
    @@ -16,15 +16,18 @@ MSMTP=`which msmtp || echo "/usr/local/bin/msmtp"`
    if [ "$1" = '-i' ] ; then
    v_recipient=$2 # mailx calls sendmail with -i as the 1st param and the recipient as the second param
    -elif [ "$1" = '-t' ] ; then # most other programs call sendmail with a -t option
    +elif [ "$1" = '-t' -o $# = 0 ] ; then
    + # Most other programs call sendmail with a -t option.
    + # cronie calls sendmail without parameters and
    + # expects sendmail to find the recipient in the mail headers.
    v_to=`echo "$v_msg" | grep -m 1 'To: '`
    v_recipient=${v_to:4:50}
    else
    - v_recipient=$1 # no parameter, sendmail was called with the recipient as parameter
    + v_recipient=$1 # sendmail was called with the recipient as parameter
    fi
    -if [ $v_recipient != 0 ] ; then
    +if [ "$v_recipient" != 0 ] ; then
    # trim spaces from recipient email address
    v_recipient="${v_recipient// /}"
    Or maybe I missed something. I submitted the patch upstream to see if they think it's relevant.
    dif wrote:Hope this helps.
    Yes, it did! Thank you so much.

  • GT 70 2PC - HDD working in the background/display issue

    Hi guys,
    I experienced 2 strange problems with my MSI GT70 2PC Dominator:
    First of all, after installing my SSD and fresh installation of Win 7, the HDD still is to hear(led is indicating it as well) while booting the system. Is it normal that the HDD is still doing some actions in background?
    Moreover, after connecting my screen with DisplayPortCable, I chose an option to only use my external display. However after choosing this option, the laptop's screen seems like it's still iluminated (yeah, it's black, but iluminated). The only aid is to switch from the external to laptop display and back again to ext. screen. Is there any fix for that?

    Hello xaero18,
    Storage activity LED is indicating when any storage devices are working, including the SSD, but excluding the ODD.
    I've borrowed a GT70 2PE (880M though) and tested the DP output, but can't replicate your problem. Maybe you can try to update your video BIOS to see if it will resolve the problem. Download it from MSI website: http://www.msi.com/support/nb/GT70-2PC-Dominator.html#down-firmware
    I'll also test this if I could find any 870M card later.

  • Gtk-WARNING **: cannot open display [Solved]

    Hello,
    I've just installed openbox and experimenting with it. But I'am unable to run any panel. Ive already install lxpanel, fbpanel, plank, but each time I try to launch them from the terminal I get the same error massages. Firefox, leafpad, terminal, all launch properly, only the panels I can't make them run. Any idea how to solve this?
    [mak@myhost ~]$ fbpanel
    (fbpanel:688): Gtk-WARNING **: cannot open display:
    [mak@myhost ~]$
    [mak@myhost ~]$ plank
    [INFO 19:09:21.484514] [AbstractMain:170] Plank version: 0.7.1
    [INFO 19:09:21.484627] [AbstractMain:171] Kernel version: 3.17.6-1-ARCH
    [INFO 19:09:21.484704] [AbstractMain:172] GLib version: 2.42.1
    [INFO 19:09:21.484784] [AbstractMain:173] GTK+ version: 3.14.6
    [INFO 19:09:21.484850] [AbstractMain:175] + HiDPI support enabled
    [INFO 19:09:21.484915] [AbstractMain:177] Wnck version: 3.4.9
    [INFO 19:09:21.485001] [AbstractMain:178] Cairo version: 1.14.0
    [INFO 19:09:21.485081] [AbstractMain:179] Pango version: 1.36.8
    Unable to init server: Could not connect: Connection refused
    [WARN 19:09:21.493039] [Gtk] cannot open display:
    [mak@myhost ~]$
    Last edited by jmak (2014-12-19 00:25:02)

    karol wrote:
    The display should be set on its own. It's
    $ echo $DISPLAY
    :0
    for my first X server and
    $ echo $DISPLAY
    :1
    for the other one I'm running.
    How exactly do you start X?
    I start manually,
    startx

  • Running ME2M in the background - display variant

    Hello all,
    I try to run ME2M (purchasing report) in the background and receive the result with specific display variant.
    Does anybody know how I can tell the system to show the results with specific fields, not all of them ?
    Thanks,
    Isaac

    Hello Isaac,
    Enter T.code ME2M>Select Menu  GOTO/Variants/Save as variant  in menu bar>get into VARIANT ATTRIBUTES Screen.
    >Enter variant name (user defined)>Enter user defined text in meaning field>Select check box as reqiured like background  processing etc.>now select whichever fields you want to hide,display or other options by checking in check box on object for selection screen --->finally Save.
    After creating variant, you can get it through Variant icon (Shift+F5).
    Thanks,
    AK

  • Desktop background displays path in middle of image

    Regardless of the background image I choose, the path displays in large white text across the image. How can this be fixed?

    Regardless of the background image I choose, the path displays in large white text across the image. How can this be fixed?

  • Photoshop buttons with tranparent background display in IE 7 & 8 with a Black background

    I added Photoshop buttons to my website and they display fine in IE 9, but when I tested it on Windows XP using IE 8 and on Windows Server 2003 using IE 7 these Photoshop buttons showed up with black background where it should have been transparent.
    As a workaround I created a background in my PSD files to match the background of the website. However, this is not ideal because changing the website background in the future is now going to require editing all of the PSD buttons again.
    The other strange thing I notices is that when I had these buttons originally in the header of a Horizontal Menu Widget they worked fine on IE 7 and 8. I'm not sure why when I remove them from the widget the background shows up black.
    This definitely appears to be a BUG and hopefully Adobe can resolve it quickly.
    Let me know if anyone else has experienced this problem and how you fixed it.

    I do agree that it is probably related to the browser.  However, that does not explain why the same images display fine if they are in a horizontal menu widget.  It would seem that if they display one in a Muse website they should work anywhere in the site. Obviously that is not the case and must have something to do with the way a widget embeds the image.  I don't have an explain online since I already fixed the problem by removing the transparent background and matching the background color of the website in the photoshop PSD file.
    If you want to see an example of what the site looks like know you can go here.  http://www.itouchandlearn.com/toddler-puzzles.html the buttons that I had a problem with are the App icons accross the top. 
    I originally had everything on a single page nesting the different app pages within the horizontal menu widget, but because everything was on one page it took to long to load.  To fix this problem I created new pages for each widget menu tab and moved everything out of the menu widget.  This is when the transparent background became a problem.

  • Background displaying between main content and footer

    Hi guys, I have a bit of a strange one to ask, with a discrepancy between what I am seeing on my website (online), compared to viewing my pages in Dreamweaver.  OK, here goes.. online, the footer shows up fine, being directly underneath the main content (with nothing displaying between the footer and the main content) - however when I look at the same pages in Dreamweaver (CC), it shows a very large amount of the purplish background situated directly between the main content and the footer, and taking up an area around 4 times the height of the main content of the page (which basically makes the page 4 times bigger than it needs to be, in Dreamweaver).    I hope that description makes sense - so basically (as I scroll down the page in Dreamweaver), firstly I have the main content (taking up 20% of the total height of the page), then below that, the mystical blank area of background color (taking up  maybe around 79% of the total height), and then below that, right at the bottom, the footer (say, 1% of the total height).   Yet when I view the web pages online, the footer is sitting snugly below the main content, exactly where it is meant to be - which I guess is the important thing, but I am worried that Google will see the issue as some kind of page error, so I would prefer to fix it if I can.    Here is a typical page where the issue exists - http://www.mindtraining.net/dreamweaver/motivational-info/index.php  I have a feeling it might have something to do with the vertical blue strip I have on the right hand side of each page, as the only page where the issue doesn't exist is the homepage at http://www.mindtraining.net/dreamweaver - which doesn't have the blue strip.  Any thoughts would be greatly appreciated.  Many thanks, Craig T

    Both links are going to the same page.  So they are identical.
    <I am worried that Google will see the issue as some kind of page error>
    Google robots don't see CSS or JavaScript. They index sites based on your HTML content.
    Unfortunately, you do have a significant number of code validation errors which need attention to avoid x-browser rendering problems.
    [Invalid] Markup Validation of http://www.mindtraining.net/dreamweaver/motivational-info/index.php - W3C Mark…
    Do not use spaces in folder & file names.  On the web it creates problems b/c spaces are converted to %20.  Use underscores or hyphens but no spaces or special characters.
    Change all instances of this:
    Metamorphic Dreamweaver Template_files
    to this:
    Metamorphic-Dreamweaver-Template_files
    or this:
    Metamorphic_Dreamweaver_Template_files
    You also have some orphaned HTML tags.
    Nancy O.

Maybe you are looking for

  • Unable to assign Chart of Depreciation to Company Code

    Dear Experts, I am trying to assign newly created chart of depreciation to my company code but system is not allowing me giving the following error message: "You cannot process company code ****, it contains assets". When I go for F1, then further it

  • How to set up tv as second screen for pavilion 20-bo13w

    ???I have a hp pavilion 20-bo13w, all-in one and I need to to wire up my tv... How do I do this with only USB ports?????? Any ideas?

  • Reading and Translating

    Hello. I have a file which contains several lines in it. What I'd like to do with it is to read it line by line and see if the line has a particular character in it. (for example, I'd like to find character "&" and replace it with "and" ) After exami

  • How can I color a black and white imported jpeg?

    I am new to Illustrator, and have been watching MANY videos, but just cannot seem to figure out how to color the B&W photo I imported into Illustrator CC. Do I need to do something in Photoshop first? Am I missing a step? I was able to trace the imag

  • Error in executing Dataservice in Workshop TestView

    Hi, I am fasing a unique problem while executing my dataservices in workshop TestView. What I have done is...<br> 1.I created one XML schema file in schema project(Automatically XMLBeans will be created.) package for the XMLBean is "noNamespace."<br>