wget image problem for daily wallpaper script












2















i have a script (that Nuno wrote) to wget an image from one particular site and set my wallpaper. however i can't seem to modify it to be able to wget an image from this site: chromecast



images in the source have a url like this: image



i can't seem to isolate the url using grep since it is greedy. i realize grep -P can work, and it does if i enter it manually in the terminal. but in the script, when assigning a variable, it doesn't work. the variable can be set with grep but not grep -P.



#!/bin/bash
# * Name: earthwall.sh
# * Description: Downloads random image from earthview.withgoogle.com and sets as wallpaper on OSX
# * Author: Nuno Serro
# * Date: 09/07/2015 22:24:11 WEST
# * License: This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# * Copyright (c) 2015, Nuno Serro
#PID=$(pgrep gnome-session)
#PID=$(pgrep -f 'gnome-session' | head -n1)
#export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ)

mkdir -p ~/Pictures/globewall
cd ~/Pictures/globewall

# Get page index
wget -q https://clients3.google.com/cast/chromecast/home -O ~/Pictures/globewall/.index.html 2> /dev/null
if [ $? -ne 0 ]; then
echo "Failed to get index from google chromecast"
exit 1
fi

# Set image url, name and location
image_url=`cat ~/Pictures/globewall/.index.html | grep lh3.googleusercontent.com | grep -shoP 'https:[\][/][\][/]lh3(.*?)-mv' -m 1 -o | head -1 | sed 's/\//g' | sed 's/u003d/=/g'`
image_name= wallpaper.jpg

# Get image
wget -q $image_url -O ~/Pictures/globewall/$image_name 2> /dev/null
if [ $? -ne 0 ]; then
echo "Failed to get image from www.googleusercontent.com"
exit 1
fi

# Change wallpaper
sleep 1
/usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://~/Pictures/globewall/$image_name"
/usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://~/Pictures/globewall/$image_name"

echo "Wallpaper changed to $image_name"
exit 0


i'm stuck.










