feat(alacritty): update theme automagically

This commit is contained in:
2024-06-23 01:23:37 +03:00
parent 082e27fb0a
commit 50abd5aa30

View File

@@ -34,6 +34,18 @@ have()
bkt -- which "$1" >&/dev/null
}
# function to run dark-notify and change alacritty theme
# it uses flock to prevent running multiple instances
# install flock with `brew install flock` on macOS
function darknotify-alacritty {
have flock && [[ -f /tmp/dark-notify-alacritty.lock ]] && return
have dark-notify && {
# true is used to prevent the command show it was backgrounded
true & flock /tmp/dark-notify-alacritty.lock dark-notify -c "$HOME/.dotfiles/local/bin/x-change-alacritty-theme" &
}
}
darknotify-alacritty
brew_installed()
{
bkt -- brew list