#!/bin/sh # Dependency check which swaybg wal identify > /dev/null || exit 1 wall="$HOME/pics/wallpaper" walls="$HOME/pics/wallpapers" walcache="$HOME/.cache/wal" res="1920x1080" # if no (valid) argument, use find any image with $res resolution # and take a random one test -f "${wal:=$(realpath "$1")}" || wal="$(find "$walls" -type f | xargs identify | grep "$res" | awk '{print $1}' | shuf -n 1)" ln -sf "$wal" "$wall" pkill swaybg # There should be only one swaybg -i "$wall" & wal -c wal -i "$wall" # foot . "$walcache/colors.sh" rm -f "$HOME/.config/foot/colors" cat < "$HOME/.config/foot/colors" [colors] foreground = $foreground background = $background regular0 = $color0 regular1 = $color1 regular2 = $color2 regular3 = $color3 regular4 = $color4 regular5 = $color5 regular6 = $color6 regular7 = $color7 bright0 = $color8 bright1 = $color9 bright2 = $color10 bright3 = $color11 bright4 = $color12 bright5 = $color13 bright6 = $color14 bright7 = $color15 EOF cat < $HOME/.config/tofi/themes/colors # tofi text-color = $foreground prompt-color = $color4 placeholder-color = $color12 input-color = $foreground default-result-color = $color6 selection-color = $color8 selection-match-color = $color7 background-color = ${background}f0 outline-color = $color4 border-color = $color6 EOF # waybar ln -sf "$walcache/colors-waybar.css" "$HOME/.config/waybar/colors.css" pkill -USR2 waybar pywalfox update