diff --git a/dotfiles/MacOSX/environment.plist b/dotfiles/MacOSX/environment.plist deleted file mode 100644 index 7b383555..00000000 --- a/dotfiles/MacOSX/environment.plist +++ /dev/null @@ -1,11 +0,0 @@ - - - - - PATH - - - - - diff --git a/dotfiles/Xmodmap b/dotfiles/Xmodmap deleted file mode 100644 index e69de29b..00000000 diff --git a/dotfiles/lib/bash/prompt.sh b/dotfiles/lib/bash/prompt.sh deleted file mode 100644 index 65e0f759..00000000 --- a/dotfiles/lib/bash/prompt.sh +++ /dev/null @@ -1,80 +0,0 @@ -# Regular Colors -Black='\e[0;30m' # Black -Red='\e[0;31m' # Red -Green='\e[0;32m' # Green -Yellow='\e[0;33m' # Yellow -Blue='\e[0;34m' # Blue -Purple='\e[0;35m' # Purple -Cyan='\e[0;36m' # Cyan -White='\e[0;37m' # White -BoldYellow='\e[1;33m' # Yellow -Gray="\[\033[1;30m\]" - - -function current_directory() { - pwd | sed "s:$HOME:~:" -} - - -function git_prompt_info() { - if test -z $(git branch-or-sha); - then - echo "" - else - echo " $(separator "on") $(git branch-or-sha)$(git_status_character)" - fi -} - -function git_status_character() { - if git dirty; - then - print_with_color "✘" "$Red" - else - print_with_color "✔" "$Green" - fi -} - -function command_line_character() { - if ! test -z $(git branch-or-sha); - then - echo "±" - else - echo "○" - fi -} - -function prompt_basic_colors() { - export USERNAME_COLOR="$Green" - export SEPARATOR_COLOR="$Black" - export HOSTNAME_COLOR="$Blue" - export CURRENT_DIRECTORY_COLOR="$BoldYellow" - export SEPARATOR_COLOR="$Gray" -} - -function print_with_color() { - echo "$2$1\e[0m" -} - -function separator() { - print_with_color "$1" "$SEPARATOR_COLOR" -} - -prompt_basic_colors -function set_bash_prompt() { - PS1="╭─$(print_with_color "$(whoami)" "$USERNAME_COLOR") $(separator "at") $(print_with_color "`hostname -s`" "$HOSTNAME_COLOR") $(separator "in") $(print_with_color "`current_directory`" "$CURRENT_DIRECTORY_COLOR")$(git_prompt_info) -╰─$(command_line_character) " -} - -# export PROMPT_COMMAND=set_bash_prompt - -PS2='(%_) ' - -case "$TERM" in - dumb) - export PS1='> ' - ;; -esac - -function set_powerline_prompt { - source "$(python_module_path powerline)/bindings/bash/powerline.sh" -} diff --git a/dotfiles/lib/bin/fix_screen_tearing.pl b/dotfiles/lib/bin/fix_screen_tearing.pl deleted file mode 100755 index 5f6a9aa8..00000000 --- a/dotfiles/lib/bin/fix_screen_tearing.pl +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl -# Quickly set ForceFullCompositionPipeline with nvidia-settings for all currently connected screens, useful for gamers seeing screen tear issues -use strict; -use warnings; - -# Grab xrandr output for parsing -my $xrandrOutput = `xrandr`; - -# Filter all currently selected modes -my @modes = $xrandrOutput =~ /.*\sconnected.*/g; -die "Output didn't match expected format\n" if ( scalar @modes lt 1 ); -my @newModes = (); -foreach my $mode ( @modes ) -{ - # Filter the current modes and add to list in right format - my @details = $mode =~ /(.*)\sconnected.*?(\d[^\s]+).*/g; - die "Output didn't match expected format\n" if ( scalar @details lt 2 ); - push( @newModes, join( ":", @details ) ); -} - -# Construct the new mode command -my $newModeCommand = "nvidia-settings --assign CurrentMetaMode='"; -$newModeCommand .= "$_ { ForceFullCompositionPipeline = On }, " foreach ( @newModes ); -$newModeCommand .= "'"; - -# Print and set our new mode -print "running \"$newModeCommand\"\n"; -system( $newModeCommand ); diff --git a/dotfiles/lib/bin/restart.sh b/dotfiles/lib/bin/restart.sh deleted file mode 100755 index 5ce3452f..00000000 --- a/dotfiles/lib/bin/restart.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh -pkill "$1" -nohup "$@" >"/tmp/$1.out" 2>"/tmp/$1.error" & diff --git a/dotfiles/lib/bin/tvpower.js b/dotfiles/lib/bin/tvpower.js deleted file mode 100755 index cf780ac5..00000000 --- a/dotfiles/lib/bin/tvpower.js +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env node - -var lgtv = require("lgtv2")({ - url: 'ws://10.0.0.136:3000' -}); - -lgtv.on('connect', function () { - console.log('connected'); - lgtv.request('ssap://system/turnOff', function (err, res) { - lgtv.disconnect(); - }); -}); diff --git a/dotfiles/lib/shellrc/aliases.sh b/dotfiles/lib/shellrc/aliases.sh deleted file mode 100644 index 18770ba9..00000000 --- a/dotfiles/lib/shellrc/aliases.sh +++ /dev/null @@ -1,57 +0,0 @@ -alias xup="xrdb ~/.Xresources" -alias tmux="tmux -2" -alias reload_tmux_conf="tmux source-file ~/.tmux.conf" -alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard' -alias fn='find . -name ' -alias prj='cd ~/Projects' -alias t27='tox -e py27 -- ' -alias tvenv='tox -e venv -- ' -alias reload_tmux='tmux source-file ~/.tmux.conf' -alias ssh='ssh -A ' -alias dusage='du -ch -d 0' -alias subl='reattach-to-user-namespace subl' -alias stack-profile='stack --work-dir .stack-work-profile --profile' - -# enables the sudoing of aliases. -alias sudo='sudo ' - -# Detect which `ls` flavor is in use -if ls --color > /dev/null 2>&1; then # GNU `ls` - colorflag="--color" -else # OS X `ls` - colorflag="-G" -fi -alias ls="command ls ${colorflag}" - -# IP addresses -alias externalip="dig +short myip.opendns.com @resolver1.opendns.com" - -alias whois="whois -h whois-servers.net" - -# View HTTP traffic -alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" -alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\"" -# The alias below is no longer needed when gnu readlink is on path as readlink -# command -v greadlink > /dev/null && alias readlink="greadlink" - -# Merge PDF files -# Usage: `mergepdf -o output.pdf input{1,2,3}.pdf` -alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py' - -# Disable Spotlight -alias spotoff="sudo mdutil -a -i off" -# Enable Spotlight -alias spoton="sudo mdutil -a -i on" - -# One of @janmoesen’s ProTip™s -for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do - alias "$method"="lwp-request -m '$method'" -done - -alias stfu="osascript -e 'set volume output muted true'" -alias pumpitup="osascript -e 'set volume 7'" -alias pip-upgrade="pip freeze --local | get_cols -F "=" 1 | xargs -n1 sudo pip install -U" - -[[ -e /usr/local/Cellar/macvim ]] && alias vim="$(find /usr/local/Cellar/macvim -depth 1 | grep "[0-9]$")/MacVim.app/Contents/MacOS/Vim" - -alias only_json='grep -E "^{\"" | jq .' diff --git a/dotfiles/lib/shellrc/osx.sh b/dotfiles/lib/shellrc/osx.sh deleted file mode 100644 index e3220700..00000000 --- a/dotfiles/lib/shellrc/osx.sh +++ /dev/null @@ -1,207 +0,0 @@ -is_osx || return - -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/>.*$1HIDKeyboardModifierMappingSrc$2HIDKeyboardModifierMappingDst$3" - 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]} ' -} - -function set_osx_hostname() { - local new_hostname="${1-imalison}" - sudo scutil --set ComputerName $new_hostname - sudo scutil --set HostName $new_hostname - sudo scutil --set LocalHostName $new_hostname - sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string $new_hostname -} - -function get_bundle_identifier() { - defaults read "$1/Contents/Info" CFBundleIdentifier -} - -_BUDDY="/usr/libexec/PlistBuddy" -_PLIST="$HOME/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist" - -function create_filename_rule { - $_BUDDY -c "Add LSHandlers:0 dict" $_PLIST - $_BUDDY -c "Add LSHandlers:0:LSHandlerRoleAll string $1" $_PLIST - $_BUDDY -c "Add LSHandlers:0:LSHandlerContentTag string $2" $_PLIST - $_BUDDY -c "Add LSHandlers:0:LSHandlerContentTagClass string public.filename-extension" $_PLIST - $_BUDDY -c "Add LSHandlers:0:LSHandlerPreferredVersions dict" $_PLIST - $_BUDDY -c "Add LSHandlers:0:LSHandlerPreferredVersions:LSHandlerRoleAll string -" $_PLIST -} - -function set_application_for_file_extension() { - local PLIST="$HOME/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist" - - # the key to match with the desired value - KEY="LSHandlerContentType" - - # the value for which we'll replace the handler - VALUE="${1-public.plain-text}" - - # the new handler for all roles - HANDLER="${2}" - - $_BUDDY -c 'Print "LSHandlers"' $_PLIST >/dev/null 2>&1 - if [[ $? -ne 0 ]] ; then - echo "There is no LSHandlers entry in $_PLIST" >&2 - exit 1 - fi - - declare -i I=0 - while [ true ] ; do - $_BUDDY -c "Print LSHandlers:$I" $_PLIST >/dev/null 2>&1 - [[ $? -eq 0 ]] || { echo "Finished, no $VALUE found, setting it to $HANDLER" ; create_entry ; exit ; } - - OUT="$( $_BUDDY -c "Print 'LSHandlers:$I:$KEY'" $_PLIST 2>/dev/null )" - if [[ $? -ne 0 ]] ; then - I=$I+1 - continue - fi - - CONTENT=$( echo "$OUT" ) - if [[ $CONTENT = $VALUE ]] ; then - echo "Replacing $CONTENT handler with $HANDLER" - $_BUDDY -c "Delete 'LSHandlers:$I'" $_PLIST - create_entry - exit - else - I=$I+1 - fi - done -} - -function reload_preferences { - killall -u $(whoami) cfprefsd -} - -function disable_proxy(){ - sudo networksetup -setsocksfirewallproxystate Wi-Fi off - sudo networksetup -setsocksfirewallproxystate Ethernet off - echo "SOCKS proxy disabled." -} - -function socks_proxy { - trap disable_proxy EXIT - sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 9999 - sudo networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 9999 - sudo networksetup -setsocksfirewallproxystate Wi-Fi on - sudo networksetup -setsocksfirewallproxystate Ethernet on - echo "SOCKS proxy enabled." - echo "Tunneling..." - echo "$@" - ssh -CND 9999 "$@" -} - -function clear_dock { - defaults write com.apple.dock persistent-apps -array -} - -function resistance_game_start { - say "everyone close their eyes." - sleep 4 - say "spies open their eyes" - sleep 4 - say "spies close their eyes" - sleep 4 - say "everyone open their eyes" -} - -function get_screen_by_index { - cscreen | head -n -1 | tail -n +2 | filter_by_column_value 2 "$1" | get_cols 1 -} - -function make_main_screen { - cscreen -i "$(get_screen_by_index "$1")" -p -} - -function swap_main_screen { - make_main_screen 2 -} - -function swap_mirror_swap { - mirror -off && swap_main_screen && mirror -on -} - -function brew_relink { - brew unlink "$1" && brew link "$1" -} - -export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig: diff --git a/dotfiles/lib/shellrc/remote_clipboard.sh b/dotfiles/lib/shellrc/remote_clipboard.sh deleted file mode 100644 index 5d19d767..00000000 --- a/dotfiles/lib/shellrc/remote_clipboard.sh +++ /dev/null @@ -1,41 +0,0 @@ -REMOTE_CLIPBOARD_PORT='1234' - -alias rc_ssh="ssh -R 1234:localhost:1234 " - -function remote_clipboard_server() { - while [ 1 ] - do - ncat -l -p ${1-$REMOTE_CLIPBOARD_PORT} -e "pbcopy" - done -} - -function remote_clipboard_server_daemon() { - daemonize `which reattach-to-user-namespace` -l $SHELL -c "source ~/.zshrc; remote_clipboard_server" -} - -function _linux_nc_paste_to_remote_clipboard() { - nc localhost ${1-$REMOTE_CLIPBOARD_PORT} -q 0 -} - -function _osx_nc_paste_to_remote_clipboard() { - nc localhost ${1-$REMOTE_CLIPBOARD_PORT} -} - -function remote_os_copy() { - if is_osx; - then - _osx_nc_paste_to_remote_clipboard - - else - _linux_nc_write_remote_clipboard - fi -} - -function smart_copy() { - if is_ssh; - then - remote_os_copy - else - oscopy - fi -} diff --git a/dotfiles/lib/shellrc/ssh_agent.sh b/dotfiles/lib/shellrc/ssh_agent.sh deleted file mode 100644 index 4dc2c28a..00000000 --- a/dotfiles/lib/shellrc/ssh_agent.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# acquired courtesy of -# http://superuser.com/questions/141044/sharing-the-same-ssh-agent-among-multiple-login-sessions#answer-141241 - -function sshag_findsockets { - find /tmp -uid $(id -u) -type s -name agent.\* 2>/dev/null -} - -function sshag_testsocket { - if [ ! -x "$(which ssh-add)" ] ; then - echo "ssh-add is not available; agent testing aborted" >&2 - return 1 - fi - - if [ X"$1" != X ] ; then - export SSH_AUTH_SOCK=$1 - fi - - if [ X"$SSH_AUTH_SOCK" = X ] ; then - return 2 - fi - - if [ -S $SSH_AUTH_SOCK ] ; then - ssh-add -l > /dev/null - if [ $? = 2 ] ; then - echo "Socket $SSH_AUTH_SOCK is dead! Deleting!" >&2 - rm -f $SSH_AUTH_SOCK - return 4 - else - return 0 - fi - else - echo "$SSH_AUTH_SOCK is not a socket!" >&2 - return 3 - fi -} - -function sshag_init { - # ssh agent sockets can be attached to a ssh daemon process or an - # ssh-agent process. - - AGENTFOUND=0 - - # Attempt to find and use the ssh-agent in the current environment - if sshag_testsocket ; then AGENTFOUND=1 ; fi - - # If there is no agent in the environment, search /tmp for - # possible agents to reuse before starting a fresh ssh-agent - # process. - if [ $AGENTFOUND = 0 ] ; then - for agentsocket in $(sshag_findsockets) ; do - if [ $AGENTFOUND != 0 ] ; then break ; fi - if sshag_testsocket $agentsocket ; then AGENTFOUND=1 ; fi - done - fi - - # If at this point we still haven't located an agent, it's time to - # start a new one - if [ $AGENTFOUND = 0 ] ; then - eval `ssh-agent` - fi - - # Clean up - unset AGENTFOUND - unset agentsocket - - { echo "Keys:"; ssh-add -l | sed 's/^/ /'; } >&2 - - # Display the found socket - echo $SSH_AUTH_SOCK; -} - - -# If we are not being sourced, but rather running as a subshell, -# let people know how to use the output. -if [[ $0 =~ sshag ]]; then - echo 'Output should be assigned to the environment variable $SSH_AUTH_SOCK.' >&2 - sshag_init -# Otherwise, make it convenient to invoke the search. -# When the alias is invoked, it will modify the shell environment. -else - alias sshag="sshag_init" -fi diff --git a/dotfiles/tern_config b/dotfiles/tern_config deleted file mode 100644 index 7024dd86..00000000 --- a/dotfiles/tern_config +++ /dev/null @@ -1,13 +0,0 @@ -{ - "libs": [ - "browser", - "jquery" - ], - "plugins": { - "nodejs": {}, - "requirejs": { - "baseURL": "./", - "paths": {} - } - } -} diff --git a/dotfiles/wemo/config.yml b/dotfiles/wemo/config.yml deleted file mode 100644 index 3444a29a..00000000 --- a/dotfiles/wemo/config.yml +++ /dev/null @@ -1,3 +0,0 @@ -cache: false -aliases: - lr: Living room lights \ No newline at end of file diff --git a/dotfiles/xmobarrc b/dotfiles/xmobarrc deleted file mode 100644 index 7401d99a..00000000 --- a/dotfiles/xmobarrc +++ /dev/null @@ -1,106 +0,0 @@ -Config { - - -- appearance - font = "xft:Bitstream Vera Sans Mono:size=9:bold:antialias=true" - , bgColor = "black" - , fgColor = "#646464" - , position = Top - , border = BottomB - , borderColor = "#646464" - - -- layout - , sepChar = "%" -- delineator between plugin names and straight text - , alignSep = "}{" -- separator between left-right alignment - , template = "%multicpu% | %coretemp% | %memory% | %dynnetwork% }{ %RJTT% | %date% || %kbd% " - - -- general behavior - , lowerOnStart = True -- send to bottom of window stack on start - , hideOnStart = False -- start with window unmapped (hidden) - , allDesktops = True -- show on all desktops - , overrideRedirect = True -- set the Override Redirect flag (Xlib) - , pickBroadest = False -- choose widest display (multi-monitor) - , persistent = True -- enable/disable hiding (True = disabled) - - -- plugins - -- Numbers can be automatically colored according to their value. xmobar - -- decides color based on a three-tier/two-cutoff system, controlled by - -- command options: - -- --Low sets the low cutoff - -- --High sets the high cutoff - -- - -- --low sets the color below --Low cutoff - -- --normal sets the color between --Low and --High cutoffs - -- --High sets the color above --High cutoff - -- - -- The --template option controls how the plugin is displayed. Text - -- color can be set by enclosing in tags. For more details - -- see http://projects.haskell.org/xmobar/#system-monitor-plugins. - , commands = - - -- weather monitor - [ Run Weather "RJTT" [ "--template", " | °C | % | hPa" - ] 36000 - - -- network activity monitor (dynamic interface resolution) - , Run DynNetwork [ "--template" , ": kB/s|kB/s" - , "--Low" , "1000" -- units: B/s - , "--High" , "5000" -- units: B/s - , "--low" , "darkgreen" - , "--normal" , "darkorange" - , "--high" , "darkred" - ] 10 - - -- cpu activity monitor - , Run MultiCpu [ "--template" , "Cpu: %|%" - , "--Low" , "50" -- units: % - , "--High" , "85" -- units: % - , "--low" , "darkgreen" - , "--normal" , "darkorange" - , "--high" , "darkred" - ] 10 - - -- cpu core temperature monitor - , Run CoreTemp [ "--template" , "Temp: °C|°C" - , "--Low" , "70" -- units: °C - , "--High" , "80" -- units: °C - , "--low" , "darkgreen" - , "--normal" , "darkorange" - , "--high" , "darkred" - ] 50 - - -- memory usage monitor - , Run Memory [ "--template" ,"Mem: %" - , "--Low" , "20" -- units: % - , "--High" , "90" -- units: % - , "--low" , "darkgreen" - , "--normal" , "darkorange" - , "--high" , "darkred" - ] 10 - - -- battery monitor - , Run Battery [ "--template" , "Batt: " - , "--Low" , "10" -- units: % - , "--High" , "80" -- units: % - , "--low" , "darkred" - , "--normal" , "darkorange" - , "--high" , "darkgreen" - - , "--" -- battery specific options - -- discharging status - , "-o" , "% ()" - -- AC "on" status - , "-O" , "Charging" - -- charged status - , "-i" , "Charged" - ] 50 - - -- time and date indicator - -- (%F = y-m-d date, %a = day of week, %T = h:m:s time) - , Run Date "%F (%a) %r" "date" 10 - - -- keyboard layout indicator - , Run Kbd [ ("us(dvorak)" , "DV") - , ("us" , "US") - ] - ] - }