diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2016-01-14 16:46:21 +0000 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2016-01-14 16:46:21 +0000 |
commit | 7666a9cc93c079cd3a61ea8a7d4cf3103a74c56e (patch) | |
tree | e1e1b32e1666bead6a6ac7327bd2e253e989e80e /zsh/aliases.zsh | |
parent | cee153e1d03f215139ba6d74a8cd8fe039213992 (diff) | |
parent | 81873932548d4dda5345c19c3a635d53e25da061 (diff) | |
download | dotfiles-7666a9cc93c079cd3a61ea8a7d4cf3103a74c56e.tar.xz |
Merge remote-tracking branch 'k-kyrias/master' into theos
Diffstat (limited to 'zsh/aliases.zsh')
-rw-r--r-- | zsh/aliases.zsh | 79 |
1 files changed, 66 insertions, 13 deletions
diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index b828a71..ebe3481 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -24,6 +24,8 @@ alias ms5='mbsync --config "$XDG_CONFIG_HOME/mbsyncrc" 5monkeys' alias msa='mbsync --config "$XDG_CONFIG_HOME/mbsyncrc" -a' alias ty='ttytter -rc="$XDG_CONFIG_HOME"/ttytter/ttytterrc' +alias pt='pstree --highlight-all --long --uid-changes' + alias sprin='curl -F "sprunge=<-" http://sprunge.us' sprfile() { curl -F "sprunge=<$1" http://sprunge.us @@ -73,31 +75,82 @@ if have systemctl && [[ -d /run/systemd/system ]]; then fi function 5v { - if [[ -d "$HOME"/5/venvs/"$1" ]]; then - source "$HOME"/5/venvs/"$1"/bin/activate + if [[ -d "$HOME"/venvs/"$1" ]]; then + source "$HOME"/venvs/"$1"/bin/activate printf "\x1b[38;5;2m==> 5venv ‘%s’ activated successfully.\x1b[0m\n" "$1" + else printf "==> 5venv ‘%s’ not found\n" "$1" printf "==> Create? [yN]: " read yn + if [[ "$yn" == 'y' || "$yn" == 'yes' ]]; then - virtualenv-2.7 "$HOME"/5/venvs/"$1" - if (( $? == 0 )); then - print "\x1b[38;5;2m==> 5venv created successfully, installing basic requirements.\x1b[0m" + printf "==> Python version? [23]: " + read venvver + + if [[ "$venvver" == '2' ]]; then + virtualenv2 "$HOME"/venvs/"$1" + if (( $? == 0 )); then + print "\x1b[38;5;2m==> 5venv created successfully, installing basic requirements.\x1b[0m" + else + print "\x1b[38;5;1m==> Error: 5env creation failed. Exiting.\x1b[0m" + return 1 + fi + source "$HOME"/venvs/"$1"/bin/activate + pip install -r "$HOME"/venvs/5_requirements.txt + + elif [[ "$venvver" == '3' ]]; then + virtualenv3 "$HOME"/venvs/"$1" + if (( $? == 0 )); then + print "\x1b[38;5;2m==> 5venv created successfully, activating environment.\x1b[0m" + print "==> Note that no requirements were installed due to version 3 was selected." + else + print "\x1b[38;5;1m==> Error: 5env creation failed. Exiting.\x1b[0m" + return 1 + fi + source "$HOME"/venvs/"$1"/bin/activate + else - print "\x1b[38;5;1m==> Error: 5env creation failed. Exiting.\x1b[0m" - return 1 + printf "==> virtualenv for version ‘%s’ not found.\n" "$venvver" + exit 1 fi - source "$HOME"/5/venvs/"$1"/bin/activate - pip install -r "$HOME"/5/venvs/5_requirements.txt fi fi } function 5c { - if [[ -n "$1" ]]; then - cd "$HOME"/5/code/"$1" - else - cd "$HOME"/5/code + cd "$HOME"/projects/"$1" +} + +function 5clone { + if [[ -z "$1" ]]; then + print "No repo name" + fi + + (cd "$HOME"/projects + git clone git@github.com:5m/"$1" + shift + cd -) + + pushd "$HOME"/projects/"$1" + git config --local user.email johannes@5monkeys.se +} + +alias 5ssh='TERM=xterm ssh' + +aur-push() { + git push aur@aur.archlinux.org:/"$1".git "$1":master +} + +aur-pull() { + local old_branch=$(git symbolic-ref --short HEAD) + git checkout "$1" + git pull aur@aur.archlinux.org:/"$1".git master:"$1" + git checkout "$old_branch" +} + +tt() { + if [[ -n "$@" ]]; then + print "$@" | ts '[%Y-%m-%d %H:%M:%S]' >> "$HOME"/documents/timetracking fi } |