diff --git a/dotfiles/emacs.d b/dotfiles/emacs.d index c46c2aa8..a7d48a26 160000 --- a/dotfiles/emacs.d +++ b/dotfiles/emacs.d @@ -1 +1 @@ -Subproject commit c46c2aa8f5606ee6941ab4842b1ab56492666cfd +Subproject commit a7d48a261318561bf2df61f1a90d8998246d0e60 diff --git a/dotfiles/lib/shellrc/brew.sh b/dotfiles/lib/shellrc/brew.sh deleted file mode 100755 index 0a383970..00000000 --- a/dotfiles/lib/shellrc/brew.sh +++ /dev/null @@ -1,138 +0,0 @@ -function get_brew() { - hash make &>/dev/null - if [ $? -ne 0 ] - then - echo "Make not found. Please install xcode developer tools." - return -1 - fi - hash brew &>/dev/null && echo "Homebrew found!" || ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" - brew update -} - -function brew_install_items() { - for package_install_string in $@; - do - package_args=$package_install_string - if is_zsh; - then - # Horrible hack to induce word splitting. - eval "package_args=($package_install_string)" - fi - brew install $package_args; - done -} - -# htop wont display all process information if the owner is not root -function fix_brew_htop() { - sudo chmod 777 $(readlink -f `which htop`) - sudo chown root $(readlink -f `which htop`) - sudo chmod 6555 `which htop` -} - -function do_the_brew() { - ESSENTIAL=( - "emacs" \ - "tmux" \ - "python --with-brewed-openssl" \ - "htop" \ - "greadlink" \ - "zsh" \ - "make" \ - "macvim --override-system-vim --custom-system-icons --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-perlinterp --enable-cscope" \ - ) - # `find`, `locate`, `updatedb`, and `xargs`, g-prefixed - # core utilities (those that come with OS X are outdated) - BASICS=( - "findutils" \ - "coreutils" \ - "binutils" \ - "diffutils" \ - "ed --default-names" \ - "gawk" \ - "gnu-indent --default-names" \ - "gnu-sed --default-names" \ - "gnu-tar --default-names" \ - "gnu-which --default-names" \ - "gnutls --default-names" \ - "grep --default-names" \ - "gzip" \ - "watch" \ - "wdiff --with-gettext" \ - "wget --enable-iri" \ - ) - SHOULD_INSTALL=( - "nmap" \ - "readline" \ - "netcat" \ - "reattach-to-user-namespace" \ - "daemonize" \ - "ngrep" \ - "gist" \ - "gawk" \ - "pstree" \ - "ack" \ - "hub" \ - "tig" \ - "heroku" \ - "scala" \ - "sbt" \ - "node" \ - "npm" \ - ) - MISC=("file-formula" \ - "less" \ - "openssh --with-brewed-openssl" \ - "perl518" \ - "rsync" \ - "svn" \ - "unzip" \ - ) - - install_items=() - OPTIND=1 - while getopts "uebsmah" OPTCHAR; - do - case $OPTCHAR in - u) - brew upgrade - ;; - e) - install_items=("${install_items[@]}" "${ESSENTIAL[@]}") - fix_brew_htop - ;; - b) - install_items=("${install_items[@]}" "${BASICS[@]}") - ;; - s) - install_items=("${install_items[@]}" "${SHOULD_INSTALL[@]}") - ;; - m) - install_items=("${install_items[@]}" "${MISC[@]}") - ;; - a) - install_items=("${install_items[@]}" "${ESSENTIAL[@]}" "${BASICS[@]}" "${SHOULD_INSTALL[@]}" "${MISC[@]}") - ;; - h) - do_the_brew_help - return - ;; - esac - done - echo "Installing the following packages:" - for ((i = 0; i < ${#install_items[@]}; i++)); do printf '\t%s\n' "${install_items[$i]}"; done; - brew update - brew_install_items ${install_items} - brew cleanup -} - -function do_the_brew_help() { - echo "do_the_brew Usage: --a install all packages. --u upgrade brew packages. --e install essential packages --b install GNU basics including replacements for non GNU versions included in OSX. --s install a wider range of packages. --m install very non-essential packages. --h display this help message. -" -} diff --git a/dotfiles/lib/shellrc/emacs.sh b/dotfiles/lib/shellrc/emacs.sh index 094e4395..34c35434 100644 --- a/dotfiles/lib/shellrc/emacs.sh +++ b/dotfiles/lib/shellrc/emacs.sh @@ -11,6 +11,11 @@ function _emacs { \emacs --daemon="$server_name" fi emacsclient $* --server-file="$server_name" + if hash reattach-to-user-namespace 2> /dev/null; then + reattach-to-user-namespace emacsclient $* --server-file=$server_name + else + emacsclient $* --server-file=$server_name + fi } function _emacs_daemon_exists { diff --git a/dotfiles/lib/shellrc/osx.sh b/dotfiles/lib/shellrc/osx.sh new file mode 100644 index 00000000..17b5f7e0 --- /dev/null +++ b/dotfiles/lib/shellrc/osx.sh @@ -0,0 +1,77 @@ +function set_global_osx_ssh_port { + set_osx_ssh_port $1 /System/Library/LaunchDaemons/ssh.plist +} + +function set_osx_ssh_port { + sudo sed -i -n "/SockServiceName/{p;n;s/>.*$1HIDKeyboardModifierMappingDst$3HIDKeyboardModifierMappingSrc$2" + echo $mapping + defaults -currentHost write -g com.apple.keyboard.modifiermapping.$1-0 -array-add "$mapping" +} + +function set_modifier_keys_on_all_keyboards() { + for vendor_product_id in $(get_keyboard_vendor_id_product_id_pairs | tr " " "-"); do + set_modifier_keys_for_vendor_product_id $vendor_product_id 0 2; echo $vendor_product_id; + done; +} + +function get_keyboard_vendor_id_product_id_pairs() { + ioreg -n IOHIDKeyboard -r | grep -e 'class IOHIDKeyboard' -e VendorID\" -e Product | gawk 'BEGIN { RS = "class IOHIDKeyboard" } match($0, /VendorID. = ([0-9]*)/, arr) { printf arr[1]} match($0, /ProductID. = ([0-9]*)/, arr) { printf " %s\n", arr[1]} ' +} diff --git a/dotfiles/lib/shellrc/yelp.sh b/dotfiles/lib/shellrc/yelp.sh deleted file mode 100644 index 8b967dae..00000000 --- a/dotfiles/lib/shellrc/yelp.sh +++ /dev/null @@ -1,88 +0,0 @@ -alias i="ipython tools/interactive.py" -alias apperror="tools/scribereader -e prod -f apperror | tools/pretty_error_log" -alias environ=". ~/.pgconf-$USER/environ.sh" -alias ym="cd ~/pg/yelp-main" -alias live="cd /nail/live/yelp" -alias sb="sandbox -vv --minimal" - -function fix_environment_script() { - sed -i 's/export YELP_CONFIG:yelp_conn:replication_delay_params.*$//' $YELP_SANDBOX_ROOT/environment.sh -} - -function get_sandbox_identifier() { - echo $YELP_SANDBOX_ROOT | gawk 'match($0, /pgconf-.*-(.*)/, matched) {print matched[1]}' -} - -function is_proddb() { -python 2>/dev/null - </dev/null 2>/dev/null; - then - sandbox_string="no sandbox" - fi - echo $sandbox_string -} - -function bash_sandbox_color() { - if [ $YELP_IN_SANDBOX ] - then - sandbox_color='\e[0;33m' - else - sandbox_color='\e[0;31m' - fi -} - -function zsh_sandbox_color() { - if [ $YELP_IN_SANDBOX ] - then - sandbox_color="%{$FG[149]%}" - else - sandbox_color="%{$FG[001]%}" - fi - echo $sandbox_color -} - -function colored_sandbox_string() { - if [ is_zsh ]; - then - sandbox_color=$(zsh_sandbox_color) - else - sandbox_color=$(bash_sandbox_color) - fi - echo "$sandbox_color$(sandbox_prompt_info)%{$reset_color%}" -} diff --git a/resources/com.googlecode.iterm2.plist b/resources/com.googlecode.iterm2.plist index 6a021836..681fb159 100644 --- a/resources/com.googlecode.iterm2.plist +++ b/resources/com.googlecode.iterm2.plist @@ -5218,11 +5218,11 @@ MaxVertically NSColorPanelMode - 1 - NSColorPickerSlidersDefaults - 1 + 7 + NSFontPanelAttributes + 1, 0 NSNavLastRootDirectory - ~/dotfiles + ~ NSQuotedKeystrokeBinding NSRepeatCountBinding @@ -5246,32 +5246,21 @@ NSTableView Sort Ordering KeyBingingTable - NSToolbar Configuration Terminal Toolbar - - TB Display Mode - 1 - TB Icon Size Mode - 1 - TB Is Shown - 0 - TB Size Mode - 1 - NSToolbar Configuration com.apple.NSColorPanel TB Is Shown 1 NSWindow Frame NSColorPanel - 1180 103 231 329 0 0 1440 877 + 427 356 222 309 0 0 1920 1057 NSWindow Frame Preferences - 401 365 924 485 0 0 1440 900 + 491 152 924 485 0 0 1920 1080 NSWindow Frame SUStatusFrame - 528 562 384 129 0 0 1440 878 - NSWindow Frame UKCrashReporter - 99 294 592 584 0 0 1440 878 + 768 697 384 129 0 0 1920 1058 NSWindow Frame iTerm Window 0 - 4 446 717 431 0 0 1440 877 + 757 309 585 401 0 0 1920 1057 + NSWindow Frame iTerm Window 1 + 474 103 1264 896 0 0 1920 1057 New Bookmarks @@ -5284,146 +5273,146 @@ Ansi 0 Color Blue Component - 0.12941177189350128 + 0.19370138645172119 Green Component - 0.12156862765550613 + 0.15575926005840302 Red Component - 0.11372549086809158 + 0.0 Ansi 1 Color Blue Component - 0.40000000596046448 + 0.14145714044570923 Green Component - 0.40000000596046448 + 0.10840655118227005 Red Component - 0.80000001192092896 + 0.81926977634429932 Ansi 10 Color Blue Component - 0.18039216101169586 + 0.38298487663269043 Green Component - 0.16470588743686676 + 0.35665956139564514 Red Component - 0.15686275064945221 + 0.27671992778778076 Ansi 11 Color Blue Component - 0.25490197539329529 + 0.43850564956665039 Green Component - 0.23137255012989044 + 0.40717673301696777 Red Component - 0.21568627655506134 + 0.32436618208885193 Ansi 12 Color Blue Component - 0.70588237047195435 + 0.51685798168182373 Green Component - 0.71764707565307617 + 0.50962930917739868 Red Component - 0.70588237047195435 + 0.44058024883270264 Ansi 13 Color Blue Component - 0.87843137979507446 + 0.72908437252044678 Green Component - 0.87843137979507446 + 0.33896297216415405 Red Component - 0.87843137979507446 + 0.34798634052276611 Ansi 14 Color Blue Component - 0.35294118523597717 + 0.56363654136657715 Green Component - 0.40784314274787903 + 0.56485837697982788 Red Component - 0.63921570777893066 + 0.50599193572998047 Ansi 15 Color Blue Component - 1 + 0.86405980587005615 Green Component - 1 + 0.95794391632080078 Red Component - 1 + 0.98943418264389038 Ansi 2 Color Blue Component - 0.40784314274787903 + 0.020208755508065224 Green Component - 0.74117648601531982 + 0.54115492105484009 Red Component - 0.70980393886566162 + 0.44977453351020813 Ansi 3 Color Blue Component - 0.45490196347236633 + 0.023484811186790466 Green Component - 0.7764706015586853 + 0.46751424670219421 Red Component - 0.94117647409439087 + 0.64746475219726562 Ansi 4 Color Blue Component - 0.7450980544090271 + 0.78231418132781982 Green Component - 0.63529413938522339 + 0.46265947818756104 Red Component - 0.5058823823928833 + 0.12754884362220764 Ansi 5 Color Blue Component - 0.73333334922790527 + 0.43516635894775391 Green Component - 0.58039218187332153 + 0.10802463442087173 Red Component - 0.69803923368453979 + 0.77738940715789795 Ansi 6 Color Blue Component - 0.71764707565307617 + 0.52502274513244629 Green Component - 0.7450980544090271 + 0.57082360982894897 Red Component - 0.54117649793624878 + 0.14679534733295441 Ansi 7 Color Blue Component - 0.7764706015586853 + 0.79781103134155273 Green Component - 0.78431373834609985 + 0.89001238346099854 Red Component - 0.77254903316497803 + 0.91611063480377197 Ansi 8 Color Blue Component - 0.58823531866073608 + 0.15170273184776306 Green Component - 0.59607845544815063 + 0.11783610284328461 Red Component - 0.58823531866073608 + 0.0 Ansi 9 Color Blue Component - 0.37254902720451355 + 0.073530435562133789 Green Component - 0.57647061347961426 + 0.21325300633907318 Red Component - 0.87058824300765991 + 0.74176257848739624 Automatically Log @@ -5432,11 +5421,11 @@ Background Color Blue Component - 0.12941177189350128 + 0.15170273184776306 Green Component - 0.12156862765550613 + 0.11783610284328461 Red Component - 0.11372549086809158 + 0.0 Background Image Is Tiled @@ -5455,11 +5444,11 @@ Bold Color Blue Component - 0.7764706015586853 + 0.56363654136657715 Green Component - 0.78431373834609985 + 0.56485837697982788 Red Component - 0.77254903316497803 + 0.50599193572998047 Character Encoding 4 @@ -5472,20 +5461,20 @@ Cursor Color Blue Component - 0.7764706015586853 + 0.51685798168182373 Green Component - 0.78431373834609985 + 0.50962930917739868 Red Component - 0.77254903316497803 + 0.44058024883270264 Cursor Text Color Blue Component - 0.12941177189350128 + 0.19370138645172119 Green Component - 0.12156862765550613 + 0.15575926005840302 Red Component - 0.11372549086809158 + 0.0 Cursor Type 2 @@ -5506,11 +5495,11 @@ Foreground Color Blue Component - 0.7764706015586853 + 0.51685798168182373 Green Component - 0.78431373834609985 + 0.50962930917739868 Red Component - 0.77254903316497803 + 0.44058024883270264 Guid 3314520D-1E49-4605-AFCE-EA48A596636F @@ -5852,20 +5841,20 @@ Selected Text Color Blue Component - 0.7764706015586853 + 0.56363654136657715 Green Component - 0.78431373834609985 + 0.56485837697982788 Red Component - 0.77254903316497803 + 0.50599193572998047 Selection Color Blue Component - 0.25490197539329529 + 0.19370138645172119 Green Component - 0.23137255012989044 + 0.15575926005840302 Red Component - 0.21568627655506134 + 0.0 Semantic History @@ -6007,6 +5996,8 @@ /Users/imalison + NoSyncNeverRemindPrefsChangesLost + OnlyWhenMoreTabs OpenArrangementAtStartup @@ -6071,7 +6062,7 @@ SUHasLaunchedBefore SULastCheckTime - 2014-10-24T09:47:01Z + 2014-10-27T21:23:05Z SavePasteHistory Show Toolbelt @@ -6100,8 +6091,6 @@ TripleClickSelectsFullWrappedLines - UKCrashReporterLastCrashReportDate - 1404793472 URLHandlersByGuid UseBorder @@ -6125,6 +6114,6 @@ findRegex_iTerm iTerm Version - 1.0.0.20140629 + 2.0.0.20141022