share|improve this question



























    2















    i have a script (that Nuno wrote) to wget an image from one particular site and set my wallpaper. however i can't seem to modify it to be able to wget an image from this site: chromecast



    images in the source have a url like this: image



    i can't seem to isolate the url using grep since it is greedy. i realize grep -P can work, and it does if i enter it manually in the terminal. but in the script, when assigning a variable, it doesn't work. the variable can be set with grep but not grep -P.



    #!/bin/bash
    # * Name: earthwall.sh
    # * Description: Downloads random image from earthview.withgoogle.com and sets as wallpaper on OSX
    # * Author: Nuno Serro
    # * Date: 09/07/2015 22:24:11 WEST
    # * License: This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    #
    # * Copyright (c) 2015, Nuno Serro
    #PID=$(pgrep gnome-session)
    #PID=$(pgrep -f 'gnome-session' | head -n1)
    #export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ)

    mkdir -p ~/Pictures/globewall
    cd ~/Pictures/globewall

    # Get page index
    wget -q https://clients3.google.com/cast/chromecast/home -O ~/Pictures/globewall/.index.html 2> /dev/null
    if [ $? -ne 0 ]; then
    echo "Failed to get index from google chromecast"
    exit 1
    fi

    # Set image url, name and location
    image_url=`cat ~/Pictures/globewall/.index.html | grep lh3.googleusercontent.com | grep -shoP 'https:[\][/][\][/]lh3(.*?)-mv' -m 1 -o | head -1 | sed 's/\//g' | sed 's/u003d/=/g'`
    image_name= wallpaper.jpg

    # Get image
    wget -q $image_url -O ~/Pictures/globewall/$image_name 2> /dev/null
    if [ $? -ne 0 ]; then
    echo "Failed to get image from www.googleusercontent.com"
    exit 1
    fi

    # Change wallpaper
    sleep 1
    /usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
    /usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://~/Pictures/globewall/$image_name"
    /usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://~/Pictures/globewall/$image_name"

    echo "Wallpaper changed to $image_name"
    exit 0


    i'm stuck.










    share|improve this question

























      2












      2








      2








      i have a script (that Nuno wrote) to wget an image from one particular site and set my wallpaper. however i can't seem to modify it to be able to wget an image from this site: chromecast



      images in the source have a url like this: image



      i can't seem to isolate the url using grep since it is greedy. i realize grep -P can work, and it does if i enter it manually in the terminal. but in the script, when assigning a variable, it doesn't work. the variable can be set with grep but not grep -P.



      #!/bin/bash
      # * Name: earthwall.sh
      # * Description: Downloads random image from earthview.withgoogle.com and sets as wallpaper on OSX
      # * Author: Nuno Serro
      # * Date: 09/07/2015 22:24:11 WEST
      # * License: This program is free software: you can redistribute it and/or modify
      # it under the terms of the GNU General Public License as published by
      # the Free Software Foundation, either version 3 of the License, or
      # (at your option) any later version.
      # This program is distributed in the hope that it will be useful,
      # but WITHOUT ANY WARRANTY; without even the implied warranty of
      # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      # GNU General Public License for more details.
      # You should have received a copy of the GNU General Public License
      # along with this program. If not, see <http://www.gnu.org/licenses/>.
      #
      # * Copyright (c) 2015, Nuno Serro
      #PID=$(pgrep gnome-session)
      #PID=$(pgrep -f 'gnome-session' | head -n1)
      #export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ)

      mkdir -p ~/Pictures/globewall
      cd ~/Pictures/globewall

      # Get page index
      wget -q https://clients3.google.com/cast/chromecast/home -O ~/Pictures/globewall/.index.html 2> /dev/null
      if [ $? -ne 0 ]; then
      echo "Failed to get index from google chromecast"
      exit 1
      fi

      # Set image url, name and location
      image_url=`cat ~/Pictures/globewall/.index.html | grep lh3.googleusercontent.com | grep -shoP 'https:[\][/][\][/]lh3(.*?)-mv' -m 1 -o | head -1 | sed 's/\//g' | sed 's/u003d/=/g'`
      image_name= wallpaper.jpg

      # Get image
      wget -q $image_url -O ~/Pictures/globewall/$image_name 2> /dev/null
      if [ $? -ne 0 ]; then
      echo "Failed to get image from www.googleusercontent.com"
      exit 1
      fi

      # Change wallpaper
      sleep 1
      /usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
      /usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://~/Pictures/globewall/$image_name"
      /usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://~/Pictures/globewall/$image_name"

      echo "Wallpaper changed to $image_name"
      exit 0


      i'm stuck.










      share|improve this question














      i have a script (that Nuno wrote) to wget an image from one particular site and set my wallpaper. however i can't seem to modify it to be able to wget an image from this site: chromecast



      images in the source have a url like this: image



      i can't seem to isolate the url using grep since it is greedy. i realize grep -P can work, and it does if i enter it manually in the terminal. but in the script, when assigning a variable, it doesn't work. the variable can be set with grep but not grep -P.



      #!/bin/bash
      # * Name: earthwall.sh
      # * Description: Downloads random image from earthview.withgoogle.com and sets as wallpaper on OSX
      # * Author: Nuno Serro
      # * Date: 09/07/2015 22:24:11 WEST
      # * License: This program is free software: you can redistribute it and/or modify
      # it under the terms of the GNU General Public License as published by
      # the Free Software Foundation, either version 3 of the License, or
      # (at your option) any later version.
      # This program is distributed in the hope that it will be useful,
      # but WITHOUT ANY WARRANTY; without even the implied warranty of
      # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      # GNU General Public License for more details.
      # You should have received a copy of the GNU General Public License
      # along with this program. If not, see <http://www.gnu.org/licenses/>.
      #
      # * Copyright (c) 2015, Nuno Serro
      #PID=$(pgrep gnome-session)
      #PID=$(pgrep -f 'gnome-session' | head -n1)
      #export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ)

      mkdir -p ~/Pictures/globewall
      cd ~/Pictures/globewall

      # Get page index
      wget -q https://clients3.google.com/cast/chromecast/home -O ~/Pictures/globewall/.index.html 2> /dev/null
      if [ $? -ne 0 ]; then
      echo "Failed to get index from google chromecast"
      exit 1
      fi

      # Set image url, name and location
      image_url=`cat ~/Pictures/globewall/.index.html | grep lh3.googleusercontent.com | grep -shoP 'https:[\][/][\][/]lh3(.*?)-mv' -m 1 -o | head -1 | sed 's/\//g' | sed 's/u003d/=/g'`
      image_name= wallpaper.jpg

      # Get image
      wget -q $image_url -O ~/Pictures/globewall/$image_name 2> /dev/null
      if [ $? -ne 0 ]; then
      echo "Failed to get image from www.googleusercontent.com"
      exit 1
      fi

      # Change wallpaper
      sleep 1
      /usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
      /usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://~/Pictures/globewall/$image_name"
      /usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://~/Pictures/globewall/$image_name"

      echo "Wallpaper changed to $image_name"
      exit 0


      i'm stuck.







      grep scripting wget wallpaper






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 8 at 19:01









      ticotexasticotexas

      183




      183






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Your script needs a bit of a makeover.



          The two lines following the #Set image url, name and location line are broken for various reasons (e.g. incorrect grep syntax, incorrect assignment). In addition, your script doesn't double quote filenames which may break your script depending on the circumstances.



          To make it work more reliably, I rewrote the core of your script as follows:



          #!/bin/bash
          fn_basedir=~/Pictures/globewall/
          fn_index='.index.html'
          fn_image='wallpaper.jpg'

          mkdir -p "$fn_basedir"

          # Get page index
          wget -q "https://clients3.google.com/cast/chromecast/home" -O "${fn_basedir}${fn_index}"
          if [ $? -ne 0 ]; then
          echo "Failed to get index from google chromecast"
          exit 1
          fi

          # Set image url
          image_url=$(grep -oP 'https:\/\/lh3(.*?)-mv' "${fn_basedir}${fn_index}" | sed -e 's/\//g' -e 's/u003d/=/g' | head -1)

          # Get image
          wget -q "$image_url" -O "${fn_basedir}${fn_image}"
          if [ $? -ne 0 ]; then
          echo "Failed to get image from www.googleusercontent.com"
          exit 1
          fi

          # Change wallpaper
          sleep 1
          /usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
          /usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://${fn_basedir}${fn_image}"
          /usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://${fn_basedir}${fn_image}"

          echo "Wallpaper changed to ${fn_image}"
          exit 0


          Awesome pictures btw!






          share|improve this answer


























          • thanks, @ozzy! that helps me learn the correct way to write my scripts. i appreciate it. the only thing i had to change was ~/Pictures/globewall to /home/myname/Pictures/globewall. i found it was creating a directory called ~ in the directory where my script was run from rather than interpreting it as my home directory. then gnome could not find the image when changing the wallpaper, it just became a black background.

            – ticotexas
            Jan 8 at 23:41











          • @ticotexas That’s my bad. A result of accidentally quoting the tilde, which prevents its expansion by the shell.

            – ozzy
            Jan 8 at 23:46











          • @ticotexas Oh, and as a matter of website etiquette, if you feel my answer actually answered your question/solved your problem, you may formally accept it, so as to sort of close it.

            – ozzy
            Jan 9 at 0:07













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493308%2fwget-image-problem-for-daily-wallpaper-script%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Your script needs a bit of a makeover.



          The two lines following the #Set image url, name and location line are broken for various reasons (e.g. incorrect grep syntax, incorrect assignment). In addition, your script doesn't double quote filenames which may break your script depending on the circumstances.



          To make it work more reliably, I rewrote the core of your script as follows:



          #!/bin/bash
          fn_basedir=~/Pictures/globewall/
          fn_index='.index.html'
          fn_image='wallpaper.jpg'

          mkdir -p "$fn_basedir"

          # Get page index
          wget -q "https://clients3.google.com/cast/chromecast/home" -O "${fn_basedir}${fn_index}"
          if [ $? -ne 0 ]; then
          echo "Failed to get index from google chromecast"
          exit 1
          fi

          # Set image url
          image_url=$(grep -oP 'https:\/\/lh3(.*?)-mv' "${fn_basedir}${fn_index}" | sed -e 's/\//g' -e 's/u003d/=/g' | head -1)

          # Get image
          wget -q "$image_url" -O "${fn_basedir}${fn_image}"
          if [ $? -ne 0 ]; then
          echo "Failed to get image from www.googleusercontent.com"
          exit 1
          fi

          # Change wallpaper
          sleep 1
          /usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
          /usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://${fn_basedir}${fn_image}"
          /usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://${fn_basedir}${fn_image}"

          echo "Wallpaper changed to ${fn_image}"
          exit 0


          Awesome pictures btw!






          share|improve this answer


























          • thanks, @ozzy! that helps me learn the correct way to write my scripts. i appreciate it. the only thing i had to change was ~/Pictures/globewall to /home/myname/Pictures/globewall. i found it was creating a directory called ~ in the directory where my script was run from rather than interpreting it as my home directory. then gnome could not find the image when changing the wallpaper, it just became a black background.

            – ticotexas
            Jan 8 at 23:41











          • @ticotexas That’s my bad. A result of accidentally quoting the tilde, which prevents its expansion by the shell.

            – ozzy
            Jan 8 at 23:46











          • @ticotexas Oh, and as a matter of website etiquette, if you feel my answer actually answered your question/solved your problem, you may formally accept it, so as to sort of close it.

            – ozzy
            Jan 9 at 0:07


















          1














          Your script needs a bit of a makeover.



          The two lines following the #Set image url, name and location line are broken for various reasons (e.g. incorrect grep syntax, incorrect assignment). In addition, your script doesn't double quote filenames which may break your script depending on the circumstances.



          To make it work more reliably, I rewrote the core of your script as follows:



          #!/bin/bash
          fn_basedir=~/Pictures/globewall/
          fn_index='.index.html'
          fn_image='wallpaper.jpg'

          mkdir -p "$fn_basedir"

          # Get page index
          wget -q "https://clients3.google.com/cast/chromecast/home" -O "${fn_basedir}${fn_index}"
          if [ $? -ne 0 ]; then
          echo "Failed to get index from google chromecast"
          exit 1
          fi

          # Set image url
          image_url=$(grep -oP 'https:\/\/lh3(.*?)-mv' "${fn_basedir}${fn_index}" | sed -e 's/\//g' -e 's/u003d/=/g' | head -1)

          # Get image
          wget -q "$image_url" -O "${fn_basedir}${fn_image}"
          if [ $? -ne 0 ]; then
          echo "Failed to get image from www.googleusercontent.com"
          exit 1
          fi

          # Change wallpaper
          sleep 1
          /usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
          /usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://${fn_basedir}${fn_image}"
          /usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://${fn_basedir}${fn_image}"

          echo "Wallpaper changed to ${fn_image}"
          exit 0


          Awesome pictures btw!






          share|improve this answer


























          • thanks, @ozzy! that helps me learn the correct way to write my scripts. i appreciate it. the only thing i had to change was ~/Pictures/globewall to /home/myname/Pictures/globewall. i found it was creating a directory called ~ in the directory where my script was run from rather than interpreting it as my home directory. then gnome could not find the image when changing the wallpaper, it just became a black background.

            – ticotexas
            Jan 8 at 23:41











          • @ticotexas That’s my bad. A result of accidentally quoting the tilde, which prevents its expansion by the shell.

            – ozzy
            Jan 8 at 23:46











          • @ticotexas Oh, and as a matter of website etiquette, if you feel my answer actually answered your question/solved your problem, you may formally accept it, so as to sort of close it.

            – ozzy
            Jan 9 at 0:07
















          1












          1








          1







          Your script needs a bit of a makeover.



          The two lines following the #Set image url, name and location line are broken for various reasons (e.g. incorrect grep syntax, incorrect assignment). In addition, your script doesn't double quote filenames which may break your script depending on the circumstances.



          To make it work more reliably, I rewrote the core of your script as follows:



          #!/bin/bash
          fn_basedir=~/Pictures/globewall/
          fn_index='.index.html'
          fn_image='wallpaper.jpg'

          mkdir -p "$fn_basedir"

          # Get page index
          wget -q "https://clients3.google.com/cast/chromecast/home" -O "${fn_basedir}${fn_index}"
          if [ $? -ne 0 ]; then
          echo "Failed to get index from google chromecast"
          exit 1
          fi

          # Set image url
          image_url=$(grep -oP 'https:\/\/lh3(.*?)-mv' "${fn_basedir}${fn_index}" | sed -e 's/\//g' -e 's/u003d/=/g' | head -1)

          # Get image
          wget -q "$image_url" -O "${fn_basedir}${fn_image}"
          if [ $? -ne 0 ]; then
          echo "Failed to get image from www.googleusercontent.com"
          exit 1
          fi

          # Change wallpaper
          sleep 1
          /usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
          /usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://${fn_basedir}${fn_image}"
          /usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://${fn_basedir}${fn_image}"

          echo "Wallpaper changed to ${fn_image}"
          exit 0


          Awesome pictures btw!






          share|improve this answer















          Your script needs a bit of a makeover.



          The two lines following the #Set image url, name and location line are broken for various reasons (e.g. incorrect grep syntax, incorrect assignment). In addition, your script doesn't double quote filenames which may break your script depending on the circumstances.



          To make it work more reliably, I rewrote the core of your script as follows:



          #!/bin/bash
          fn_basedir=~/Pictures/globewall/
          fn_index='.index.html'
          fn_image='wallpaper.jpg'

          mkdir -p "$fn_basedir"

          # Get page index
          wget -q "https://clients3.google.com/cast/chromecast/home" -O "${fn_basedir}${fn_index}"
          if [ $? -ne 0 ]; then
          echo "Failed to get index from google chromecast"
          exit 1
          fi

          # Set image url
          image_url=$(grep -oP 'https:\/\/lh3(.*?)-mv' "${fn_basedir}${fn_index}" | sed -e 's/\//g' -e 's/u003d/=/g' | head -1)

          # Get image
          wget -q "$image_url" -O "${fn_basedir}${fn_image}"
          if [ $? -ne 0 ]; then
          echo "Failed to get image from www.googleusercontent.com"
          exit 1
          fi

          # Change wallpaper
          sleep 1
          /usr/bin/gsettings set org.gnome.desktop.background picture-options 'zoom'
          /usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://${fn_basedir}${fn_image}"
          /usr/bin/gsettings set org.gnome.desktop.screensaver picture-uri "file://${fn_basedir}${fn_image}"

          echo "Wallpaper changed to ${fn_image}"
          exit 0


          Awesome pictures btw!







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 8 at 23:46

























          answered Jan 8 at 19:55









          ozzyozzy

          5755




          5755













          • thanks, @ozzy! that helps me learn the correct way to write my scripts. i appreciate it. the only thing i had to change was ~/Pictures/globewall to /home/myname/Pictures/globewall. i found it was creating a directory called ~ in the directory where my script was run from rather than interpreting it as my home directory. then gnome could not find the image when changing the wallpaper, it just became a black background.

            – ticotexas
            Jan 8 at 23:41











          • @ticotexas That’s my bad. A result of accidentally quoting the tilde, which prevents its expansion by the shell.

            – ozzy
            Jan 8 at 23:46











          • @ticotexas Oh, and as a matter of website etiquette, if you feel my answer actually answered your question/solved your problem, you may formally accept it, so as to sort of close it.

            – ozzy
            Jan 9 at 0:07





















          • thanks, @ozzy! that helps me learn the correct way to write my scripts. i appreciate it. the only thing i had to change was ~/Pictures/globewall to /home/myname/Pictures/globewall. i found it was creating a directory called ~ in the directory where my script was run from rather than interpreting it as my home directory. then gnome could not find the image when changing the wallpaper, it just became a black background.

            – ticotexas
            Jan 8 at 23:41











          • @ticotexas That’s my bad. A result of accidentally quoting the tilde, which prevents its expansion by the shell.

            – ozzy
            Jan 8 at 23:46











          • @ticotexas Oh, and as a matter of website etiquette, if you feel my answer actually answered your question/solved your problem, you may formally accept it, so as to sort of close it.

            – ozzy
            Jan 9 at 0:07



















          thanks, @ozzy! that helps me learn the correct way to write my scripts. i appreciate it. the only thing i had to change was ~/Pictures/globewall to /home/myname/Pictures/globewall. i found it was creating a directory called ~ in the directory where my script was run from rather than interpreting it as my home directory. then gnome could not find the image when changing the wallpaper, it just became a black background.

          – ticotexas
          Jan 8 at 23:41





          thanks, @ozzy! that helps me learn the correct way to write my scripts. i appreciate it. the only thing i had to change was ~/Pictures/globewall to /home/myname/Pictures/globewall. i found it was creating a directory called ~ in the directory where my script was run from rather than interpreting it as my home directory. then gnome could not find the image when changing the wallpaper, it just became a black background.

          – ticotexas
          Jan 8 at 23:41













          @ticotexas That’s my bad. A result of accidentally quoting the tilde, which prevents its expansion by the shell.

          – ozzy
          Jan 8 at 23:46





          @ticotexas That’s my bad. A result of accidentally quoting the tilde, which prevents its expansion by the shell.

          – ozzy
          Jan 8 at 23:46













          @ticotexas Oh, and as a matter of website etiquette, if you feel my answer actually answered your question/solved your problem, you may formally accept it, so as to sort of close it.

          – ozzy
          Jan 9 at 0:07







          @ticotexas Oh, and as a matter of website etiquette, if you feel my answer actually answered your question/solved your problem, you may formally accept it, so as to sort of close it.

          – ozzy
          Jan 9 at 0:07




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493308%2fwget-image-problem-for-daily-wallpaper-script%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Morgemoulin

          Scott Moir

          Souastre