From e8be48e5e9d86877cdcdca6cb90c3b8945529c0d Mon Sep 17 00:00:00 2001 From: Riley Martine Date: Fri, 8 Dec 2023 13:26:39 -0700 Subject: [PATCH] Only add macOS .plist file if contents have changed Saving this file triggers a notification saying that a background item was added. This happens on startup, every time. It is annoying. Fixes: https://github.com/tmux-plugins/tmux-continuum/issues/118 --- scripts/handle_tmux_automatic_start/osx_enable.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/handle_tmux_automatic_start/osx_enable.sh b/scripts/handle_tmux_automatic_start/osx_enable.sh index 38e6537..a7fea78 100755 --- a/scripts/handle_tmux_automatic_start/osx_enable.sh +++ b/scripts/handle_tmux_automatic_start/osx_enable.sh @@ -65,6 +65,8 @@ main() { local tmux_start_script_path="${CURRENT_DIR}/osx_${strategy}_start_tmux.sh" local launchd_plist_file_content="$(template "$tmux_start_script_path" "$fullscreen_option_value")" - echo "$launchd_plist_file_content" > "$osx_auto_start_file_path" + if ! diff "$osx_auto_start_file_path" <(echo "$launchd_plist_file_content") &>/dev/null ; then + echo "$launchd_plist_file_content" > "$osx_auto_start_file_path" + fi } main