Skip to content

Commit adc0c41

Browse files
committed
chore: Update ssh-backup script to exclude hostname in destination folder
1 parent 030941d commit adc0c41

File tree

7 files changed

+67
-41
lines changed

7 files changed

+67
-41
lines changed

.hammerspoon/init.lua

+28-28
Original file line numberDiff line numberDiff line change
@@ -54,34 +54,34 @@ end
5454

5555
-----------------------------------------------------------------------------
5656
--04. 한글 입력 전환하기 ->{'shift'}, 'space', changeInput
57-
do -- input sorce changer
58-
local inputSource = {
59-
english = "com.apple.keylayout.ABC",
60-
korean = "com.apple.inputmethod.Korean.2SetKorean",
61-
}
62-
63-
local changeInput = function()
64-
65-
local current = hs.keycodes.currentSourceID()
66-
local nextInput = nil
67-
68-
if current == inputSource.english then
69-
nextInput = inputSource.korean
70-
else
71-
nextInput = inputSource.english
72-
end
73-
hs.keycodes.currentSourceID(nextInput)
74-
75-
if nextInput == inputSource.english then
76-
hs.alert.show("English")
77-
else
78-
hs.alert.show("한글")
79-
end
80-
end
81-
82-
-- hs.hotkey.bind({'shift'}, 'space', changeInput)
83-
hs.hotkey.bind({}, 'F16', changeInput)
84-
end
57+
-- do -- input sorce changer
58+
-- local inputSource = {
59+
-- english = "com.apple.keylayout.ABC",
60+
-- korean = "com.apple.inputmethod.Korean.2SetKorean",
61+
-- }
62+
63+
-- local changeInput = function()
64+
65+
-- local current = hs.keycodes.currentSourceID()
66+
-- local nextInput = nil
67+
68+
-- if current == inputSource.english then
69+
-- nextInput = inputSource.korean
70+
-- else
71+
-- nextInput = inputSource.english
72+
-- end
73+
-- hs.keycodes.currentSourceID(nextInput)
74+
75+
-- if nextInput == inputSource.english then
76+
-- hs.alert.show("English")
77+
-- else
78+
-- hs.alert.show("한글")
79+
-- end
80+
-- end
81+
82+
-- -- hs.hotkey.bind({'shift'}, 'space', changeInput)
83+
-- hs.hotkey.bind({}, 'F16', changeInput)
84+
-- end
8585

8686

8787
-- f13 key를 escape로 매핑

.zshrc

+5-4
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ export PATH=~/.ssh:~/dotfiles:$PATH
141141
# java
142142
alias java_home=/usr/libexec/java_home
143143
#"JAVA Version: jenv versions -> jenv global 18"
144-
#export JAVA_HOME=$(java_home -v17)
145-
# alias setJava8='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'
146-
# alias setJava17='export JAVA_HOME=$(/usr/libexec/java_home -v 18)'
147-
# export PATH="$JAVA_HOME:$PATH"
144+
#export JAVA_HOME=$(java_home -v 1.8)
145+
#alias setJava8='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'
146+
#alias setJava17='export JAVA_HOME=$(/usr/libexec/java_home -v 18)'
147+
#export PATH="$PATH:$JAVA_HOME"
148148

149149
# stty - ^M
150150
#stty icrnl
@@ -193,3 +193,4 @@ alias more='more -R'
193193
alias ccat='highlight -O ansi --force'
194194
alias lcat=lolcat
195195

196+
eval "$(gh copilot alias -- zsh)"

ssh-backup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ echo -e "[.ssh backup complete.]\n"
2727
echo "실패시, gpg --edit-key <KEY_ID> -> gpg> trust -> 5"
2828

2929
# icloud Documents 동기화폴더에도 복사해 주자.
30-
rsync -avh $DOTFILES ~/Documents/ --exclude .git --exclude log/ --delete
30+
rsync -avh $DOTFILES ~/Documents/$(hostname) --exclude .git --exclude log/ --delete
3131
echo -e "[rsync to icloud documents backup Complete!]\n"
3232

3333
echo "$(date "+%Y-%m-%d %H:%M") Backup to https://github.com/ic4r/dotfiles Complete!"

ssh-restore.sh

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ echo -e "\n👏👏👏 macos configuration restore complete!!"
4242
#------------------------------------------------------------------------------
4343
# 복구 작업 완료 - backup.sh crontab에 등록 및 쓰잘데기 없는 알람기능
4444
#------------------------------------------------------------------------------
45-
# 작업완료를 알리는 고양이 - crontab 등록시 터미널경고가 발생하므로 사용자 액션을 넣어봄
46-
nyancat
4745

4846
# 일기예보 CLI API (윈도우사이즈:125에 최적화) - pc 환경설정을 끝냈으면 날씨 확인하고 밖에 나가자.
4947
curl https://wttr.in/seoul -H "Accept-Language: ko-KR"

