Tweaks, add rvm add other things to bootstrap.

This commit is contained in:
Ivan Malison 2014-11-09 22:18:16 -08:00
parent ab33ef7a58
commit b775752068
10 changed files with 65 additions and 43 deletions

View File

@ -1 +1 @@
source ~/.bashrc
source ~/.bashrc

View File

@ -1,2 +1,5 @@
source ~/.lib/shellenv.sh
source ~/.lib/shellrc.sh
source ~/.lib/bash.sh
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

View File

@ -82,6 +82,9 @@
"icu4c",
"intltool",
"jpeg",
"rvm",
"bundler",
"foreman",
"less",
"libevent",
"libffi",

@ -1 +1 @@
Subproject commit 30d80f4998d74155818e6db48bc5c8d17c4926ae
Subproject commit fe9a06eebcc31f846251c4a11b04526ff0bd7e01

View File

@ -139,6 +139,7 @@ class WiFiAutoSwitcher(object):
if 'SSID' in status_dict:
network = self._networks.get(status_dict['SSID'])
if network is None:
# Don't do anything if the current network is not recognized
return
if not network or network.should_switch(status_dict):
log.debug("Attempting to switch networks from {0}, ".format(
@ -171,12 +172,14 @@ if __name__ == '__main__':
log_util.enable_logger(__name__)
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--network', nargs='+', type=str, action='append', dest='networks')
network_pairs = parser.parse_args().networks
parser.add_argument('-s', '--sleep-time', type=int, dest='sleep_time')
args = parser.parse_args()
network_pairs = args.networks
for network_pair in network_pairs:
assert len(network_pair) == 2
auto_switcher = WiFiAutoSwitcher(
[Network(*ssid_password) for ssid_password in network_pairs]
)
while True:
time.sleep(4)
time.sleep(args.sleep_time)
auto_switcher.switch_if_necessary()

33
dotfiles/lib/shellenv.sh Normal file
View File

@ -0,0 +1,33 @@
source ~/.lib/shellrc/functions.sh
function add_to_front_of_path {
export PATH=$@:$(echo $PATH | sed "s|:*$@||g" | sed "s|^:||")
}
function add_to_back_of_path {
export PATH=$(echo $PATH | sed "s|:*$@||g" | sed "s|^:||"):$@
}
add_to_back_of_path "$HOME/.local/lib/python2.6/site-packages"
add_to_back_of_path "$HOME/.rvm/bin"
hash brew 2>/dev/null && add_to_front_of_path "$(brew --prefix coreutils)/libexec/gnubin"
add_to_front_of_path "/usr/local/bin"
hash brew 2>/dev/null && add_to_front_of_path "$(brew --prefix emacs)/libexec/gnubin"
if is_osx; then
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
add_to_back_of_path "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/"
export JAVA_HOME="$(find /Library/Java/JavaVirtualMachines -depth 1 | head -n 1)/Contents/Home"
# Access gnu man pages.
hash brew 2> /dev/null && export MANPATH="$(brew --prefix)/opt/coreutils/libexec/gnuman:$MANPATH"
else
export JAVA_HOME="$(update-alternatives --config java | get_cols ' -1' | head -n 1)"
is_osx && export VISUAL="which emacsclient -c -n"
fi
add_to_front_of_path "$JAVA_HOME/bin"
add_to_back_of_path "$(dotfiles_directory)/resources/python"
add_to_back_of_path "/usr/local/sbin"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

View File

@ -1,3 +1,13 @@
slate.configAll({
windowHintsIgnoreHiddenWindows: false,
windowHintsShowIcons: true,
windowHintsSpread: true,
switchShowTitles: true,
windowHintsSpreadSearchHeight: 100,
windowHintsSpreadSearchWidth: 100,
windowHintsSpreadPadding: 40
});
var hint = slate.op("hint", {
"characters" : "ASDFGHJKLQWERTYUIOPCVBN"
});
@ -16,8 +26,6 @@ function quarterCorner(corner) {
});
}
slate.bindAll({"esc:cmd": hint, "space:alt": grid});
var hyper = ":ctrl;shift;alt;cmd";
function hyperBindAll(mapping) {
console.log(_.object(_.map(
@ -83,10 +91,4 @@ hyperBindAll({
// return [asString, slate.op("activate-snapshot", {"name": name})];
// })
// ));
slate.configAll({
windowHintsIgnoreHiddenWindows: false,
windowHintsShowIcons: true,
windowHintsSpread: true,
switchShowTitles: true
});
slate.bindAll({"esc:cmd": hint, "space:alt": grid});

View File

@ -1,30 +1 @@
source ~/.lib/shellrc/functions.sh
function add_to_front_of_path {
export PATH=$@:$(echo $PATH | sed "s|:*$@||g" | sed "s|^:||")
}
function add_to_back_of_path {
export PATH=$(echo $PATH | sed "s|:*$@||g" | sed "s|^:||"):$@
}
add_to_back_of_path "$HOME/.local/lib/python2.6/site-packages"
hash brew 2>/dev/null && add_to_front_of_path "$(brew --prefix coreutils)/libexec/gnubin"
add_to_front_of_path "/usr/local/bin"
hash brew 2>/dev/null && add_to_front_of_path "$(brew --prefix emacs)/libexec/gnubin"
if is_osx; then
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
add_to_back_of_path "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/"
export JAVA_HOME="$(find /Library/Java/JavaVirtualMachines -depth 1 | head -n 1)/Contents/Home"
# Access gnu man pages.
hash brew 2> /dev/null && export MANPATH="$(brew --prefix)/opt/coreutils/libexec/gnuman:$MANPATH"
else
export JAVA_HOME="$(update-alternatives --config java | get_cols ' -1' | head -n 1)"
is_osx && export VISUAL="which emacsclient -c -n"
fi
add_to_front_of_path "$JAVA_HOME/bin"
add_to_back_of_path "$(dotfiles_directory)/resources/python"
add_to_back_of_path "/usr/local/sbin"
source ~/.lib/shellenv.sh

View File

@ -1,3 +1,5 @@
source ~/.lib/shellrc.sh
source ~/.lib/zsh.sh
test -r ~/custom.zsh && source ~/custom.zsh
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

View File

@ -12,6 +12,7 @@ def all(ctx):
cider_install(ctx)
enable_access_for_assistive_devices(ctx)
enable_hyper(ctx)
install_rvm(ctx)
osx_config(ctx)
@ -135,6 +136,10 @@ def get_command_line_tools(ctx):
if not util.command_exists('gcc'):
ctx.run('xcode-select --install')
@ctask
def install_rvm(ctx):
ctx.run('\curl -sSL https://get.rvm.io | bash -s stable')
@ctask
def enable_locate(ctx):
ctx.run('sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist')