Skip to content

Instantly share code, notes, and snippets.

@97-109-107
Last active March 31, 2023 22:46
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 97-109-107/c5de7bfe8f83570593a5 to your computer and use it in GitHub Desktop.
Save 97-109-107/c5de7bfe8f83570593a5 to your computer and use it in GitHub Desktop.
Aids in setting stupid tiles as X11 background; tints and tiles;
#!/bin/sh
# ██ ██ ██ ██ ██
# ░██ ░░ ░██ ░██ ░██
# ██████ ██ ░██ █████ ██████ █████ ██████ ██████ █████ ██████
# ░░░██░ ░██ ░██ ██░░░██ █████ ██░░░░ ██░░░██░░░██░ ░░░██░ ██░░░██░░██░░█
# ░██ ░██ ░██░███████░░░░░ ░░█████ ░███████ ░██ ░██ ░███████ ░██ ░
# ░██ ░██ ░██░██░░░░ ░░░░░██░██░░░░ ░██ ░██ ░██░░░░ ░██
# ░░██ ░██ ███░░██████ ██████ ░░██████ ░░██ ░░██ ░░██████░███
# ░░ ░░ ░░░ ░░░░░░ ░░░░░░ ░░░░░░ ░░ ░░ ░░░░░░ ░░░
# Aids in setting stupid tiles as X11 background; tints and tiles;
# Depends on
# - imagemagick
# - hsetroot
# - zenity
# - sxiv
#Point to you directory with gaudy tiles
directory="~/Pictures/"
#GLOBALS
tint=false
commandtint=""
commandinvert=""
#Asking for image
echo "Pick the image you want with 'm', then exit sxiv"
image=$(sxiv -tor $directory)
image=$(printf %q "$image")
#Asking for input
choice=$(zenity --height=250 --list --checklist \
--title='tile-setter' --column=Boxes --column=Selections \
--text='Pick any treatments you want to apply to the image' \
--separator=':' \
FALSE "Invert" \
FALSE "Apply tinting")
IFS=":" ; for word in $choice ; do
case $word in
"Invert")
commandinvert="-contrast -100"
;;
"Apply tinting")
tint=true
;;
esac
done
#Ask for color, if tinting selected
if [ $tint = true ]
then
color=$(zenity --color-selection --color="#5A6B84")
if [[ $? == 0 ]]
then
hex=$(convert xc:"$color" -depth 8 txt:- | tail -n 1 | grep -o "\#......")
commandtint=" -tint '$hex'"
else
echo "No color selected."
exit
fi
fi
commandmain="hsetroot -tile $image"
command=$commandmain" "$commandinvert" "$commandtint
eval $command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment