From e1d415be460af9b0052adf0f3fd5f7ac736d666d Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 14 May 2015 13:42:43 +0200 Subject: Add 5clone and 5ssh aliases --- zsh/aliases.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'zsh/aliases.zsh') diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index b828a71..d2abe45 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -101,3 +101,17 @@ function 5c { cd "$HOME"/5/code fi } + +function 5clone { + if [[ -z "$1" ]]; then + print "No repo name" + fi + + (cd "$HOME"/5/code + git clone git@github.com:5m/"$1" + cd "$1" + git config --local user.email johannes@5monkeys.se + ) +} + +alias 5ssh='TERM=xterm ssh' -- cgit v1.2.3-70-g09d2 From 44975789bb1e1c5f2d60f1b50fe8b8c6b111bec9 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sun, 24 May 2015 01:34:33 +0200 Subject: zsh: aliases: add pt -> pstree --highlight-all --long --uid-changes --- zsh/aliases.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'zsh/aliases.zsh') diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index d2abe45..d88ea17 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 -- cgit v1.2.3-70-g09d2 From c75c218cead9a2be480b0f47cdb5162d876fedd8 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Fri, 10 Jul 2015 17:55:16 +0200 Subject: zsh: add aur-push/pull alias/function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- zsh/aliases.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'zsh/aliases.zsh') diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index d88ea17..ba1793b 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -117,3 +117,14 @@ function 5clone { } alias 5ssh='TERM=xterm ssh' + +aur-push() { + git push aur@aur4.archlinux.org:/"$1".git "$1":master +} + +aur-pull() { + local old_branch=$(git symbolic-ref --short HEAD) + git checkout "$1" + git pull aur@aur4.archlinux.org:/"$1".git master:"$1" + git checkout "$old_branch" +} -- cgit v1.2.3-70-g09d2 From aa87b637f2bb00187b9bcdacfe3a6bd3c20834c8 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 13 Jul 2015 23:18:38 +0200 Subject: zsh: aliases: Add tt alias --- zsh/aliases.zsh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'zsh/aliases.zsh') diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index ba1793b..0546ce4 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -128,3 +128,9 @@ aur-pull() { git pull aur@aur4.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 +} -- cgit v1.2.3-70-g09d2 From 71bf9f10e1e565fcf5a20d89ddda2181db8b97c2 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 16 Jul 2015 22:21:54 +0200 Subject: zsh: update 5 aliases/functions --- zsh/aliases.zsh | 54 +++++++++++++++++++++++++++++++++++++----------------- zsh/completion/_5c | 2 +- zsh/completion/_5v | 2 +- 3 files changed, 39 insertions(+), 19 deletions(-) (limited to 'zsh/aliases.zsh') diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 0546ce4..2f8a205 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -75,33 +75,51 @@ 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 - fi + cd "$HOME"/projects/"$1" } function 5clone { @@ -109,11 +127,13 @@ function 5clone { print "No repo name" fi - (cd "$HOME"/5/code + (cd "$HOME"/projects git clone git@github.com:5m/"$1" - cd "$1" + shift + cd -) + + pushd "$HOME"/projects/"$1" git config --local user.email johannes@5monkeys.se - ) } alias 5ssh='TERM=xterm ssh' diff --git a/zsh/completion/_5c b/zsh/completion/_5c index ca7eeac..5f309c7 100644 --- a/zsh/completion/_5c +++ b/zsh/completion/_5c @@ -1,4 +1,4 @@ #compdef 5c _arguments \ - "1: :($(print $HOME/5/code/*(/) | xargs -n1 basename))" + "1: :($(print $HOME/projects/*(/) | xargs -n1 basename))" diff --git a/zsh/completion/_5v b/zsh/completion/_5v index 3958269..659bb1a 100644 --- a/zsh/completion/_5v +++ b/zsh/completion/_5v @@ -1,4 +1,4 @@ #compdef 5v _arguments \ - "1: :($(print $HOME/5/venvs/*(/) | xargs -n1 basename))" + "1: :($(print $HOME/venvs/*(/) | xargs -n1 basename))" -- cgit v1.2.3-70-g09d2 From cd19dd64a43fd2cdfdd814f7dff3c0dcde2c260d Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 14 Sep 2015 15:48:31 +0200 Subject: zsh/aliases: Use aur. instead of aur4. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- zsh/aliases.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zsh/aliases.zsh') diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 2f8a205..ebe3481 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -139,13 +139,13 @@ function 5clone { alias 5ssh='TERM=xterm ssh' aur-push() { - git push aur@aur4.archlinux.org:/"$1".git "$1":master + 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@aur4.archlinux.org:/"$1".git master:"$1" + git pull aur@aur.archlinux.org:/"$1".git master:"$1" git checkout "$old_branch" } -- cgit v1.2.3-70-g09d2