Skip to content

Instantly share code, notes, and snippets.

@daniel-j
Last active July 26, 2022 08:07
Show Gist options
  • Save daniel-j/7551939 to your computer and use it in GitHub Desktop.
Save daniel-j/7551939 to your computer and use it in GitHub Desktop.

Revisions

  1. daniel-j revised this gist Mar 24, 2015. 2 changed files with 22 additions and 4 deletions.
    5 changes: 4 additions & 1 deletion wallpaper-changer
    Original file line number Diff line number Diff line change
    @@ -14,8 +14,11 @@ while true; do
    LIST=`find "$FOLDER" -type f \( -name '*.jpg' -o -name '*.png' \) | shuf`
    for i in $LIST; do
    echo "$i"
    # gsettings set org.gnome.desktop.background picture-uri "file://$i"
    feh "$i" --bg-fill
    sleep $DELAY
    # pcmanfm -w "$i"
    sleep ${DELAY}m
    done
    sleep 1
    done

    21 changes: 18 additions & 3 deletions wallpaper-changer-remote
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,36 @@
    #!/bin/bash
    #
    # Created by djazz // Dangershy
    # Dependencies: curl, feh
    # Created by djazz
    # Dependencies: curl
    # You need Gnome or feh, depending on what DE/WM you use
    #

    IMGLIST="http://djazz.se/pony/wallpapers/images.txt"
    IMGSCRIPT="http://djazz.se/pony/wallpapers/image.php"
    DELAY=10

    DOWNLOAD_DIR=/tmp

    USE_GNOME=0 # uses /tmp
    USE_FEH=1

    # to make it loop over lines instead of spaces in filenames
    IFS=$'\n';

    while true; do
    LIST=`curl -s "${IMGLIST}" | shuf`
    for i in $LIST; do
    echo "$i"
    curl -s -G "${IMGSCRIPT}" --data-urlencode "f=$i" | feh - --bg-fill &
    if [ "$USE_GNOME" -eq 1 ]; then
    curl -s -G "${IMGSCRIPT}" --data-urlencode "f=$i" -o "$DOWNLOAD_DIR/next-wallpaper"
    mv "$DOWNLOAD_DIR/next-wallpaper" "$DOWNLOAD_DIR/wallpaper"
    gsettings set org.gnome.desktop.background picture-uri "file://$DOWNLOAD_DIR/wallpaper"
    fi

    if [ "$USE_FEH" -eq 1 ]; then
    curl -s -G "${IMGSCRIPT}" --data-urlencode "f=$i" | feh - --bg-fill &
    fi

    sleep ${DELAY}m
    done
    sleep 1
  2. daniel-j revised this gist Dec 2, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wallpaper-changer-remote
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@

    IMGLIST="http://djazz.se/pony/wallpapers/images.txt"
    IMGSCRIPT="http://djazz.se/pony/wallpapers/image.php"
    DELAY=5
    DELAY=10

    # to make it loop over lines instead of spaces in filenames
    IFS=$'\n';
  3. daniel-j revised this gist Dec 1, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions wallpaper-changer-remote
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,18 @@
    #!/bin/bash
    #
    # Created by djazz // Dangershy
    # Dependencies: curl, js, jsawk, feh
    # Dependencies: curl, feh
    #

    IMGLIST="http://djazz.se/pony/wallpapers/images.json"
    IMGLIST="http://djazz.se/pony/wallpapers/images.txt"
    IMGSCRIPT="http://djazz.se/pony/wallpapers/image.php"
    DELAY=10
    DELAY=5

    # to make it loop over lines instead of spaces in filenames
    IFS=$'\n';

    while true; do
    LIST=`curl -s "${IMGLIST}" | jsawk -a 'return this.join("\n")' | shuf`
    LIST=`curl -s "${IMGLIST}" | shuf`
    for i in $LIST; do
    echo "$i"
    curl -s -G "${IMGSCRIPT}" --data-urlencode "f=$i" | feh - --bg-fill &
  4. daniel-j revised this gist Dec 1, 2013. 2 changed files with 5 additions and 1 deletion.
    4 changes: 4 additions & 0 deletions wallpaper-changer
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,8 @@
    #!/bin/bash
    #
    # Created by djazz // Dangershy
    # Dependencies: feh
    #

    FOLDER="~/Pictures/wallpapers"
    DELAY=10
    2 changes: 1 addition & 1 deletion wallpaper-changer-remote
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/bash
    #
    # Created by djazz
    # Created by djazz // Dangershy
    # Dependencies: curl, js, jsawk, feh
    #

  5. daniel-j revised this gist Dec 1, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions wallpaper-changer-remote
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    #!/bin/bash
    #
    # Created by djazz
    # Dependencies: curl, jsawk, feh
    # Dependencies: curl, js, jsawk, feh
    #

    IMGLIST="http://djazz.se/pony/wallpapers/images.json"
    IMGSCRIPT="http://djazz.se/pony/wallpapers/image.php"
    DELAY=5
    DELAY=10

    # to make it loop over lines instead of spaces in filenames
    IFS=$'\n';
  6. daniel-j revised this gist Nov 29, 2013. 1 changed file with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions wallpaper-changer-remote
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/bin/bash
    #
    # Created by djazz
    # Dependencies: curl, jsawk, feh
    #

    IMGLIST="http://djazz.se/pony/wallpapers/images.json"
    IMGSCRIPT="http://djazz.se/pony/wallpapers/image.php"
    DELAY=5

    # to make it loop over lines instead of spaces in filenames
    IFS=$'\n';

    while true; do
    LIST=`curl -s "${IMGLIST}" | jsawk -a 'return this.join("\n")' | shuf`
    for i in $LIST; do
    echo "$i"
    curl -s -G "${IMGSCRIPT}" --data-urlencode "f=$i" | feh - --bg-fill &
    sleep ${DELAY}m
    done
    sleep 1
    done
  7. daniel-j created this gist Nov 19, 2013.
    17 changes: 17 additions & 0 deletions wallpaper-changer
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/bash

    FOLDER="~/Pictures/wallpapers"
    DELAY=10

    # to make it loop over lines instead of spaces in filenames
    IFS=$'\n';

    while true; do
    LIST=`find "$FOLDER" -type f \( -name '*.jpg' -o -name '*.png' \) | shuf`
    for i in $LIST; do
    echo "$i"
    feh "$i" --bg-fill
    sleep $DELAY
    done
    sleep 1
    done