Tweaks, add rvm add other things to bootstrap.
This commit is contained in:
parent
ab33ef7a58
commit
b775752068
@ -1 +1 @@
|
|||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
|
@ -1,2 +1,5 @@
|
|||||||
|
source ~/.lib/shellenv.sh
|
||||||
source ~/.lib/shellrc.sh
|
source ~/.lib/shellrc.sh
|
||||||
source ~/.lib/bash.sh
|
source ~/.lib/bash.sh
|
||||||
|
|
||||||
|
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
|
||||||
|
@ -82,6 +82,9 @@
|
|||||||
"icu4c",
|
"icu4c",
|
||||||
"intltool",
|
"intltool",
|
||||||
"jpeg",
|
"jpeg",
|
||||||
|
"rvm",
|
||||||
|
"bundler",
|
||||||
|
"foreman",
|
||||||
"less",
|
"less",
|
||||||
"libevent",
|
"libevent",
|
||||||
"libffi",
|
"libffi",
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 30d80f4998d74155818e6db48bc5c8d17c4926ae
|
Subproject commit fe9a06eebcc31f846251c4a11b04526ff0bd7e01
|
@ -139,6 +139,7 @@ class WiFiAutoSwitcher(object):
|
|||||||
if 'SSID' in status_dict:
|
if 'SSID' in status_dict:
|
||||||
network = self._networks.get(status_dict['SSID'])
|
network = self._networks.get(status_dict['SSID'])
|
||||||
if network is None:
|
if network is None:
|
||||||
|
# Don't do anything if the current network is not recognized
|
||||||
return
|
return
|
||||||
if not network or network.should_switch(status_dict):
|
if not network or network.should_switch(status_dict):
|
||||||
log.debug("Attempting to switch networks from {0}, ".format(
|
log.debug("Attempting to switch networks from {0}, ".format(
|
||||||
@ -171,12 +172,14 @@ if __name__ == '__main__':
|
|||||||
log_util.enable_logger(__name__)
|
log_util.enable_logger(__name__)
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('-n', '--network', nargs='+', type=str, action='append', dest='networks')
|
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:
|
for network_pair in network_pairs:
|
||||||
assert len(network_pair) == 2
|
assert len(network_pair) == 2
|
||||||
auto_switcher = WiFiAutoSwitcher(
|
auto_switcher = WiFiAutoSwitcher(
|
||||||
[Network(*ssid_password) for ssid_password in network_pairs]
|
[Network(*ssid_password) for ssid_password in network_pairs]
|
||||||
)
|
)
|
||||||
while True:
|
while True:
|
||||||
time.sleep(4)
|
time.sleep(args.sleep_time)
|
||||||
auto_switcher.switch_if_necessary()
|
auto_switcher.switch_if_necessary()
|
||||||
|
33
dotfiles/lib/shellenv.sh
Normal file
33
dotfiles/lib/shellenv.sh
Normal 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*
|
@ -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", {
|
var hint = slate.op("hint", {
|
||||||
"characters" : "ASDFGHJKLQWERTYUIOPCVBN"
|
"characters" : "ASDFGHJKLQWERTYUIOPCVBN"
|
||||||
});
|
});
|
||||||
@ -16,8 +26,6 @@ function quarterCorner(corner) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
slate.bindAll({"esc:cmd": hint, "space:alt": grid});
|
|
||||||
|
|
||||||
var hyper = ":ctrl;shift;alt;cmd";
|
var hyper = ":ctrl;shift;alt;cmd";
|
||||||
function hyperBindAll(mapping) {
|
function hyperBindAll(mapping) {
|
||||||
console.log(_.object(_.map(
|
console.log(_.object(_.map(
|
||||||
@ -83,10 +91,4 @@ hyperBindAll({
|
|||||||
// return [asString, slate.op("activate-snapshot", {"name": name})];
|
// return [asString, slate.op("activate-snapshot", {"name": name})];
|
||||||
// })
|
// })
|
||||||
// ));
|
// ));
|
||||||
|
slate.bindAll({"esc:cmd": hint, "space:alt": grid});
|
||||||
slate.configAll({
|
|
||||||
windowHintsIgnoreHiddenWindows: false,
|
|
||||||
windowHintsShowIcons: true,
|
|
||||||
windowHintsSpread: true,
|
|
||||||
switchShowTitles: true
|
|
||||||
});
|
|
||||||
|
@ -1,30 +1 @@
|
|||||||
source ~/.lib/shellrc/functions.sh
|
source ~/.lib/shellenv.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"
|
|
@ -1,3 +1,5 @@
|
|||||||
source ~/.lib/shellrc.sh
|
source ~/.lib/shellrc.sh
|
||||||
source ~/.lib/zsh.sh
|
source ~/.lib/zsh.sh
|
||||||
test -r ~/custom.zsh && source ~/custom.zsh
|
test -r ~/custom.zsh && source ~/custom.zsh
|
||||||
|
|
||||||
|
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
|
||||||
|
@ -12,6 +12,7 @@ def all(ctx):
|
|||||||
cider_install(ctx)
|
cider_install(ctx)
|
||||||
enable_access_for_assistive_devices(ctx)
|
enable_access_for_assistive_devices(ctx)
|
||||||
enable_hyper(ctx)
|
enable_hyper(ctx)
|
||||||
|
install_rvm(ctx)
|
||||||
osx_config(ctx)
|
osx_config(ctx)
|
||||||
|
|
||||||
|
|
||||||
@ -135,6 +136,10 @@ def get_command_line_tools(ctx):
|
|||||||
if not util.command_exists('gcc'):
|
if not util.command_exists('gcc'):
|
||||||
ctx.run('xcode-select --install')
|
ctx.run('xcode-select --install')
|
||||||
|
|
||||||
|
@ctask
|
||||||
|
def install_rvm(ctx):
|
||||||
|
ctx.run('\curl -sSL https://get.rvm.io | bash -s stable')
|
||||||
|
|
||||||
@ctask
|
@ctask
|
||||||
def enable_locate(ctx):
|
def enable_locate(ctx):
|
||||||
ctx.run('sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist')
|
ctx.run('sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist')
|
||||||
|
Loading…
Reference in New Issue
Block a user