diff --git a/config/exports b/config/exports index 2f4f967..11a65e0 100755 --- a/config/exports +++ b/config/exports @@ -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