Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ module_install () {
}
_module_install_inner () {
local pth=$MODS_ON/$module
[[ -d $MODS_ON ]] || mkdir $MODS_ON
link_file "../${MODS_ALL##*/}/$module" "$MODS_ON" $lvl2
if [[ $module = base ]]; then
scripts_execute "$pth" 'install' $lvl2
Expand Down Expand Up @@ -688,7 +689,7 @@ scripts_execute () {
local count=0

if ! [[ -h $pth || -d $pth ]]; then
fail $lvl "Invalid $allow_any_dir path $(fmt bold $pth)."
fail $lvl "Invalid $name script path $(fmt bold $pth)."
return 1
fi

Expand Down
2 changes: 1 addition & 1 deletion mods-available/developer/env.path-mysql.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export PATH=/usr/local/mysql/bin:$PATH

export MANPATH="/usr/local/mysql/man:$MANPATH"
2 changes: 0 additions & 2 deletions mods-available/developer/env.path.zsh

This file was deleted.

2 changes: 2 additions & 0 deletions mods-available/git/env.path.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# not sure when this was needed
# export MANPATH="/usr/local/git/man:$MANPATH"
36 changes: 36 additions & 0 deletions mods-available/git/functions/git-delete-history
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Delete all revision history of remote Git repo or Github gist with given hash
#
# Usage: git-delete-history HASH
# Usage: git-delete-history git@github.com:CNG/dotfiles.git
#
# Example for https://gist.github.com/CNG/1019db1a536ad325590f:
# git-delete-history 1019db1a536ad325590f
#
# Inspiration: http://stackoverflow.com/a/26000395/172602

set -o errexit

# Make unique temporary directory
# https://unix.stackexchange.com/a/84980/39419
temp=`mktemp -d 2>/dev/null || mktemp -d -t 'temp'`

(
cd "$temp"
if [[ $1 = *.git ]]; then
git clone $1 .
else
git clone git@gist.github.com:$1.git .
fi
git checkout --orphan latest_branch
git add -A
git commit -a --allow-empty-message -m ''
git branch -D master
git branch -m master
git gc --aggressive --prune=all
git push -f origin master
)

# Delete temporary directory
rm -rf "$temp"
19 changes: 12 additions & 7 deletions mods-available/git/functions/git-import
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
#!/bin/bash

# Import a file or directory, with history, from a Git repository
# Import a file or directory, with history, from given Git repository into the
# repository within which this function is executed
#
# Usage: git-import path/to/repo/file/or/folder/to/import
#
# Inspiration:
# - http://blog.neutrino.es/2012/git-copy-a-file-or-directory-from-another-repository-preserving-history/
# - https://gist.github.com/voltagex/3888364

#
# Also consider:
# - http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/

set -o errexit

if [[ $(git rev-parse --is-inside-work-tree > /dev/null 2>&1) != true ]]; then
echo "Must be inside Git repository work tree where ${1##*/} is to be imported."
return
fi

# Make unique temporary directory
temp=$PWD/_tmp_patches
while [[ -d $temp ]]; do
temp=${temp}_
done
mkdir "$temp"
# https://unix.stackexchange.com/a/84980/39419
temp=$(mktemp -p /var/tmp -d 2>/dev/null || mktemp -d -t 'temp')

# Make patches
(
Expand Down
4 changes: 2 additions & 2 deletions mods-available/git/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ create_local_config() {
fi

#local git_authorname git_authoremail
user $lvl "$(fmt bold What is your Github author name?)"
user $lvl "$(fmt bold 'What is your Github author name?')"
read -e git_authorname
user $lvl "$(fmt bold What is your Github author email?)"
user $lvl "$(fmt bold 'What is your Github author email?')"
read -e git_authoremail

sed -e "s/AUTHORNAME/$git_authorname/g" -e "s/AUTHOREMAIL/$git_authoremail/g" -e "s/GIT_CREDENTIAL_HELPER/$git_credential/g" "$target_file.example" > "$target_file"
Expand Down
8 changes: 6 additions & 2 deletions mods-available/macos/upgrade_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# echo "› sudo softwareupdate -i -a"
# sudo softwareupdate -i -a

# This does not survive reboot. Need 'UseKeychain yes' in ~/.ssh/config
# load identities from keychain
# ssh-add -A

# turn on keychain
keychain

Expand Down Expand Up @@ -69,10 +73,10 @@ defaults write com.apple.inputmethod.Kotoeri.plist JIMPrefTypingMethodKey 0
defaults write com.apple.inputmethod.Kotoeri.plist JIMPrefVersionKey 1

# Keyboards
defaults write com.apple.HIToolbox.plist AppleCurrentKeyboardLayoutInputSourceID "com.apple.keylayout.US"
defaults write com.apple.HIToolbox.plist AppleCurrentKeyboardLayoutInputSourceID "com.apple.keylayout.Dvorak"
defaults write com.apple.HIToolbox.plist AppleEnabledInputSources -array \
'{InputSourceKind = "Keyboard Layout";"KeyboardLayout ID" = 0;"KeyboardLayout Name" = "U.S.";}' \
'{InputSourceKind = "Keyboard Layout";"KeyboardLayout ID" = 16301;"KeyboardLayout Name" = "DVORAK - QWERTY CMD";}' \
'{InputSourceKind = "Keyboard Layout";"KeyboardLayout ID" = 16300;"KeyboardLayout Name" = "Dvorak";}' \
'{"Bundle ID" = "com.apple.inputmethod.Kotoeri";"Input Mode" = "com.apple.inputmethod.Japanese";InputSourceKind = "Input Mode";}' \
'{"Bundle ID" = "com.apple.inputmethod.Kotoeri";"Input Mode" = "com.apple.inputmethod.Roman";InputSourceKind = "Input Mode";}' \
'{"Bundle ID" = "com.apple.inputmethod.Kotoeri";"Input Mode" = "com.apple.inputmethod.Japanese.Katakana";InputSourceKind = "Input Mode";}' \
Expand Down
2 changes: 1 addition & 1 deletion mods-available/productivity/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defaults write com.mizage.Divvy defaultColumnCount 7
defaults write com.mizage.Divvy defaultRowCount 6
defaults write com.mizage.Divvy lastColumnCount 6
defaults write com.mizage.Divvy lastRowCount 6
defaults write com.mizage.Divvy shortcuts -data 62706c6973743030d401020304050847485424746f7058246f626a65637473582476657273696f6e59246172636869766572d1060754726f6f748001a8090a122b2c333b4355246e756c6cd20b0c0d0e5624636c6173735a4e532e6f626a656374738007a30f1011800280058006dd131415161718191a1b1c1d1e0b1f20212223202425262228292a5f101273656c656374696f6e456e64436f6c756d6e5f101173656c656374696f6e5374617274526f775c6b6579436f6d626f436f646557656e61626c65645d6b6579436f6d626f466c6167735f101473656c656374696f6e5374617274436f6c756d6e5b73697a65436f6c756d6e735a73756264697669646564576e616d654b657956676c6f62616c5f100f73656c656374696f6e456e64526f775873697a65526f777310011000102909120010000010070880030910051006800450d22d2e2f325824636c61737365735a24636c6173736e616d65a230315853686f7274637574584e534f626a6563745853686f7274637574dd131415161718191a1b1c1d1e0b2920342236282425262228292a1027091200100000088003098004dd131415161718191a1b1c1d1e0b29203c223e202425262228292a1025091200100000088003098004d22d2e4445a34546315e4e534d757461626c654172726179574e53417272617912000186a05f100f4e534b657965644172636869766572000800110016001f002800320035003a003c0045004b00500057006200640068006a006c006e0089009e00b200bf00c700d500ec00f80103010b01120124012d012f0131013301340139013b013c013e013f0141014301450146014b0154015f0162016b0174017d0198019a019b01a001a101a301a401a601c101c301c401c901ca01cc01cd01cf01d401d801e701ef01f40000000000000201000000000000004900000000000000000000000000000206
defaults write com.mizage.Divvy shortcuts -data 62706c6973743030d40102030405064546582476657273696f6e58246f626a65637473592461726368697665725424746f7012000186a0a8070810292a31394155246e756c6cd2090a0b0f5a4e532e6f626a656374735624636c617373a30c0d0e8002800580068007dd11121314150a161718191a1b1c1d1e1f20212223212526271f285873697a65526f77735f100f73656c656374696f6e456e64526f775f101173656c656374696f6e5374617274526f775a7375626469766964656456676c6f62616c5f101273656c656374696f6e456e64436f6c756d6e57656e61626c65645b73697a65436f6c756d6e73576e616d654b65795c6b6579436f6d626f436f64655f101473656c656374696f6e5374617274436f6c756d6e5d6b6579436f6d626f466c61677310061005100008098004100109100780031021120010000050d22b2c2d2e5a24636c6173736e616d655824636c61737365735853686f7274637574a22f305853686f7274637574584e534f626a656374dd11121314150a161718191a1b1c1d1e1f2021221d212526371e3808098004098003101e1200100000dd11121314150a161718191a1b1c1d1e1f2021221d2125263f1f400809800409800310231200100000d22b2c42435e4e534d757461626c654172726179a3424430574e5341727261795f100f4e534b657965644172636869766572d1474854726f6f74800100080011001a0023002d0032003700400046004b0056005d006100630065006700690084008d009f00b300be00c500da00e200ee00f60103011a0128012a012c012e012f013001320134013501370139013b0140014101460151015a01630166016f017801930194019501970198019a019c01a101bc01bd01be01c001c101c301c501ca01cf01de01e201ea01fc01ff02040000000000000201000000000000004900000000000000000000000000000206
defaults write com.mizage.Divvy showMenuIcon 0
defaults write com.mizage.Divvy useDefaultGrid 1

Expand Down
2 changes: 2 additions & 0 deletions mods-available/zsh/env.path-local.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export PATH="./bin:/usr/local/bin:/usr/local/sbin:$PATH"
export MANPATH="/usr/local/man:$MANPATH"
4 changes: 4 additions & 0 deletions mods-available/zsh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ rm -rf /tmp/powerlinefonts

# Disable path_helper since we manage $PATH separately
[[ ! -x /usr/libexec/path_helper ]] || sudo chmod -x /usr/libexec/path_helper

# Ignore insecure directories and continue [y] or abort compinit [n]?
sudo chmod -R 755 /usr/local/share/zsh
sudo chown -R root:staff /usr/local/share/zsh