Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ I've made a little Bash script that will download a random wallpaper from r/wallpapers and set it for you

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š I've made a little Bash script that will download a random wallpaper from r/wallpapers and set it for you


๐Ÿ’ก Newskategorie: Linux Tipps
๐Ÿ”— Quelle: reddit.com

Title says it all. I thought someone here may find this useful. The script is made for KDE, but can be adapted to be used on any DE. Just replace the last command on the script with the command that replace your wallpaper on your desktop.

```

!/bin/bash

cron example:

0 * * * * ~/.local/bin/reddit-wallpaper

Cache file to save Reddit api response.

JSONCACHE="/tmp/reddit-wallpaper-cache.json"

Directory where wallpapers are going to be saved

WPATH=${WALLPAPER_PATH:-"$HOME/Pictures/Wallpapers"} mkdir -p $WPATH

We need to change our user agent so Reddit allow us to get the JSON without errors

USERAGENT="Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0"

APIURL="https://www.reddit.com/r/wallpapers.json?limit=100"

Remove cached response if older than 2 hours.

find $(dirname $JSONCACHE) -name "$(basename $JSONCACHE)" -mmin +120 -exec rm {} \; 2>/dev/null

exit on error

set -e

If the cache file doesnt exist, we create it.

if [ ! -f "$JSONCACHE" ]; then curl -H "User-Agent: $USERAGENT" $APIURL -s > $JSONCACHE fi

loop through the JSON until a valid image is found

while : ; do # Get a random item from the returned JSON WJSON=$(cat $JSONCACHE | jq -c '.data.children[].data' --raw-output | shuf -n 1) WDOMAIN=$(echo "$WJSON" | jq '.domain' --raw-output) echo $WDOMAIN if [ "$WDOMAIN" == "i.redd.it" ]; then break fi if [ "$WDOMAIN" == "reddit.com" ]; then break fi if [ "$WDOMAIN" == "i.imgur.com" ]; then break fi done

If the item is gallery, pick a random item from the gallery

WISGALLERY=$(echo "$WJSON" | jq '.is_gallery') if [ "$WISGALLERY" == "true" ]; then GITEM=$(echo "$WJSON" | jq -c '.media_metadata' --raw-output | jq -c 'to_entries[] | .value' | shuf -n 1) WMIME=$(echo "$GITEM" | jq '.m' --raw-output) WEXT=$(basename "$WMIME") WID=$(echo $GITEM | jq '.id' --raw-output) WURI="https://i.redd.it/$WID.$WEXT"

If the item is not gallery, obtain the image URL directly

else WURI=$(echo "$WJSON" | jq '.url' --raw-output) fi

echo $WURI

Get the image name + extension

WNAME=$(basename "$WURI")

FILEPATH="$WPATH/$WNAME"

If the image doesnt exists in our system, we download it.

if [ ! -f "$FILEPATH" ]; then curl "$WURI" -s > $FILEPATH fi

Set the image in our KDE system (Replace this to support other DE)

qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript " var allDesktops = desktops(); for (i=0;i<allDesktops.length;i++) {{ d = allDesktops[i]; d.wallpaperPlugin = 'org.kde.image'; d.currentConfigGroup = Array('Wallpaper', 'org.kde.image', 'General'); d.writeConfig('Image', 'file://${FILEPATH}') }} " ``` The script stores the JSON response from reddit for 2 hours in the /tmp folder for faster operation. The script also verifies if the image already exists in your wallpapers folder and avoid to download it again if it exists.

submitted by /u/CrystalJarVII
[link] [comments] ...



๐Ÿ“Œ I've made a little Bash script that will download a random wallpaper from r/wallpapers and set it for you


๐Ÿ“ˆ 93.1 Punkte

๐Ÿ“Œ Bash script to set wallpapers from your favourite subreddits


๐Ÿ“ˆ 40.9 Punkte

๐Ÿ“Œ I made a script that pulls a random wallpaper from reddit, thought I should share


