Skip to content

Instantly share code, notes, and snippets.

@hydren
Created August 26, 2023 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hydren/4896fd22c0a4ef0fc3131b62c2b4c2e5 to your computer and use it in GitHub Desktop.
Save hydren/4896fd22c0a4ef0fc3131b62c2b4c2e5 to your computer and use it in GitHub Desktop.
A zenity script to provide a simple dialog to choose wallpapers in conjunction with stitchWPmod.sh script
#!/bin/bash
wpFiles=()
XOUT=$(xrandr | grep -oP '.*(?=\sconnected)')
for LINE in $XOUT; do
FILE=`zenity --file-selection --file-filter=""*.bmp" "*.gif" "*.jpg" "*.jpeg" "*.png" "*.webp"" --title="Select an image for display $LINE"`
case $? in
0)
wpFile="${FILE}"
wpFiles+=("$wpFile");;
1)
echo "No file selected."
exit;;
-1)
echo "An unexpected error has occurred."
exit;;
esac
done
./stitchWPmod.sh "${wpFiles[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment