From 50abd5aa30f806c0547536c422bc90f9f89549d4 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Sun, 23 Jun 2024 01:23:37 +0300 Subject: [PATCH] feat(alacritty): update theme automagically --- config/exports | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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