๐Ÿ“ˆ 37.48 Punkte

๐Ÿ“Œ CVE-2013-4102 | Cryptocat up to 2.0.21 strophe.js Math.random Random random values (BID-61095 / OSVDB-95006)


๐Ÿ“ˆ 36.93 Punkte

๐Ÿ“Œ [OC] Made a script to just download wallpapers based on a specific search term.


๐Ÿ“ˆ 36.19 Punkte

๐Ÿ“Œ Moving Wallpapers for PC 2023 | Download Moving Wallpapers


๐Ÿ“ˆ 35.55 Punkte

๐Ÿ“Œ Random wallpaper with just bash and systemd


๐Ÿ“ˆ 34.47 Punkte

๐Ÿ“Œ I made a Bash terminal wallpaper, DM me if you want a custom username (free of change!)


๐Ÿ“ˆ 32.45 Punkte

๐Ÿ“Œ niieani/bash-oo-framework: Bash Infinity is a modern boilerplate / framework / standard library for bash


๐Ÿ“ˆ 32.43 Punkte

๐Ÿ“Œ Bash Scripting - BASH Scripts For Heavy Commandline Users [Bash Snippets]


๐Ÿ“ˆ 32.43 Punkte

๐Ÿ“Œ Bash Scripting - BASH Scripts For Heavy Commandline Users [Bash Snippets]


๐Ÿ“ˆ 32.43 Punkte

๐Ÿ“Œ Back to bash: Inception, running bash inside bash


๐Ÿ“ˆ 32.43 Punkte

๐Ÿ“Œ Linux bash exit status and how to set exit status in bash


๐Ÿ“ˆ 31.04 Punkte

๐Ÿ“Œ Here's a little script that plays a random MOD file from https://modarchive.org in command line:


๐Ÿ“ˆ 30.65 Punkte

๐Ÿ“Œ How to download wallpapers to the Linux desktop with Wallpaper Downloader


๐Ÿ“ˆ 30.15 Punkte

๐Ÿ“Œ How to download wallpapers to the Linux desktop with Wallpaper Downloader


๐Ÿ“ˆ 30.15 Punkte

๐Ÿ“Œ Elden Ring Wallpaper HD: Best Desktop Wallpapers to Download


๐Ÿ“ˆ 30.15 Punkte

๐Ÿ“Œ I created a tool to download and set wallpapers from reddit.


๐Ÿ“ˆ 30 Punkte

๐Ÿ“Œ I made a command line tool to fetch random wallpaper from reddit


๐Ÿ“ˆ 29.99 Punkte

๐Ÿ“Œ What is a Bash Script? [13 of 20] | Bash for Beginners


๐Ÿ“ˆ 29.11 Punkte

๐Ÿ“Œ Bash add pause prompt in a shell script ( bash pause command )


๐Ÿ“ˆ 29.11 Punkte

๐Ÿ“Œ Enter 6 random characters to see how random you're capable of being.


๐Ÿ“ˆ 28.57 Punkte

๐Ÿ“Œ Enter 6 random characters to see how random you're capable of being.


๐Ÿ“ˆ 28.57 Punkte

๐Ÿ“Œ I made a BASH script that removes Snap from an Ubuntu system and replaces it with Flatpak.


๐Ÿ“ˆ 28.21 Punkte

๐Ÿ“Œ This Wallpaper Bricks Most Android Phones If Set As Wallpaper


๐Ÿ“ˆ 26.77 Punkte

๐Ÿ“Œ ubg - A script to auto set wallpaper, lockscreen, and accent color of dwm from an image


๐Ÿ“ˆ 26.48 Punkte

๐Ÿ“Œ A little python script I made to manage your microphone


๐Ÿ“ˆ 26.46 Punkte

๐Ÿ“Œ I made a bash script for fedora post install


๐Ÿ“ˆ 26.42 Punkte











matomo