#!/bin/sh recompile(){ cd "$HOME"/.local/src/"$1"; touch config.h bwroot make clean install >/dev/null 2>&1 } set_palette(){ riverctl background-color "0x$background" riverctl border-color-focused "0x$color1" riverctl border-color-unfocused "0x$color2" sed -i "s|^image=\".*\"|image=\"$wallpaper\"|" $HOME/.config/swaylock/config makoctl reload kill $(pidof wbg) || echo "Executing wbg" && wbg $wallpaper >/dev/null 2>&1 & notify-send " Enjoy your color palette!" } if [ -f "$1" ]; then bwroot wal -i "$1" --cols16 else echo "ERROR: Invalid file"; exit 1 fi source $HOME/.cache/wal/colors-wal-river for i in "dam" "mew"; do recompile "$i"; echo "Applying colorscheme to $i" if [ "$i" == "dam" ]; then kill "$(pidof dam)" || echo "Executing bar" && slstatus | dam & fi done set_palette