From d50aba789e279066d630b352e31c56d4e628ed9e Mon Sep 17 00:00:00 2001 From: long-910 <7323488+long-910@users.noreply.github.com> Date: Sun, 1 Mar 2026 14:57:25 +0900 Subject: [PATCH 1/3] Docs: add CHANGELOG.md Follows Keep a Changelog format. Documents all notable changes from the initial commit through the recent CI fixes, organized by version milestones. Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a62860e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,88 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). + +--- + +## [Unreleased] + +### Fixed +- ShellCheck CI: add `# shellcheck shell=bash` directive to all `dotfiles/.zshrc.d/*.zsh` files (SC2148, SC1103) +- ShellCheck CI: add `# shellcheck disable=SC1090` for non-constant `source` in `fzf.zsh` (SC1090) +- ShellCheck CI: move color variables out of `printf` format strings in `bootstrap.sh` and `uninstall.sh` (SC2059) +- ShellCheck CI: remove unnecessary `$` in array subscripts in `bootstrap.sh` (SC2004) +- ShellCheck CI: remove unused `DIM` color variable from `modules/lib.sh` (SC2034) +- ShellCheck CI: replace `# shellcheck source=` with `# shellcheck disable=SC1091` in `uninstall.sh` (SC1091) +- Linux CI: make `yazi` cargo build failure non-fatal in `modules/core.sh` +- Linux CI: pre-install `yazi` binary from GitHub releases in workflow to avoid `cargo` compile failure + +--- + +## [0.4.0] - 2026-03-01 + +### Added +- **Modular bootstrap system** (`bootstrap.sh`): interactive feature-selection menu, supports `--all`, `--module `, `--list`, `--non-interactive` flags +- **Uninstall script** (`uninstall.sh`): removes deployed configs and restores backups in one command +- **Module system** (`modules/`): + - `lib.sh` — shared helpers: color output, OS detection, `pkg_install`, `backup_file`, `deploy_config` + - `core.sh` — zsh, tmux, lsd, emacs, htop, neofetch, yazi + tmux-mem-cpu-load build + - `shell.sh` — starship, fzf, zoxide, atuin + - `dev.sh` — gh, ripgrep, direnv, bat, delta, fd, jq, lazygit + git global config + - `node.sh` — fnm + Node LTS + commitizen + - `docker.sh` — Docker CE + Docker Compose +- **`.zshrc.d/` pattern**: per-tool zsh configs with `command -v` guards + - `fzf.zsh`, `zoxide.zsh`, `starship.zsh`, `atuin.zsh`, `direnv.zsh`, `node.zsh`, `docker.zsh`, `commit.zsh` +- **Tool configs**: `config/starship.toml`, `config/atuin/config.toml` +- **Project templates**: `templates/node/`, `templates/python/` +- **Test suite** (`tests/run_tests.sh`) +- **Linux CI job**: `Install Bootstrap` and `Tests` jobs added to `linux.yml` + +--- + +## [0.3.0] - 2026-03-01 + +### Added +- **Multilingual documentation**: English (`Doc/en/`), Japanese (`Doc/ja/`), Simplified Chinese (`Doc/zh/`) — 8 files each covering tmux, zsh, tools, secrets, emacs, htop, neofetch, yazi +- **Multilingual README**: `README.md` (English default), `README.ja.md`, `README.zh.md` with language switcher links +- **Git commit template** (`dotfiles/.gitmessage`) for conventional commits +- **Secrets template** (`dotfiles/.zshrc.local.example`) + +### Changed +- CI improvements and workflow refinements + +--- + +## [0.2.1] - 2025-xx-xx + +### Added +- **yazi** file manager: install + `yy` wrapper function in `.zshrc` to `cd` to the directory yazi exits in + +--- + +## [0.2.0] - 2025-xx-xx + +### Added +- **lsd** (ls Deluxe): `ls` aliased to `lsd` in `.zshrc` +- **htop** process viewer +- **neofetch** system info tool + +--- + +## [0.1.1] - 2025-xx-xx + +### Fixed +- tmux pane border styling +- tmux `pane_current_path` for new splits + +--- + +## [0.1.0] - 2025-xx-xx + +### Added +- Initial dotfiles setup: `.zshrc`, `.tmux.conf`, `.emacs.el` +- Automated installer `install_and_configure.sh` (macOS + Ubuntu/Debian) +- tmux-mem-cpu-load integration for status bar CPU/memory display +- GitHub Actions CI: ShellCheck, Linux, macOS workflows +- MIT License From e92f7df3646abf841225d9e34a5f384b361ca623 Mon Sep 17 00:00:00 2001 From: long-910 <7323488+long-910@users.noreply.github.com> Date: Sun, 1 Mar 2026 15:53:44 +0900 Subject: [PATCH 2/3] Feat: add curl one-line installer and tmux auto-start - Add install.sh: clones repo to ~/.dotfiles and exec's bootstrap.sh, enabling `curl -fsSL URL/install.sh | bash` one-line install. Restores /dev/tty for interactive menu when piped from curl. - Add dotfiles/.zshrc.d/tmux.zsh: auto-attaches to (or creates) a tmux session named "main" on login; exiting tmux exits the shell. Guarded by $TMUX and $TERM_PROGRAM checks. - Wire tmux.zsh deployment into modules/core.sh _deploy_core_configs(). - Update README.md, README.ja.md, README.zh.md with curl one-liner and tmux auto-start documentation. Co-Authored-By: Claude Sonnet 4.6 --- README.ja.md | 31 ++++++++++++++++++++++++++++++- README.md | 31 ++++++++++++++++++++++++++++++- README.zh.md | 31 ++++++++++++++++++++++++++++++- dotfiles/.zshrc.d/tmux.zsh | 10 ++++++++++ install.sh | 26 ++++++++++++++++++++++++++ modules/core.sh | 1 + 6 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 dotfiles/.zshrc.d/tmux.zsh create mode 100644 install.sh diff --git a/README.ja.md b/README.ja.md index 982f2ef..77d9dd4 100644 --- a/README.ja.md +++ b/README.ja.md @@ -2,6 +2,7 @@ [![macOS](https://github.com/long-910/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/macos.yml) [![ShellCheck](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml) [![License](https://img.shields.io/github/license/long-910/dotfiles)](https://github.com/long-910/dotfiles/blob/main/LICENSE) +[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-pink?logo=github)](https://github.com/sponsors/long-910) [English](README.md) | [日本語](README.ja.md) | [中文](README.zh.md) @@ -14,7 +15,27 @@ macOS・Ubuntu・WSL 向け開発環境セットアップスクリプト集で ## クイックスタート -### bootstrap.sh(推奨) +### ワンライナーインストール(curl) + +1コマンドでクローンしてインタラクティブインストーラーを起動: + +```bash +curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash +``` + +すべてを非インタラクティブにインストールする場合: + +```bash +curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash -s -- --all +``` + +リポジトリは `~/.dotfiles` にクローンされます。`DOTFILES_DIR` で変更可能: + +```bash +DOTFILES_DIR=~/my-dotfiles curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash +``` + +### bootstrap.sh(git clone) インタラクティブメニューで機能ブロックを選択してインストール。 @@ -83,6 +104,14 @@ bash bootstrap.sh --list # モジュール一覧表示 | [jq](https://jqlang.github.io/jq/) | コマンドライン JSON プロセッサ | | [lazygit](https://github.com/jesseduffield/lazygit) | git のターミナル UI | +### ターミナルマルチプレクサ + +| ツール | 説明 | +|-------|------| +| [tmux](https://github.com/tmux/tmux) | ターミナルマルチプレクサ。ログイン時に自動起動し、tmux 終了でシェルも終了 | + +新しいターミナルを開くと tmux が自動的に起動し、`main` という名前のセッションにアタッチ(なければ作成)します。tmux を終了するとシェルも終了します。無効にするには `~/.zshrc.d/tmux.zsh` を削除してください。 + ### ファイル管理 | ツール | 説明 | diff --git a/README.md b/README.md index 9be7937..6dcb2cf 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![macOS](https://github.com/long-910/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/macos.yml) [![ShellCheck](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml) [![License](https://img.shields.io/github/license/long-910/dotfiles)](https://github.com/long-910/dotfiles/blob/main/LICENSE) +[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-pink?logo=github)](https://github.com/sponsors/long-910) [English](README.md) | [日本語](README.ja.md) | [中文](README.zh.md) @@ -14,7 +15,27 @@ Select and install only the feature blocks you need via an interactive menu. ## Quick Start -### bootstrap.sh (Recommended) +### One-line install (curl) + +Clone and run the interactive installer in one command: + +```bash +curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash +``` + +To install everything non-interactively: + +```bash +curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash -s -- --all +``` + +The repository is cloned to `~/.dotfiles`. Set `DOTFILES_DIR` to override the location: + +```bash +DOTFILES_DIR=~/my-dotfiles curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash +``` + +### bootstrap.sh (git clone) Select feature blocks from an interactive menu. @@ -83,6 +104,14 @@ bash bootstrap.sh --list # List modules | [jq](https://jqlang.github.io/jq/) | Command-line JSON processor | | [lazygit](https://github.com/jesseduffield/lazygit) | Terminal UI for git | +### Terminal Multiplexer + +| Tool | Description | +|------|-------------| +| [tmux](https://github.com/tmux/tmux) | Terminal multiplexer. Auto-starts on login; exit tmux to close the shell | + +tmux starts automatically when you open a new terminal and attaches to (or creates) a session named `main`. Closing tmux also exits the shell. To disable, remove `~/.zshrc.d/tmux.zsh`. + ### File Management | Tool | Description | diff --git a/README.zh.md b/README.zh.md index 967cf18..20e5905 100644 --- a/README.zh.md +++ b/README.zh.md @@ -2,6 +2,7 @@ [![macOS](https://github.com/long-910/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/macos.yml) [![ShellCheck](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml) [![License](https://img.shields.io/github/license/long-910/dotfiles)](https://github.com/long-910/dotfiles/blob/main/LICENSE) +[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-pink?logo=github)](https://github.com/sponsors/long-910) [English](README.md) | [日本語](README.ja.md) | [中文](README.zh.md) @@ -14,7 +15,27 @@ ## 快速开始 -### bootstrap.sh(推荐) +### 一键安装(curl) + +用一条命令克隆并启动交互式安装程序: + +```bash +curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash +``` + +非交互式安装所有模块: + +```bash +curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash -s -- --all +``` + +仓库将克隆到 `~/.dotfiles`,可通过 `DOTFILES_DIR` 自定义路径: + +```bash +DOTFILES_DIR=~/my-dotfiles curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash +``` + +### bootstrap.sh(git clone) 通过交互式菜单选择功能模块进行安装。 @@ -82,6 +103,14 @@ bash bootstrap.sh --list # 列出所有模块 | [jq](https://jqlang.github.io/jq/) | 命令行 JSON 处理器 | | [lazygit](https://github.com/jesseduffield/lazygit) | git 的终端 UI | +### 终端复用器 + +| 工具 | 说明 | +|------|------| +| [tmux](https://github.com/tmux/tmux) | 终端复用器。登录时自动启动;退出 tmux 同时退出 Shell | + +打开新终端时 tmux 会自动启动,并附加到名为 `main` 的会话(不存在则创建)。关闭 tmux 时 Shell 也会一并退出。如需禁用,请删除 `~/.zshrc.d/tmux.zsh`。 + ### 文件管理 | 工具 | 说明 | diff --git a/dotfiles/.zshrc.d/tmux.zsh b/dotfiles/.zshrc.d/tmux.zsh new file mode 100644 index 0000000..3ab5753 --- /dev/null +++ b/dotfiles/.zshrc.d/tmux.zsh @@ -0,0 +1,10 @@ +# shellcheck shell=bash +# Auto-start tmux when opening a new terminal. +# - Attaches to existing session "main" or creates a new one. +# - When tmux exits, the shell (and terminal window) also exits. +# Skip if: already inside tmux, tmux not installed, or VSCode terminal. +if command -v tmux >/dev/null 2>&1 \ + && [ -z "${TMUX:-}" ] \ + && [ "${TERM_PROGRAM:-}" != "vscode" ]; then + exec tmux new-session -A -s main +fi diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..4e048fa --- /dev/null +++ b/install.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# install.sh — One-line installer for long-910/dotfiles +# Usage: curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash +# curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash -s -- --all +set -euo pipefail + +DOTFILES_DIR="${DOTFILES_DIR:-$HOME/.dotfiles}" +REPO="https://github.com/long-910/dotfiles.git" + +echo "=> Installing long-910/dotfiles into ${DOTFILES_DIR}" + +if [ -d "${DOTFILES_DIR}/.git" ]; then + echo "=> Repository already exists — pulling latest changes" + git -C "${DOTFILES_DIR}" pull --ff-only +else + echo "=> Cloning repository" + git clone --depth=1 "${REPO}" "${DOTFILES_DIR}" +fi + +# When piped from curl, stdin is the pipe (not a TTY). +# Redirect from /dev/tty so the interactive menu can read keyboard input. +if [ ! -t 0 ] && [ -c /dev/tty ]; then + exec bash "${DOTFILES_DIR}/bootstrap.sh" "$@" Date: Sun, 1 Mar 2026 16:03:50 +0900 Subject: [PATCH 3/3] Fix: attach to any existing tmux session instead of always using "main" Previously used `new-session -A -s main` which would create a new "main" session even when other sessions already existed. Now checks for any existing session first and attaches to the most recent one; only creates a new session if none exist. Co-Authored-By: Claude Sonnet 4.6 --- dotfiles/.zshrc.d/tmux.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dotfiles/.zshrc.d/tmux.zsh b/dotfiles/.zshrc.d/tmux.zsh index 3ab5753..e06538d 100644 --- a/dotfiles/.zshrc.d/tmux.zsh +++ b/dotfiles/.zshrc.d/tmux.zsh @@ -1,10 +1,15 @@ # shellcheck shell=bash # Auto-start tmux when opening a new terminal. -# - Attaches to existing session "main" or creates a new one. +# - If any session exists, attach to the most recent one. +# - Otherwise, create a new session. # - When tmux exits, the shell (and terminal window) also exits. # Skip if: already inside tmux, tmux not installed, or VSCode terminal. if command -v tmux >/dev/null 2>&1 \ && [ -z "${TMUX:-}" ] \ && [ "${TERM_PROGRAM:-}" != "vscode" ]; then - exec tmux new-session -A -s main + if tmux list-sessions >/dev/null 2>&1; then + exec tmux attach-session + else + exec tmux new-session + fi fi