DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 29th December 2020
leave0 leave0 is offline
Port Guard
 
Join Date: Sep 2020
Posts: 30
Default crontab

hi ,guys ,i want change my wallpaper in every 2 minutes,so i use simple script named wallpaper.sh

Code:
#!/bin/sh

feh --bg-fill --no-fehbg `find /home/zero/picture -type f -exec echo '{}' \; | sed -n "$(($RANDOM%$(ls /home/zero/picture | wc -l)+1))p"`
and i add it to crontab,here are my crontab -l
Code:
# change wallpaper every 2 mintutes
SHELL=/bin/sh
*/2   *   *   *   * /home/zero/scripts/wallpaper.sh
and it didnt work ,i dont know what i miss!
thanks guys
Reply With Quote
  #2   (View Single Post)  
Old 29th December 2020
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bitchy Nerd Elitist
 
Join Date: Dec 2015
Location: London
Posts: 465
Default

Why not just use
Code:
feh --bg-fill --nofehbg --randomize ~/picture/*
And for your crontab I think you need to set $DISPLAY in the script:
Code:
export DISPLAY=:0
I would just add this to the top of ~/.xsession:
Code:
while true; do feh --bg-fill --nofehbg --randomize ~/picture/*; sleep 120; done &
No need for cron at all
__________________
Are you infected with Wetiko?

Last edited by Head_on_a_Stick; 29th December 2020 at 10:43 AM. Reason: use export instead of env(1)
Reply With Quote
  #3   (View Single Post)  
Old 30th December 2020
leave0 leave0 is offline
Port Guard
 
Join Date: Sep 2020
Posts: 30
Default

thank you guys ,it works
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editor for crontab? beavers OpenBSD General 3 14th February 2018 05:10 PM
reboot FreeBSD box with crontab mfaridi FreeBSD General 1 15th October 2011 02:37 AM
default crontab fbroce OpenBSD Installation and Upgrading 13 13th September 2010 09:20 PM
Crontab won't run script Petrocelli08 FreeBSD General 4 7th March 2009 04:19 AM
Crontab not working beandip FreeBSD General 6 6th August 2008 08:33 PM


All times are GMT. The time now is 09:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick