19 lines
599 B
Bash
19 lines
599 B
Bash
|
|
#!/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
|