-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bashrc
151 lines (128 loc) · 5.01 KB
/
.bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# for java applications
export AWT_TOOLKIT=MToolkit
# git status in prompt
red='\e[0;31m'
RED='\e[1;31m'
green='\e[0;32m'
GREEN='\e[1;32m'
yellow='\e[0;33m'
YELLOW='\e[1;33m'
blue='\e[0;34m'
BLUE='\e[1;34m'
magenta='\e[0;35m'
MAGENTA='\e[1;35m'
cyan='\e[0;36m'
CYAN='\e[1;36m'
NC='\e[0m' # No Color
# Taken from http://www.opinionatedprogrammer.com/2011/01/colorful-bash-prompt-reflecting-git-status/
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=$GREEN
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=$RED
else
local ansi=$YELLOW
fi
if [[ "$git_status" =~ On\ branch\ ([^[:space:]]+) ]]; then
branch=${BASH_REMATCH[1]}
#test "$branch" != master || branch=' '
else
# Detached HEAD. (branch=HEAD is a faster alternative.)
branch="(`git describe --all --contains --abbrev=4 HEAD 2> /dev/null ||
echo HEAD`)"
fi
echo -n '[ \['"$ansi"'\]'"$branch"'\[\e[0m\] ]'
fi
}
function report_status() {
RET_CODE=$?
if [[ $RET_CODE -ne 0 ]] ; then
echo -ne "[\[$RED\]$RET_CODE\[$NC\]]"
fi
}
# export _PS1="\[$NC\][\u@\h \W]"
# export PS2="\[$NC\]> "
# powerline
# PS1='[\u@\h \W]\$ '
export _PS1="\e[0;35m[\e[0m \e[2;36m\u\e[0m:\e[1;32m\W\e[0m \e[0;35m]\e[0m "
PS2=">>"
export PROMPT_COMMAND='_status=$(report_status);export PS1="${_PS1} $(_git_prompt)${_status} \e[1;31m\$\e[0m :-\n>>";unset _status;'
# Use bash-completion, if available
[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
. /usr/share/bash-completion/bash_completion
# cod completion
source <(cod init $$ bash)
# git completions
. /usr/share/git/completion/git-completion.bash
# for bspwm
export XDG_CONFIG_HOME="$HOME/.config"
# export ROFI_THEME=~/.config/rofi/themes/dracula.rasi
export EDITOR='emacsclient -c -a ""'
# export TERMINAL="mlterm --fontsize=$((GDK_SCALE*15))"
export TERMINAL="konsole"
export RTV_EDITOR='emacsclient -c -a ""'
# my scripts and flutter executables
export PATH=$PATH:$HOME/.local/bin
export PATH=$HOME/.local/bin/flutter/bin:$PATH
export PATH=$HOME/.local/bin/flutter/bin/cache/dart-sdk/bin:$PATH
export PATH=$HOME/.pub-cache/bin/:$PATH
export PATH=$HOME/.config/bspwm/scripts/:$PATH
export NODE_PATH=$NODE_PATH:$(npm root -g)
alias radiogolha='cvlc mms://www.radiogolha.net/RadioGolha'
alias ar5="aria2c -c -V -s 5 --max-connection-per-server=5 --on-download-complete=ding.sh"
alias ls='ls --color=auto --hyperlink=always'
alias resrvserv='mosh yusuf@10.127.188.92'
alias mediacenter='mosh yusuf@192.168.1.110'
alias worklaptop='mosh archie-work@192.168.1.6'
alias android-emulator='~/Android/Sdk/emulator/emulator @Pixel_3_API_28'
alias ec='emacsclient -a "" -c'
alias all_cams_low='mpv $(cat Documents/Security-Cams/cam4.strm) & mpv $(cat Documents/Security-Cams/cam1.strm) & mpv $(cat Documents/Security-Cams/cam2.strm)'
alias all_cams_high='mpv $(cat Documents/Security-Cams_high/cam4.strm) & mpv $(cat Documents/Security-Cams_high/cam1.strm) & mpv $(cat Documents/Security-Cams_high/cam2.strm)'
alias gst='git status'
alias gd='git diff'
alias two_min_pen='for i in {0..120}; do printf "%03d\r" $i; sleep 1; done;mplayer /usr/share/games/xboard/sounds/penalty.wav'
alias pacman='sudo pacman --color=always'
alias hcat="highlight -O ansi --force"
alias gamescrcpy="prime-run scrcpy --max-fps 20 -w -S --disable-screensaver"
alias eclrun='WINEPREFIX=~/.wine32 WINEARCH=win32 wine ~/.wine32/drive_c/ecl/macros/eclrun.exe'
alias adb_input="adb shell input keyevent"
alias youtube_pip='mpv --slang=en --force-window=immediate --no-terminal --geometry=25%x25%-0-0 --autofit=1280x720 --ytdl-format="bestvideo[height<=?720][fps<=?30]+bestaudio/best" --x11-name=qutebrowser-youtube --ytdl-raw-options=mark-watched=,cookies="~/Downloads/cookies.txt",embed-subs=,sub-lang=en,write-sub=,write-auto-sub='
# vi mode in bash
set -o vi
if [ -z "$GDK_SCALE" ]; then
export GDK_SCALE=1
fi
alias android='xrandr --output eDP-1 --mode 1920x1080; genymotion-player --vm-name "Custom Phone - 8.0 - API 26 - 768x1280"; xrandr --output eDP-1 --mode 3840x2160'
# infinite history and erase duplicates
export HISTTIMEFORMAT="%d/%m/%y %T "
HISTSIZE=
HISTFILESIZE=
HISTCONTROL=erasedups
# Supposedly text should wrap as the terminal size changes
shopt -s checkwinsize
# change to a dir by typing its name or path
shopt -s autocd
# Powerline prompt
# powerline-daemon -q
# POWERLINE_BASH_CONTINUATION=1
# POWERLINE_BASH_SELECT=1
# . /usr/lib/python3.9/site-packages/powerline/bindings/bash/powerline.sh
if xset q &>/dev/null; then
# screenfetch | lolcat
cowsay -f tux $(fortune) | lolcat -p 1
fi
# if [ "$(tty)" = "/dev/tty1" ]; then
# exec sway --my-next-gpu-wont-be-nvidia
# exec qtile
# fi
if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
exec startx
fi
# source ~/.local/share/blesh/ble.sh