Bash files

This commit is contained in:
Mahesh Asolkar 2019-08-16 20:06:22 -07:00
parent f2602d913b
commit 47f34ca29f
3 changed files with 80 additions and 1 deletions

View File

@ -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..."

38
root.bashrc Normal file
View File

@ -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
}

41
user.bash_aliases Normal file
View File

@ -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
}