From 2e7be84c789801304c86a07351621e0503ccdf40 Mon Sep 17 00:00:00 2001 From: kdam0 Date: Mon, 13 Mar 2023 19:24:56 -0400 Subject: added initial repo files --- bg.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 bg.sh (limited to 'bg.sh') diff --git a/bg.sh b/bg.sh new file mode 100755 index 0000000..9bcefa6 --- /dev/null +++ b/bg.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +WALLPAPERS_HOME=${1:-$HOME/pics/wallpapers} + +# Get a random image file from the dir. +RAND_BG=$(find "$WALLPAPERS_HOME" -type f -name "*.jpeg" -o -name "*.jpg" -o -name "*.png" | shuf | head -n1) + +# Set the image file as the background. +(command -v wbg > /dev/null || (echo "wbg is not installed." && exit 1) && \ + # else + notify-send "Set background." && wbg "${RAND_BG}" +) -- cgit v1.2.3