Last active
December 4, 2016 01:12
-
-
Save AstraLuma/33d5e61cdb1db435526b01ad140f14fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os.path | |
| import sys | |
| $PROJECT_DIRS = [os.path.expanduser('~/code'), os.path.expanduser('~/src')] | |
| $SHELL_TYPE = 'best' # Work-around for #1561 | |
| $XONSH_SHOW_TRACEBACK = True | |
| xontrib load prompt_ret_code pacman_tabcomplete vox_tabcomplete vox | |
| xontrib load avox z | |
| $LS_COLORS='rs=0:di=01;36:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:' | |
| $EDITOR="nano" | |
| $VISUAL="nano" | |
| $SUPPRESS_BRANCH_TIMEOUT_MESSAGE = True | |
| $AUTO_PUSHD = True | |
| $PATH.insert(0, os.path.expanduser('~/.gem/ruby/2.3.0/bin')) | |
| $PATH.insert(0, os.path.expanduser('/usr/local/heroku/bin')) | |
| import xonsh.tools | |
| $FORMATTER_DICT['prompt_end'] = '\N{BLOWFISH}' if xonsh.tools.is_superuser() else '\N{SPIRAL SHELL}' | |
| del xonsh | |
| aliases['reloadx'] = lambda a, s=None: [execx(open(xrc).read()) for xrc in $XONSHRC if os.path.exists(xrc)].clear() # The clear() is really just to return None | |
| $PROMPT = '{env_name:{} }{BOLD_BLUE}{cwd}{branch_color}{curr_branch: {}}{NO_COLOR} {ret_code_color}{ret_code}{WHITE}{prompt_end}{NO_COLOR} ' | |
| if sys.getfilesystemencoding() == 'utf-8': | |
| $TITLE = '\N{SPIRAL SHELL} {current_job:{}:}{cwd}' | |
| aliases['update-arch'] = ["pacaur", "-Syu"] | |
| $PKG_CONFIG_PATH = ["/usr/lib/pkgconfig", "/usr/share/pkgconfig", "/usr/local/lib/pkgconfig", "/usr/local/share/pkgconfig"] | |
| aliases['governor-get'] = ["sudo", "cpupower", "frequency-info", "-m"] | |
| aliases['governor-set'] = ["sudo", "cpupower", "frequency-set", "-g"] | |
| aliases['governor-list'] = ["sudo", "cpupower", "frequency-info", "-g"] | |
| def _steamfix(a, s=None): | |
| # find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" -o -name "libgpg-error.so*" \) -print -delete | |
| # find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" -o -name "libgpg-error.so*" \) -print -delete | |
| import glob, os.path | |
| steamroots = map(os.path.expanduser, ['~/.steam/root', '~/.local/share/Steam']) | |
| patterns = ["libgcc_s.so*", "libstdc++.so*", "libxcb.so*", "libgpg-error.so*"] | |
| for r in steamroots: | |
| for p in patterns: | |
| for fn in glob.glob(os.path.join(r, '**', p), recursive=True): | |
| print(fn) | |
| os.unlink(fn) | |
| aliases['steam-fix'] = _steamfix | |
| def _gitfix(a, s=None): | |
| if !(pidof git): | |
| return "", "Git is currently running; cowardly refusing\n", 1 | |
| elif not os.path.exists('.git/index.lock'): | |
| return "", "No fixing required\n" | |
| else: | |
| ![rm .git/index.lock] | |
| aliases['fixgit'] = _gitfix | |
| fortune -s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment