From 47f34ca29fe00ab50bd46be09ebe30a9e0164fcb Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Fri, 16 Aug 2019 20:06:22 -0700 Subject: [PATCH] Bash files --- leave_session.laptop.sh | 2 +- root.bashrc | 38 ++++++++++++++++++++++++++++++++++++++ user.bash_aliases | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 root.bashrc create mode 100644 user.bash_aliases diff --git a/leave_session.laptop.sh b/leave_session.laptop.sh index bc607a4..73b95f0 100755 --- a/leave_session.laptop.sh +++ b/leave_session.laptop.sh @@ -7,7 +7,7 @@ # username ALL=(ALL:ALL) NOPASSWD:/usr/sbin/pm-suspend,/usr/sbin/pm-hibernate,/sbin/reboot,/sbin/shutdown # confirm() { - ans=$(echo -e "Yes\nNo" | dmenu -p "Leave session - Confirm?") + ans=$(echo -e "Yes\nNo" | dmenu -p "$1 - Confirm?") echo $ans if [ "$ans" = "Yes" ]; then echo "Leaving..." diff --git a/root.bashrc b/root.bashrc new file mode 100644 index 0000000..40a1668 --- /dev/null +++ b/root.bashrc @@ -0,0 +1,38 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +# -------------------------------- +# Shell RC +# -------------------------------- +#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;41m\]$(hostname)\[\033[00m\]\[\033[01;34m\] \w\[\033[00m\] \$ ' +PS1='${debian_chroot:+($debian_chroot)}\e[1;31m$(hostname) \e[0m\e[1;94m\w\e[0m\e[0;35m $(__git_ps1 " %s")\e[0m \e[1;31m \e[0m' + +# +# Variables +# +export EDITOR=vim +export PATH=~/bin:$PATH + +# +# Aliases +# +alias ls='ls -al --color' +alias q=exit +alias a=clear +alias h=history +alias e=$EDITOR + +# +# Functions +# +function myvim () { + gvim $1 >& /dev/null & + disown %1 +} + +function hgrep () { + history | grep $1 +} + +function pgrep () { + ps aux | grep $1 +} diff --git a/user.bash_aliases b/user.bash_aliases new file mode 100644 index 0000000..d719d68 --- /dev/null +++ b/user.bash_aliases @@ -0,0 +1,41 @@ +# -------------------------------- +# Shell RC +# -------------------------------- +export GIT_PS1_SHOWDIRTYSTATE=1 +PS1='${debian_chroot:+($debian_chroot)}\[\033[01;92m\]$(hostname)\[\033[01;34m\] \w\[\033[01;35m\]$(__git_ps1 "  %s") \[\033[0m\]$ ' + +# +# Variables +# +export EDITOR=vim +export GOPATH=~/lang/go +export PATH=~/bin:~/apps/bin:$PATH:/usr/local/go/bin:$GOPATH/bin:/opt/i3/bin + +# +# Aliases +# +alias ls='ls -altrh --color' +alias q=exit +alias a=clear +alias h=history +alias e=$EDITOR + +# +# Functions +# +function myvim () { + gvim $1 >& /dev/null & + disown %1 +} +function pyedit () { + gedit $1 >& /dev/null & + disown %1 +} + +function hgrep () { + history | grep $1 +} + +function pgrep () { + ps aux | grep $1 +}