Skip to content

Instantly share code, notes, and snippets.

@HakierGrzonzo
Created April 21, 2022 20:13
Show Gist options
  • Save HakierGrzonzo/5150feb6af3d67e89d07b7f0433789b9 to your computer and use it in GitHub Desktop.
Save HakierGrzonzo/5150feb6af3d67e89d07b7f0433789b9 to your computer and use it in GitHub Desktop.
My wallpaper scripts
#!/usr/bin/bash
WALLPAPER="$HOME/Pictures/wallpaper.png"
WRKDIR="/tmp/blendWD"
STEP=10
mkdir $WRKDIR
convert $1 -resize 2560x1080 ${WRKDIR}/one.bmp
convert $WALLPAPER -resize 2560x1080 ${WRKDIR}/two.bmp
for ((i=$STEP; i < 100; i += $STEP)); do
composite -blend $i -gravity center ${WRKDIR}/one.bmp ${WRKDIR}/two.bmp "${WRKDIR}/${i}.bmp"
done
echo "Done processing"
for ((i=$STEP; i < 100; i += $STEP)); do
hsetroot -cover "${WRKDIR}/${i}.bmp"
done
hsetroot -cover $1
rm -r $WRKDIR
#!/bin/bash
WALLPAPER_tmp="${HOME}/Pictures/wallpaper_name"
WALLPAPER="${HOME}/Pictures/wallpaper.png"
DIR="${HOME}/Pictures/wallpapers/"
touch $WALLPAPER_tmp
CurrentWall=$(cat $WALLPAPER_tmp )
if [ "$1" == "dmenu" ]; then
echo "Dmenu mode"
TargetFile=$(ls $DIR| sort | rofi -dmenu)
elif [ -f "${DIR}${1}" ] && [ "$#" == "1" ]; then
echo "Setting $1"
TargetFile=$1
else
TargetFile=$(ls $DIR |sort -R |tail -n 2 |while read file; do
if [ "$file" == "$CurrentWall" ]; then
echo "skipping $file"
else
$HOME/scripts/blendWP.sh "${DIR}${file}"
echo $file
break
fi
done | tail -1)
fi
echo $TargetFile
cp "${DIR}${TargetFile}" $WALLPAPER
echo $TargetFile > $WALLPAPER_tmp
convert ~/Pictures/wallpapers/$TargetFile ~/Pictures/wallpaper.bmp
rm -r "${HOME}/.cache/wal"
wpg -s ~/Pictures/wallpapers/$(cat ~/Pictures/wallpaper_name)
wal -i $WALLPAPER --saturate 0.7
pywalfox update
. "${HOME}/.cache/wal/colors.sh"
# set rgb using ckb next
killall rgbwal
rgbwal $color1 $color2 $color3 $color4 $color5 $color6 > /dev/null 2> /dev/null &
disown
# Set the border colors.
#bspc config normal_border_color "$color15"
#bspc config active_border_color "$color2"
#bspc config focused_border_color "$color1"
# Use the line below if you are on bspwm >= 0.9.4
#bspc config presel_feedback_color "$color1"
spicetify update < /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment