diff --git a/scripts/project-launcher.sh b/scripts/project-launcher.sh index a4e7dd2..77c67bb 100755 --- a/scripts/project-launcher.sh +++ b/scripts/project-launcher.sh @@ -97,6 +97,16 @@ create_directory "$PAPER_PATH" "paper" [ -n "$CONTENT_PATH" ] && [ "$CONTENT_PATH" != "null" ] && [ -d "$CONTENT_PATH" ] && zoxide add "$CONTENT_PATH" 2>/dev/null || true [ -n "$PAPER_PATH" ] && [ "$PAPER_PATH" != "null" ] && [ -d "$PAPER_PATH" ] && zoxide add "$PAPER_PATH" 2>/dev/null || true +# Check if session already exists and attach if it does +if is_session_running "$SESSION_NAME"; then + printf "\033[1;32mAttaching to existing session: %s\033[0m\n" "$SESSION_NAME" + tmux attach-session -t "$SESSION_NAME" + exit 0 +fi + +# Update papis cache +papis cache reset > /dev/null 2>&1 + # Create remote directory if server connection is configured if [ -n "$SERVER" ] && [ -n "$REMOTE_DIR" ]; then printf "\033[2mEnsuring remote directory exists: %s:%s\033[0m\n" "$SERVER" "$REMOTE_DIR" @@ -108,16 +118,6 @@ if [ -n "$SERVER" ] && [ -n "$REMOTE_DIR" ]; then fi fi -# Check if session already exists and attach if it does -if is_session_running "$SESSION_NAME"; then - printf "\033[1;32mAttaching to existing session: %s\033[0m\n" "$SESSION_NAME" - tmux attach-session -t "$SESSION_NAME" - exit 0 -fi - -# Update papis cache -papis cache reset > /dev/null 2>&1 - # Launch appropriate template case "$TEMPLATE" in "basic") diff --git a/system/macos-defaults.nix b/system/macos-defaults.nix index 92d8304..49032b1 100644 --- a/system/macos-defaults.nix +++ b/system/macos-defaults.nix @@ -1,12 +1,16 @@ { config, pkgs, ... }: { - system.defaults.NSGlobalDomain = { - # Menu bar spacing configuration - # NSStatusItemSpacing controls horizontal spacing between menu bar items - # NSStatusItemSelectionPadding controls padding inside selection overlay - # Optimal ratio is 1:2 (spacing:padding) - NSStatusItemSpacing = 6; - NSStatusItemSelectionPadding = 12; - }; -} \ No newline at end of file + # Set primary user for system preferences + system.primaryUser = "yanlin"; + + # Menu bar spacing configuration using activation scripts + # Uses -currentHost to write host-specific preferences + # NSStatusItemSpacing controls horizontal spacing between menu bar items + # NSStatusItemSelectionPadding controls padding inside selection overlay + system.activationScripts.postUserActivation.text = '' + echo "Setting menu bar spacing preferences..." + defaults -currentHost write -globalDomain NSStatusItemSpacing -int 12 + defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 6 + ''; +}