macos-init.sh z0-macos-init.sh

+28-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
#------------------------------------------------------------------------------
44
# New m1 macos first install
5+
# 사용자의 동의를 받아 진행 여부 결정
6+
# 필수 환경 변수 설정
7+
# 주요 설정 파일들을 백업하고 업데이트
8+
# Xcode Command Line Tools 설치
9+
# Homebrew 설치 및 설정
10+
# Apple Silicon M1 기반 Mac에서 Rosetta 2 설치
11+
# Git 및 관련 도구 설치, Git 설정
12+
# Java 환경 설정 및 jenv를 통한 Java 버전 관리
13+
# Brewfile을 이용한 소프트웨어 일괄 설치
14+
# iTerm2 및 Zsh 환경 설정, Oh My Zsh 및 테마, 플러그인 설치
15+
# Neovim 설치 및 설정
516
#------------------------------------------------------------------------------
617
read -p "신규 macos 개발환경을 빠르게 구성할 수 있지만, 쓸데없는 기능까지 설치될 수 있습니다. 진행할까요? (y/n) " -n 1;
718
echo "";
@@ -28,6 +39,22 @@ cp -f $DOTFILES/.zshrc-init ~/.zshrc
2839
# Command Line Tool 설치 (기본명령어 설치 /Library/Developer/CommandLineTools/usr/bin)
2940
xcode-select --install
3041

42+
# $?는 마지막 실행된 명령어의 종료 상태를 나타냅니다.
43+
# 0이면 성공, 0이 아니면 에러. 특정 에러 코드(예: 130)는 이미 설치되어 있거나 설치 중임을 나타낼 수 있습니다.
44+
if [ $? -ne 0 ]; then
45+
# xcode-select의 상태를 확인합니다.
46+
xcode_select_status=$(xcode-select -p &> /dev/null; echo $?)
47+
48+
# xcode-select -p의 종료 상태가 0이면, Command Line Tools가 이미 설치되어 있음을 의미합니다.
49+
if [ $xcode_select_status -eq 0 ]; then
50+
echo "Command Line Tools가 이미 설치되어 있습니다. 계속 진행합니다."
51+
else
52+
echo "Command Line Tool 설치에 실패했습니다. 스크립트를 종료합니다."
53+
echo "설치 후 다시 실행해주세요. => xcode-select --install"
54+
exit 1
55+
fi
56+
fi
57+
3158
# Homebrew 설치가 안되어 있으면 설치
3259
if ! [[ -x "$(command -v brew)" ]]; then
3360
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@@ -70,7 +97,7 @@ echo "git config --global user.email [EMAIL]"
7097
#brew install zulu8 --cask
7198
brew install zulu17 --cask
7299

73-
brew install openjdk # openjdk 18. latest
100+
# brew install openjdk # openjdk 18. latest
74101
# brew install openjdk@17
75102

76103
# jenv add $(/usr/libexec/java_home -v1.8)

backup.sh z1-backup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ echo "source ~/dotfiles/function_bitwarden.sh && push_folder ~/.ssh"
7474
echo -e "[.ssh backup PASSED!]\n"
7575

7676
# icloud Documents 동기화폴더에도 복사해 주자.
77-
rsync -avh $DOTFILES ~/Documents/ --exclude .git --exclude log/ --delete
77+
rsync -avh $DOTFILES ~/Documents/$(hostname) --exclude .git --exclude log/ --delete
7878
echo -e "[rsync to icloud documents backup Complete!]\n"
7979

8080
echo "$(date "+%Y-%m-%d %H:%M") Backup to https://github.com/ic4r/dotfiles Complete!"

restore.sh z2-restore.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ git config --global core.quotepath false
9191
#brew install zulu8 --cask
9292
brew install zulu17 --cask
9393

94-
brew install openjdk # openjdk 18. latest
94+
# brew install openjdk # openjdk 18. latest
9595
# brew install openjdk@17
9696

9797
# jenv add $(/usr/libexec/java_home -v1.8)
@@ -265,7 +265,7 @@ echo -e "\n👏👏👏 macos configuration restore complete!!"
265265
# 복구 작업 완료 - backup.sh crontab에 등록 및 쓰잘데기 없는 알람기능
266266
#------------------------------------------------------------------------------
267267
# 작업완료를 알리는 고양이 - crontab 등록시 터미널경고가 발생하므로 사용자 액션을 넣어봄
268-
nyancat
268+
#nyancat
269269

270270
function makecron() {
271271
# crontab에 백업 스크립트 및 로그 제거 스크립트 등록
@@ -292,5 +292,5 @@ function makecron() {
292292
curl https://wttr.in/seoul -H "Accept-Language: ko-KR"
293293

294294
# makecron
295-
echo -e "\n👻 crontab list:"
296-
crontab -l
295+
# echo -e "\n👻 crontab list:"
296+
# crontab -l

0 commit comments

Comments
 (0)