From b74235d9dee516cab0cc1f352f813e9e30c7ea5d Mon Sep 17 00:00:00 2001 From: Raoul Branten Date: Mon, 19 May 2025 18:09:28 +0200 Subject: [PATCH] init Script to automatically change background --- changebackground.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 changebackground.sh diff --git a/changebackground.sh b/changebackground.sh new file mode 100755 index 0000000..102d86b --- /dev/null +++ b/changebackground.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# This script is used to change the background of the desktop +# + +# Generate a background image using xstarfish + +SCREENWIDTH=$(xdpyinfo | awk '/dimensions/{print $2}' | grep -oE ^[[:digit:]]\+) +SCREENHEIGHT=$(xdpyinfo | awk '/dimensions/{print $2}' | grep -oE [[:digit:]]\+$) +SIZE="${SCREENWIDTH}x${SCREENHEIGHT}" + +if [ -f /usr/bin/xstarfish ]; then + /usr/bin/xstarfish -g $SIZE -o /tmp/background.jpg +else + echo "ERROR: xstarfish not found" +fi + +# Change the background image +xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorHDMI-1-0/workspace0/last-image -s /tmp/background.jpg