dots/.scripts/theme

34 lines
731 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
bgdir="$HOME/pic/bg"
cache="$HOME/.cache/wal"
config="$HOME/.config"
dir=$bgdir
if [ $# -eq 1 ]; then
dir=$1
fi
2022-01-17 23:22:36 +01:00
file=$(sxiv -o "$dir")
if [ $# -eq 1 ]; then
2022-01-17 23:22:36 +01:00
cp "$file" "$bgdir"/"$(basename "$file")"
fi
# generate terminal colors with wal
2022-01-17 23:22:36 +01:00
wal -i "$file"
# move temporary files to config in case .cache gets nuked hee hoo
cp "$cache/colors-kitty.conf" "$config/kitty/colors-kitty.conf"
cp "$cache/colors-rofi-light.rasi" "$config/rofi/colors-rofi-light.rasi"
cp "$cache/colors-rofi-dark.rasi" "$config/rofi/colors-rofi-dark.rasi"
# update x resources
xrdb "$cache/colors.Xresources"
# set system theme with wpg
#wpg -a $file -l
#wpg -s $file -l
# reload bspwm
2022-01-17 23:22:36 +01:00
"$HOME"/.config/bspwm/bspwmrc reload