From 5cad599fb277e05e2c1204477413fdb494daa2c3 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Wed, 11 Mar 2020 12:56:06 +0000 Subject: [PATCH] Shell config changes --- shells/bash/completions/hydra.bash | 32 +++++++++++++++++++ shells/shared/aliases | 2 ++ .../shared/{profile => environmentVariables} | 24 ++++++++++++-- shells/shared/functions | 2 +- shells/zsh/includes/promptconfig.zsh | 2 +- 5 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 shells/bash/completions/hydra.bash rename shells/shared/{profile => environmentVariables} (52%) diff --git a/shells/bash/completions/hydra.bash b/shells/bash/completions/hydra.bash new file mode 100644 index 00000000..00ff724c --- /dev/null +++ b/shells/bash/completions/hydra.bash @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +__hydra_complete(){ + local toAdd="" + #if [ -n "${COMP_WORDS[COMP_CWORD]}" ]; then + # toAdd=" " + # prevArgNo="$COMP_CWORD" + #else + # prevArgNo="$(($COMP_CWORD - 1))" + #fi + + local curr="${COMP_WORDS[COMP_CWORD]}" + local prev="${COMP_WORDS[COMP_CWORD-1]}" + local services="adam6500 asterisk afp cisco cisco-enable cvs firebird ftp ftps http-head http-get http-post http-get-form http-post-form http-proxy http-proxy-urlenum icq imap irc ldap2 ldap3 ldap3-crammd5 ldap3-digestmd5 mssql mysql nntp oracle-listener oracle-sid pcanywhere pcnfs pop3 postgres radmin2 redis rexec rlogin rpcap rsh rtsp s7-300 sip smb smtp smtp-enum snmp socks5 ssh sshkey svn teamspeak telnet vmauthd vnc xmpp" + + case "$prev" in + -L|-P|-C|-M) + COMPREPLY=($(compgen -A file -- "$curr")) + ;; + -l|-p|-t|-h) + COMPREPLY=() + ;; + -U) + COMPREPLY=($(compgen -W "$services" -- "$curr")) + ;; + *) + COMPREPLY=($(compgen -W "-l -L -p -P -C -M -t -U -h" -- "$curr")) + ;; + esac +} + +complete -F __hydra_complete hydra diff --git a/shells/shared/aliases b/shells/shared/aliases index 2a15b154..c6376209 100644 --- a/shells/shared/aliases +++ b/shells/shared/aliases @@ -200,3 +200,5 @@ alias chrome-curl="node $HOME/GitRepos/chrome-curl/index.js" #alias irmgpg="gpg --no-default-keyring --keyring=irm.gpg" alias irmgpg="gpg --options ~/.gnupg/irmgpg.conf --keyring=irm.gpg" + +alias weakopenssl="$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl" diff --git a/shells/shared/profile b/shells/shared/environmentVariables similarity index 52% rename from shells/shared/profile rename to shells/shared/environmentVariables index 7ba80bd5..118e325b 100644 --- a/shells/shared/profile +++ b/shells/shared/environmentVariables @@ -3,7 +3,7 @@ export TERMINAL=/usr/local/bin/st export TERM=xterm-256color export EDITOR='vim' export READER='zathura' -export CDPATH=.:~:~/Projects +export CDPATH=.:~:~/Projects:~/.dotfiles #Adds a list of all the sub directories in my .bin folder to a variable called mypath mypath="$HOME/.bin" @@ -21,4 +21,24 @@ export PATH=$PATH:$GEM_HOME/bin export GEM_HOME=$(ruby -e 'print Gem.user_dir') -#echo -e "Please don't sabotage my computer while I'm away \n\nTo turn on the print server, run the command 'cups'" | /usr/bin/cowsay -f tux -W 80 +export LESS_TERMCAP_mb=$'\e[1;36m' +export LESS_TERMCAP_md=$'\e[1;36m' +export LESS_TERMCAP_me=$'\e[0m' +export LESS_TERMCAP_se=$'\e[0m' +export LESS_TERMCAP_so=$'\e[1;40;92m' +export LESS_TERMCAP_ue=$'\e[0m' +export LESS_TERMCAP_us=$'\e[1;32m' + +export DOTFILES="$HOME/.dotfiles" + +if [ -n "$GTK_MODULES" ] +then + export GTK_MODULES="$GTK_MODULES:unity-gtk-module" +else + export GTK_MODULES="unity-gtk-module" +fi + +if [ -z "$UBUNTU_MENUPROXY" ] +then + export UBUNTU_MENUPROXY=1 +fi diff --git a/shells/shared/functions b/shells/shared/functions index fb814022..89132e01 100644 --- a/shells/shared/functions +++ b/shells/shared/functions @@ -303,7 +303,7 @@ function man(){ $MAN "$@" return $? else - $MAN -k . | fzf --reverse --preview="echo {1,2} | sed 's/ (/./' | sed -E 's/\)\s*$//' | xargs $MAN" | awk '{print $1 "." $2}' | tr -d '()' | xargs -r "$MAN" + $MAN -k . | fzf --reverse --preview="echo {1,2} | sed 's/ (/./' | sed -E 's/\)\s*$//' | xargs $MAN" | awk '{print $1 "." $2}' | tr -d '()' | xargs -r $MAN return $? fi } diff --git a/shells/zsh/includes/promptconfig.zsh b/shells/zsh/includes/promptconfig.zsh index 2b06ce71..513c3b84 100644 --- a/shells/zsh/includes/promptconfig.zsh +++ b/shells/zsh/includes/promptconfig.zsh @@ -116,7 +116,7 @@ prompt_git(){ local branch="$(git branch --show-current 2> /dev/null)" local color="green" local ret="" - if [ -n "branch" ]; then + if [ -n "$branch" ]; then ret="$branch" local repoTopLevel="$(command git rev-parse --show-toplevel 2> /dev/null)" local untrackedFiles=$(command git ls-files --others --exclude-standard "${repoTopLevel}" 2> /dev/null)