diff --git a/install-rmux.ps1 b/install-rmux.ps1 index ae8ab49..18007fd 100644 --- a/install-rmux.ps1 +++ b/install-rmux.ps1 @@ -68,6 +68,93 @@ function Main { } } + # 2) Deploy .rmux.conf + $confFile = Join-Path $env:USERPROFILE '.rmux.conf' + if (Test-Path $confFile) { + Write-Warn "Existing .rmux.conf found at $confFile" + $backup = "${confFile}.bak.$(Get-Date -Format 'yyyyMMddHHmmss')" + Copy-Item -Path $confFile -Destination $backup -Force + Write-Info "Backup saved to $backup" + } + + Write-Info "Deploying .rmux.conf..." + $confContent = @' +# .rmux.conf 샘플 + +# Prefix key 변경 (기본은 Ctrl-b) +set -g prefix C-a +unbind C-b +bind C-a send-prefix + +# 창 분할 단축키 변경 +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +unbind '"' +unbind % + +# 창 이동 단축키 (vim 스타일) +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# 창 전환 단축키 +bind -r C-h previous-window +bind -r C-l next-window + +# 창 재정렬 +bind Space next-layout + +# 창 회전 +bind o rotate-window + +# 창 이름 변경 +bind , command-prompt "rename-window %%" + +# 창 닫기 +bind & kill-window + +# 세션 재시작 +bind r source-file ~/.rmux.conf \; display "Reloaded!" + +# 상태 표시줄 설정 +set -g status-bg colour235 +set -g status-fg colour136 +set -g status-left-length 40 +set -g status-right-length 40 +set -g status-interval 5 +set -g history-limit 10000 + +# 상태 표시줄 왼쪽 내용 +set -g status-left '#[fg=green]#S #[fg=yellow]#H' + +# 상태 표시줄 오른쪽 내용 +set -g status-right '#[fg=cyan]%Y-%m-%d #[fg=green]%H:%M:%S' + +# 패널 테두리 색상 +set-option -g pane-border-style 'fg=colour244' +set-option -g pane-active-border-style 'fg=colour77' + +# 복사 모드에서 vi 키 바인딩 사용 +setw -g mode-keys vi + +# 마우스 지원 활성화 +set -g mouse on + +# 256색 지원 +set -g default-terminal "screen-256color" + +# for pi +set -g extended-keys on +'@ + + try { + $confContent | Out-File -FilePath $confFile -Encoding utf8 -Force + Write-Success ".rmux.conf deployed successfully." + } catch { + Write-Warn "Failed to deploy .rmux.conf: $_" + } + # 최종 가용성 검증 $rmuxCmd = Get-Command rmux -ErrorAction SilentlyContinue if ($rmuxCmd) { diff --git a/install-rmux.sh b/install-rmux.sh index 058559e..a75ec63 100644 --- a/install-rmux.sh +++ b/install-rmux.sh @@ -43,6 +43,87 @@ main() { fi fi + # 2) Deploy .rmux.conf + local conf_file="${HOME}/.rmux.conf" + if [ -f "$conf_file" ]; then + warn "Existing .rmux.conf found at $conf_file" + local backup="${conf_file}.bak.$(date +%Y%m%d%H%M%S)" + cp "$conf_file" "$backup" + info "Backup saved to $backup" + fi + + info "Deploying .rmux.conf..." + cat >"$conf_file" <<'RMUXCONF' +# .rmux.conf 샘플 + +# Prefix key 변경 (기본은 Ctrl-b) +set -g prefix C-a +unbind C-b +bind C-a send-prefix + +# 창 분할 단축키 변경 +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +unbind '"' +unbind % + +# 창 이동 단축키 (vim 스타일) +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# 창 전환 단축키 +bind -r C-h previous-window +bind -r C-l next-window + +# 창 재정렬 +bind Space next-layout + +# 창 회전 +bind o rotate-window + +# 창 이름 변경 +bind , command-prompt "rename-window %%" + +# 창 닫기 +bind & kill-window + +# 세션 재시작 +bind r source-file ~/.rmux.conf \; display "Reloaded!" + +# 상태 표시줄 설정 +set -g status-bg colour235 +set -g status-fg colour136 +set -g status-left-length 40 +set -g status-right-length 40 +set -g status-interval 5 +set -g history-limit 10000 + +# 상태 표시줄 왼쪽 내용 +set -g status-left '#[fg=green]#S #[fg=yellow]#H' + +# 상태 표시줄 오른쪽 내용 +set -g status-right '#[fg=cyan]%Y-%m-%d #[fg=green]%H:%M:%S' + +# 패널 테두리 색상 +set-option -g pane-border-style 'fg=colour244' +set-option -g pane-active-border-style 'fg=colour77' + +# 복사 모드에서 vi 키 바인딩 사용 +setw -g mode-keys vi + +# 마우스 지원 활성화 +set -g mouse on + +# 256색 지원 +set -g default-terminal "screen-256color" + +# for pi +set -g extended-keys on +RMUXCONF + success ".rmux.conf deployed successfully." + # 설치 완료 검증 if command -v rmux &>/dev/null; then success "rmux를 사용할 수 있습니다: $(command -v rmux)"