· 6 years ago · Jan 13, 2020, 10:26 AM
1### .profile
2
3alias 2x2="terminator -m -l 2x2 &> /dev/null & ; disown"
4
5export QT_QPA_PLATFORMTHEME="qt5ct"
6export QT_AUTO_SCREEN_SCALE_FACTOR=0
7export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
8
9export EDITOR=/usr/bin/vim
10
11export GOPATH="/home/aguss787"
12# export GOROOT="/usr/local/go"
13export PATH="$PATH:/home/aguss787/arcanist/arcanist/bin"
14export PATH="$PATH:$GOPATH/bin/"
15
16export PATH=$PATH:/usr/local/go/bin
17
18
19alias yey="yay"
20
21alias migratecnx="docker-compose exec api bee migrate -driver=postgres -conn=\"postgres://postgres:mysecret@postgres/connexi-development?sslmode=disable\""
22alias migratetestcnx="docker-compose exec api bee migrate -driver=postgres -conn=\"postgres://postgres:mysecret@postgres/connexi-test?sslmode=disable\""
23alias testcnx="docker-compose exec api env CNX_ENV=test go test -coverprofile=coverage.profile -cover \$(go list ./... | grep -v -e /vendore -e /models -e /database/migrations -e tests); go tool cover -html coverage.profile -o coverage.html"
24
25alias testcnxfe="docker-compose exec frontend yarn test"
26
27alias testluckyluke="go test -cover \$(go list ./... | grep -v -e /vendor)"
28
29alias migratewvr="docker-compose exec api bee migrate -driver=postgres -conn=\"postgres://postgres:mysecret@postgres/weaver-development?sslmode=disable\""
30alias migratetestwvr="docker-compose exec api bee migrate -driver=postgres -conn=\"postgres://postgres:mysecret@postgres/weaver-test?sslmode=disable\""
31alias testwvr="docker-compose exec api env WVR_ENV=test go test -coverprofile=coverage.profile -cover \$(go list ./... | grep -v -e /vendore -e /models -e /database/migrations -e tests); go tool cover -html coverage.profile -o coverage.html"
32alias testtuai="docker-compose exec backend env TUAI_ENV=test go test -coverprofile=coverage.profile -cover \$(go list ./... | grep -v -e /vendore -e /models -e /database/migrations -e tests); go tool cover -html coverage.profile -o coverage.html"
33
34alias batt="optimus-manager --switch intel --no-confirm"
35alias power="optimus-manager --switch nvidia --no-confirm"
36
37alias ghcids='ghcid "--command=stack ghci $1"'
38
39export STEAM_COMPAT_DATA_PATH=$HOME/proton
40
41### .bashrc
42# Set colorful PS1 only on colorful terminals.
43# dircolors --print-database uses its own built-in database
44# instead of using /etc/DIR_COLORS. Try to use the external file
45# first to take advantage of user additions. Use internal bash
46# globbing instead of external grep binary.
47safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
48match_lhs=""
49[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
50[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
51[[ -z ${match_lhs} ]] \
52 && type -P dircolors >/dev/null \
53 && match_lhs=$(dircolors --print-database)
54[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
55
56if ${use_color} ; then
57 # Enable colors for ls, etc. Prefer ~/.dir_colors #64489
58 if type -P dircolors >/dev/null ; then
59 if [[ -f ~/.dir_colors ]] ; then
60 eval $(dircolors -b ~/.dir_colors)
61 elif [[ -f /etc/DIR_COLORS ]] ; then
62 eval $(dircolors -b /etc/DIR_COLORS)
63 fi
64 fi
65
66 if [[ ${EUID} == 0 ]] ; then
67 PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] '
68 else
69 PS1='\[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\] '
70 fi
71
72 alias ls='ls --color=auto'
73 alias grep='grep --colour=auto'
74 alias egrep='egrep --colour=auto'
75 alias fgrep='fgrep --colour=auto'
76else
77 if [[ ${EUID} == 0 ]] ; then
78 # show root@ when we don't have colors
79 PS1='\u@\h \W \$ '
80 else
81 PS1='\u@\h \w \$ '
82 fi
83fi
84
85unset use_color safe_term match_lhs sh
86
87alias cp="cp -i" # confirm before overwriting something
88alias df='df -h' # human-readable sizes
89alias free='free -m' # show sizes in MB
90alias np='nano -w PKGBUILD'
91alias more=less
92
93xhost +local:root > /dev/null 2>&1
94
95complete -cf sudo
96
97# Bash won't get SIGWINCH if another process is in the foreground.
98# Enable checkwinsize so that bash will check the terminal size when
99# it regains control. #65623
100# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
101shopt -s checkwinsize
102
103shopt -s expand_aliases
104
105# export QT_SELECT=4
106
107# Enable history appending instead of overwriting. #139609
108shopt -s histappend
109
110#
111# # ex - archive extractor
112# # usage: ex <file>
113ex ()
114{
115 if [ -f $1 ] ; then
116 case $1 in
117 *.tar.bz2) tar xjf $1 ;;
118 *.tar.gz) tar xzf $1 ;;
119 *.bz2) bunzip2 $1 ;;
120 *.rar) unrar x $1 ;;
121 *.gz) gunzip $1 ;;
122 *.tar) tar xf $1 ;;
123 *.tbz2) tar xjf $1 ;;
124 *.tgz) tar xzf $1 ;;
125 *.zip) unzip $1 ;;
126 *.Z) uncompress $1;;
127 *.7z) 7z x $1 ;;
128 *) echo "'$1' cannot be extracted via ex()" ;;
129 esac
130 else
131 echo "'$1' is not a valid file"
132 fi
133}
134
135# better yaourt colors
136export YAOURT_COLORS="nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35"
137
138source ~/.profile
139
140### .zshrc
141
142# see 'man strftime' for details.
143# HIST_STAMPS="mm/dd/yyyy"
144
145# Would you like to use another custom folder than $ZSH/custom?
146# ZSH_CUSTOM=/path/to/new-custom-folder
147
148# Which plugins would you like to load?
149# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
150# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
151# Example format: plugins=(rails git textmate ruby lighthouse)
152# Add wisely, as too many plugins slow down shell startup.
153plugins=(
154 zsh-autosuggestions
155 zsh-syntax-highlighting
156 git
157 docker
158 archlinux
159 chucknorris
160 git-auto-fetch
161 kubectl
162 vscode
163 gitfast
164)
165
166source $ZSH/oh-my-zsh.sh
167
168# User configuration
169
170# export MANPATH="/usr/local/man:$MANPATH"
171
172# You may need to manually set your language environment
173# export LANG=en_US.UTF-8
174
175# Preferred editor for local and remote sessions
176# if [[ -n $SSH_CONNECTION ]]; then
177# export EDITOR='vim'
178# else
179# export EDITOR='mvim'
180# fi
181
182# Compilation flags
183# export ARCHFLAGS="-arch x86_64"
184
185# Set personal aliases, overriding those provided by oh-my-zsh libs,
186# plugins, and themes. Aliases can be placed here, though oh-my-zsh
187# users are encouraged to define aliases within the ZSH_CUSTOM folder.
188# For a full list of active aliases, run `alias`.
189#
190# Example aliases
191# alias zshconfig="mate ~/.zshrc"
192# alias ohmyzsh="mate ~/.oh-my-zsh"
193
194source ~/.profile
195
196zstyle ':completion:*:*:git:*' script ~/Scripts/git-completion/git-completion.bash
197fpath=(~/Scripts/git-completion/ $fpath)
198
199autoload -Uz compinit && compinit
200
201# i3
202# i3 config file (v4)
203#
204# Please see https://i3wm.org/docs/userguide.html for a complete reference!
205#
206# This config file uses keycodes (bindsym) and was written for the QWERTY
207# layout.
208#
209# To get a config file with the same key positions, but for your current
210# layout, use the i3-config-wizard
211#
212
213# Font for window titles. Will also be used by the bar unless a different font
214# is used in the bar {} block below.
215font pango:monospace 8
216
217# This font is widely installed, provides lots of unicode glyphs, right-to-left
218# text rendering and scalability on retina/hidpi displays (thanks to pango).
219#font pango:DejaVu Sans Mono 8
220
221# The combination of xss-lock, nm-applet and pactl is a popular choice, so
222# they are included here as an example. Modify as you see fit.
223
224# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
225# screen before suspend. Use loginctl lock-session to lock your screen.
226exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
227
228# NetworkManager is the most popular way to manage wireless networks on Linux,
229# and nm-applet is a desktop environment-independent system tray GUI for it.
230exec --no-startup-id nm-applet
231
232exec --no-startup-id xcompmgr -c -f -n
233
234# Use pactl to adjust volume in PulseAudio.
235set $refresh_i3status killall -SIGUSR1 py3status
236bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
237bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
238bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
239bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
240
241# Set wallpaper file
242set $wallpaper ~/Pictures/wallpaper/arch.png
243
244# use these keys for focus, movement, and resize directions when reaching for
245# the arrows is not convenient
246set $up k
247set $down j
248set $left h
249set $right l
250
251# use Mouse+Mod4 to drag floating windows to their wanted position
252floating_modifier Mod4
253
254# start a terminal
255bindsym Mod4+Return exec konsole
256
257# kill focused window
258bindsym Mod4+Shift+q kill
259
260# start dmenu (a program launcher)
261bindsym Mod4+d exec dmenu_run
262# There also is the (new) i3-dmenu-desktop which only displays applications
263# shipping a .desktop file. It is a wrapper around dmenu, so you need that
264# installed.
265# bindsym Mod4+d exec --no-startup-id i3-dmenu-desktop
266
267# change focus
268bindsym Mod4+$left focus left
269bindsym Mod4+$down focus down
270bindsym Mod4+$up focus up
271bindsym Mod4+$right focus right
272
273# alternatively, you can use the cursor keys:
274bindsym Mod4+Left focus left
275bindsym Mod4+Down focus down
276bindsym Mod4+Up focus up
277bindsym Mod4+Right focus right
278
279# move focused window
280bindsym Mod4+Shift+$left move left
281bindsym Mod4+Shift+$down move down
282bindsym Mod4+Shift+$up move up
283bindsym Mod4+Shift+$right move right
284
285# alternatively, you can use the cursor keys:
286bindsym Mod4+Shift+Left move left
287bindsym Mod4+Shift+Down move down
288bindsym Mod4+Shift+Up move up
289bindsym Mod4+Shift+Right move right
290
291# split in horizontal orientation
292# bindsym Mod4+h split h
293bindsym Mod4+Shift+v split h
294
295# split in vertical orientation
296bindsym Mod4+v split v
297
298# enter fullscreen mode for the focused container
299bindsym Mod4+f fullscreen toggle
300
301# change container layout (stacked, tabbed, toggle split)
302bindsym Mod4+s layout stacking
303bindsym Mod4+w layout tabbed
304bindsym Mod4+e layout toggle split
305
306# toggle tiling / floating
307bindsym Mod4+Shift+space floating toggle
308
309# change focus between tiling / floating windows
310bindsym Mod4+space focus mode_toggle
311
312# focus the parent container
313bindsym Mod4+a focus parent
314
315# focus the child container
316#bindsym Mod4+d focus child
317
318# move the currently focused window to the scratchpad
319bindsym Mod4+Shift+minus move scratchpad
320
321# Show the next scratchpad window or hide the focused scratchpad window.
322# If there are multiple scratchpad windows, this command cycles through them.
323bindsym Mod4+minus scratchpad show
324
325# Define names for default workspaces for which we configure key bindings later on.
326# We use variables to avoid repeating the names in multiple places.
327set $ws1 "1"
328set $ws2 "2"
329set $ws3 "3"
330set $ws4 "4"
331set $ws5 "5"
332set $ws6 "6"
333set $ws7 "7"
334set $ws8 "8"
335set $ws9 "9"
336set $ws10 "10"
337
338# switch to workspace
339bindsym Mod4+1 workspace number $ws1
340bindsym Mod4+2 workspace number $ws2
341bindsym Mod4+3 workspace number $ws3
342bindsym Mod4+4 workspace number $ws4
343bindsym Mod4+5 workspace number $ws5
344bindsym Mod4+6 workspace number $ws6
345bindsym Mod4+7 workspace number $ws7
346bindsym Mod4+8 workspace number $ws8
347bindsym Mod4+9 workspace number $ws9
348bindsym Mod4+0 workspace number $ws10
349
350# move focused container to workspace
351bindsym Mod4+Shift+1 move container to workspace number $ws1
352bindsym Mod4+Shift+2 move container to workspace number $ws2
353bindsym Mod4+Shift+3 move container to workspace number $ws3
354bindsym Mod4+Shift+4 move container to workspace number $ws4
355bindsym Mod4+Shift+5 move container to workspace number $ws5
356bindsym Mod4+Shift+6 move container to workspace number $ws6
357bindsym Mod4+Shift+7 move container to workspace number $ws7
358bindsym Mod4+Shift+8 move container to workspace number $ws8
359bindsym Mod4+Shift+9 move container to workspace number $ws9
360bindsym Mod4+Shift+0 move container to workspace number $ws10
361
362# reload the configuration file
363bindsym Mod4+Shift+r reload
364# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
365bindsym Mod4+Shift+c restart
366# exit i3 (logs you out of your X session)
367# bindsym Mod4+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
368bindsym Mod4+Shift+End exec i3-msg exit
369
370# Lock screen
371bindsym Mod4+Shift+p exec i3lock -t -i $wallpaper
372
373# resize window (you can also use the mouse for that)
374mode "resize" {
375 # These bindings trigger as soon as you enter the resize mode
376
377 # Pressing left will shrink the window’s width.
378 # Pressing right will grow the window’s width.
379 # Pressing up will shrink the window’s height.
380 # Pressing down will grow the window’s height.
381 bindsym $left resize shrink width 10 px or 10 ppt
382 bindsym $down resize grow height 10 px or 10 ppt
383 bindsym $up resize shrink height 10 px or 10 ppt
384 bindsym $right resize grow width 10 px or 10 ppt
385
386 # same bindings, but for the arrow keys
387 bindsym Left resize shrink width 10 px or 10 ppt
388 bindsym Down resize grow height 10 px or 10 ppt
389 bindsym Up resize shrink height 10 px or 10 ppt
390 bindsym Right resize grow width 10 px or 10 ppt
391
392 # back to normal: Enter or Escape or Mod4+r
393 bindsym Return mode "default"
394 bindsym Escape mode "default"
395 bindsym Mod4+r mode "default"
396}
397
398bindsym Mod4+r mode "resize"
399
400# move focused workspacce between monitors
401bindsym Mod4+Shift+greater move workspace to output right
402bindsym Mod4+Shift+less move workspace to output left
403
404# Screenshot
405bindsym Print exec gnome-screenshot -i
406
407# Start i3bar to display a workspace bar (plus the system information i3status
408# finds out, if available)
409bar {
410 status_command py3status
411 # status_command i3status
412 # status_command ~/Scripts/gpu-stat.sh
413}
414
415# Change wallpaper
416exec feh --bg-fill $wallpaper
417
418# Exec randr on login
419exec autorandr --change