Announcement

Collapse
No announcement yet.

overwrite?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    overwrite?

    This is the script I use to download sat pics of earth. Forget where I found it

    Code:
    #!/bin/bash
    
            wget http://www.opentopia.com/images/data/sunlight/world_sunlight_map_rectangular.jpg -O world.jpg
            temp=$(stat -c%s world.jpg)
    I would like the script to overwrite world.jpg each time it runs.

    Set it on a 15 min cron
    Code:
    */15 * * * * /home/virgil/scripts/changer.sh
    Not sure why, but it isn't running. Syntax?

    Ultimate goal is to use world.jpg as wallpaper and have it auto-update every 15 minutes. Also have to get kde to do that. if I put the file in a dir by itself and use slideshow, it doesn't work..

    Is there an easier way to do this? The other apps I have seen work with gnome and other desktops I don't want to use

    #2
    Change your crontab to the following:

    Code:
    SHELL=/bin/bash
    */15 * * * * $HOME/Documents/scripts/changer.sh > /dev/null 2>&1
    and your bash scrip to the following (modify the output path as needed)

    Code:
    #!/bin/bash
    source $HOME/.bashrc
    wget http://www.opentopia.com/images/data/sunlight/world_sunlight_map_rectangular.jpg -O $HOME/Pictures/changer/world.jpg
    This sets cron up with the bas shell and your environment.

    Still looking in to how to change the wallpaper though.
    If you're sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!

    Comment


      #3
      There are many ways....

      Still looking in to how to change the wallpaper though.
      With the (one picture) slideshow wallpaper ?



      Plasma4

      Older: https://www.kubuntuforums.net/showth...l=1#post361107


      Plasma5

      Writing:

      ~/.local/share/plasma/wallpapers/org.web.cam/metadata.desktop
      Code:
      [Desktop Entry]
      Encoding=UTF-8
      Name=Webcam
      Name[x-test]=xxWebcamxxx
      
      Type=Service
      ServiceTypes=Plasma/DeclarativeWallpaper
      Icon=preferences-desktop-wallpaper
      X-Plasma-MainScript=ui/main.qml
      X-KDE-PluginInfo-Name=org.web.cam
      X-KDE-PluginInfo-EnabledByDefault=true
      ~/.local/share/plasma/wallpapers/org.web.cam/contents/ui/main.qml
      Code:
      import QtQuick 2.5
      
      Rectangle {
          id: main
          width: 853
          height: 480
      
          Image {
              id: showImage
              cache : false
              fillMode: Image.PreserveAspectCrop
              anchors.fill: parent
              source: "http://ftp2.innofactor.com/helsinginsatama/image_00001.jpg"
              clip: true
          }
      
          Timer {
              // milliseconds
              interval: 60000
              repeat: true
              running: true
              onTriggered: { showImage.source =""; showImage.source = "http://ftp2.innofactor.com/helsinginsatama/image_00001.jpg" }
          }
      }



      Executing the kbuildsycoca5:
      Code:
      kbuildsycoca5 --noincremental
      Picking the webcam wallpaper:



      Seems to work...




      Links

      Image QML Type: http://doc.qt.io/qt-5/qml-qtquick-image.html
      Timer QML Type: http://doc.qt.io/qt-5/qml-qtqml-timer.html
      Last edited by Rog131; Sep 26, 2015, 09:43 AM.
      Before you edit, BACKUP !

      Why there are dead links ?
      1. Thread: Please explain how to access old kubuntu forum posts
      2. Thread: Lost Information

      Comment


        #4
        OK, this is a little bit hacky and I'm sure someone will appear with a more "KDEish" solution but:

        1. Change the bash script to be the following, changing your paths as needed.

        Code:
        #!/bin/bash
        source $HOME/.bashrc
        
        FILE1="$HOME/Pictures/changer/world1.jpg"
        FILE2="$HOME/Pictures/changer/world2.jpg"
        
        wget http://www.opentopia.com/images/data/sunlight/world_sunlight_map_rectangular.jpg -O $FILE1
        touch $FILE1
        cp $FILE1 $FILE2
        2. Set the desktop wallpaper to slide show and point it at your folder. Set the timer as you like. Maybe every minute.

        3. You may need to initially create the world1.jpg and world2.jpg files. They should both be a copy of your current world.jpg, which can then be removed.

        The idea is to have two identical pictures in the slide show which are grabbed from the net every 15 minutes. The slide show just alternates between them.
        If you're sitting wondering,
        Which Batman is the best,
        There's only one true answer my friend,
        It's Adam Bloody West!

        Comment


          #5
          Originally posted by Rog131 View Post
          With the (one picture) slideshow wallpaper ?



          Plasma4

          Older: https://www.kubuntuforums.net/showth...l=1#post361107


          Plasma5

          Writing:
          ...
          Links

          Image QML Type: http://doc.qt.io/qt-5/qml-qtquick-image.html
          Timer QML Type: http://doc.qt.io/qt-5/qml-qtqml-timer.html

          Presumably, this also removes the need for the cron as it looks like it grabs the image itself? Also, does anything special, such as build tools, need to be installed?
          If you're sitting wondering,
          Which Batman is the best,
          There's only one true answer my friend,
          It's Adam Bloody West!

          Comment


            #6
            Originally posted by elijathegold View Post
            Presumably, this also removes the need for the cron as it looks like it grabs the image itself? Also, does anything special, such as build tools, need to be installed?
            No cron needed - It is a qml script and it is using the qml timer.

            The KDE is using the Qt and the part of the Qt is the qml: https://en.wikipedia.org/wiki/QML .

            The qml script is good to verify with the qmlscene: https://doc.qt.io/archives/qt-5.3/qtquick-qmlscene.html . Ubuntu package - qmlscene: http://packages.ubuntu.com/search?ke...ll&section=all .

            The 'import QtQuick 2.5' means needs Qt 5.5: https://forum.qt.io/topic/50948/how-...a-qt-version/2 . But it a simple script so it probably works with the Qt5.x -> 'import QtQuick 2.x'.
            Try Me !

            Comment

            Working...
            X