Author Topic: Webcam refresh script for use with Desktop Wallpaper  (Read 457 times)

0 Members and 1 Guest are viewing this topic.

Offline Lefl

  • Jr. Mitglied
  • **
  • Posts: 96
  • This text is very personal
  • Branch: testing
  • Desktop: Xfce
  • GPU Card: CLUB 3D Radeon R7 260X royalQueen
  • GPU driver: radeonsi
  • Kernel: 4.3
  • Skill: Novice
Webcam refresh script for use with Desktop Wallpaper
« on: 15. March 2016, 18:55:24 »
Hello,

i wrote this script for my self but i decided to release it here.
It downloads a picture of a webcam and replaces the picture before

To use it as your wallpaper select the downloaded image in you wallpaper manager.
It shouldnt have any impact on Internet Speed or something.

Code: [Select]
#!/bin/bash
######################################################
# Define your URL here:
CAMURL=www.webcam.url
######################################################
# Define destination Path here:
PICPATH="/path/to/download/directory/current.jpg"
######################################################
# Define Interval:
DINTERVAL=10m
######################################################

while true
do

wget -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &> /dev/null
if [ ! -s /tmp/index.google ];then
sleep 1m
echo "NO CONNECTION"
else
echo "WE HAVE CONNECTION, DOWNLOADING NOW!"
wget $CAMURL --limit-rate=50k -O $PICPATH
echo "SWAPPING PICTURES"
rm current.jpg
mv temp.jpg current.jpg
echo "GOING TO SLEEP"
sleep $DINTERVAL
fi
done

Its probably a good idea to not set the destination to a SSD.
« Last Edit: 15. March 2016, 19:13:22 by Lefl »
"Our home is where we are. Our place of origin is not relevant, only where we choose to go together."
    --Legion, Mass Effect