From 2a47308c448dd128c57fc700cf6f9957457e8ac0 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 25 Aug 2012 14:25:35 +0900 Subject: [PATCH 1/6] rename setup.sh func --- setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 2d5c5b5..999222f 100755 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,7 @@ mkdir -p ~/.my/log mkdir -p ~/.local/bin -_my_install_script(){ +install_script(){ local dir="$HOME/.local/bin" mkdir -p "$dir" for f in "$@" @@ -23,7 +23,7 @@ _my_install_script(){ done } -_my_install_symlink_script(){ +install_symlink_script(){ mkdir -p "$HOME/.local/bin/" for f in "$@" do @@ -31,7 +31,7 @@ _my_install_symlink_script(){ done } -_my_git_config(){ +git_config(){ git config --global user.name '10sr' git config --global user.email '8slashes+git@gmail.com' git config --global core.autocrlf false @@ -53,17 +53,17 @@ _my_git_config(){ # git config --global alias.my-ls "ls-files | xargs ls" # git config --global alias.ll "!git ls-files | xargs ls -l -CFG --color=auto --time-style=long-iso" git config --global alias.addi "add -i" - if false; then + if false iswindows; then git config --global core.fileMode false fi } -_gen_source_script(){ +gen_source_script(){ # _gen_source_script file lines test $# -eq 2 || return 1 head -n $2 $1 | \grep -v '^#!' | sed -e 's/^..//g' } -_my_install_script http://www.frexx.de/xterm-256-notes/data/colortable16.sh http://www.frexx.de/xterm-256-notes/data/256colors2.pl +install_script http://www.frexx.de/xterm-256-notes/data/colortable16.sh http://www.frexx.de/xterm-256-notes/data/256colors2.pl type git >/dev/null 2>&1 && _my_git_config From aae65b2895803f76adb0e4284dddd76230ee3f4c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 27 Aug 2012 21:33:38 +0900 Subject: [PATCH 2/6] fix upgrade alias --- bashrc | 7 ++++--- setup.sh | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index e0cb043..cc09812 100755 --- a/bashrc +++ b/bashrc @@ -176,9 +176,10 @@ null type pacmatic && { export PACMAN="pacmatic" } -alias ubuntu-upgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" -alias arch-upgrade="sudo pacman -Syu" -alias port-upgrade="sudo port selfupdate && sudo port upgrade outdated && sudo port uninstall leaves" +null type apt-get && \ + alias aupgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" +null type port && \ + alias pupgrade="sudo port selfupdate && sudo port upgrade outdated && sudo port uninstall leaves" if iscygwin; then null type windate || alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" diff --git a/setup.sh b/setup.sh index 999222f..afe2b88 100755 --- a/setup.sh +++ b/setup.sh @@ -58,6 +58,20 @@ git_config(){ fi } +mac_defaults(){ + # add quit entry in menu + defaults write com.apple.finder QuitMenuItem -bool YES + # show full path on titlebar + defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES + # do not show desktop icons + defaults write com.apple.finder CreateDesktop -boolean false + + killall finder + + # disable dashboard + #defaults write com.apple.dashboard mcx-disabled -bool YES +} + gen_source_script(){ # _gen_source_script file lines test $# -eq 2 || return 1 From b70bc05d1073a381003ba7afb4e33c1f725bb815 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 28 Aug 2012 18:01:40 +0900 Subject: [PATCH 3/6] update setup.sh --- setup.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index afe2b88..d791dee 100755 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,13 @@ mkdir -p ~/.my/log mkdir -p ~/.local/bin -install_script(){ +gen_source_script(){ + # _gen_source_script file lines + test $# -eq 2 || return 1 + head -n $2 $1 | \grep -v '^#!' | sed -e 's/^..//g' +} + +get_install_script(){ local dir="$HOME/.local/bin" mkdir -p "$dir" for f in "$@" @@ -32,6 +38,8 @@ install_symlink_script(){ } git_config(){ + type git >/dev/null 2>&1 || return 1 + git config --global user.name '10sr' git config --global user.email '8slashes+git@gmail.com' git config --global core.autocrlf false @@ -59,6 +67,8 @@ git_config(){ } mac_defaults(){ + test "`uname`" = Darwin || return 1 + # add quit entry in menu defaults write com.apple.finder QuitMenuItem -bool YES # show full path on titlebar @@ -72,12 +82,8 @@ mac_defaults(){ #defaults write com.apple.dashboard mcx-disabled -bool YES } -gen_source_script(){ - # _gen_source_script file lines - test $# -eq 2 || return 1 - head -n $2 $1 | \grep -v '^#!' | sed -e 's/^..//g' -} +get_install_script http://www.frexx.de/xterm-256-notes/data/colortable16.sh http://www.frexx.de/xterm-256-notes/data/256colors2.pl -install_script http://www.frexx.de/xterm-256-notes/data/colortable16.sh http://www.frexx.de/xterm-256-notes/data/256colors2.pl +git_config -type git >/dev/null 2>&1 && _my_git_config +mac_defaults From 73c339f77cfa9df249cb16f21b7ffad5ea8d8ec9 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 28 Aug 2012 23:02:58 +0900 Subject: [PATCH 4/6] touch file when open_file in darwin --- bashrc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bashrc b/bashrc index cc09812..6a7bbdd 100755 --- a/bashrc +++ b/bashrc @@ -217,12 +217,6 @@ tmux(){ fi } -__my_moc_state(){ - type mocp >/dev/null 2>&1 || return - test "`mocp -Q %state 2>/dev/null`" == PLAY || return - printf "$1" "`mocp -Q %title 2>/dev/null`" -} - mcrypt-stream(){ test $# -eq 2 || return 1 case $1 in @@ -347,6 +341,7 @@ open_file(){ cmd.exe //c start "" "$@" elif isdarwin then + touch "$@" open "$@" elif islinux then @@ -380,6 +375,12 @@ convmv-sjis2utf8-notest(){ convmv -r -f sjis -t utf8 * --notest } +__my_moc_state(){ + type mocp >/dev/null 2>&1 || return + test "`mocp -Q %state 2>/dev/null`" == PLAY || return + printf "$1" "`mocp -Q %title 2>/dev/null`" +} + __my_parse_svn_branch() { local LANG=C local svn_url=$(svn info 2>/dev/null | sed -ne 's#^URL: ##p') From bf188bc1892121dfb33f1fc2e41453cce2ed2beb Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 28 Aug 2012 23:38:35 +0900 Subject: [PATCH 5/6] fix diff-mode face --- emacs.el | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index 9b49dfb..e0f68b9 100644 --- a/emacs.el +++ b/emacs.el @@ -634,10 +634,21 @@ drill-instructor.el" (add-hook 'diff-mode-hook (lambda () (view-mode 1) - (set-face-foreground 'diff-file-header-face nil) - (set-face-foreground 'diff-header-face nil) + (let ((s 'diff-header)) + (set-face-foreground s nil) + (set-face-background s nil) + (set-face-bold-p s t)) + (let ((s 'diff-file-header)) + (set-face-foreground s nil) + (set-face-background s nil) + (set-face-bold-p s t)) (set-face-foreground 'diff-index-face "blue") - (set-face-foreground 'diff-hunk-header-face "cyan") + (let ((s 'diff-hunk-header)) + (set-face-foreground s "cyan") + (set-face-bold-p s nil)) + (let ((s 'diff-context)) + ;; (set-face-foreground s "white") + (set-face-bold-p s t)) (set-face-foreground 'diff-context-face nil) (set-face-foreground 'diff-removed-face "red") (set-face-foreground 'diff-added-face "green") From 2e62c4880751de3ab74937477ac3d7ee6227cd55 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 28 Aug 2012 23:50:15 +0900 Subject: [PATCH 6/6] fix --- xprograms | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xprograms b/xprograms index 129723d..4b8d985 100755 --- a/xprograms +++ b/xprograms @@ -1,6 +1,6 @@ #!/bin/sh # Programs run in background when starting x. -# Japanese IM settings are not included in this list. +# Japanese IM settings are not included in this script. _feh(){ test -f "$HOME/.fehbg" && @@ -64,4 +64,3 @@ for p in $@ do _$p done -