all repos

dotfiles @ 5374db696af5e81d8a92e2cce0163718f943b049

i use rach linux btw
11 files changed, 137 insertions(+), 33 deletions(-)
Update i3(add i3blocks), bspwm, nvim, tmux, ranger, zsh
Author: Smirnov Olexandr ss2316544@gmail.com
Committed at: 2021-02-23 10:57:25 +0200
Parent: 53d009b
M config/bspwm/bspwmrc
···
                46
                46
                 bspc rule -a '*:nvim'              desktop='^3' focus=on   follow=on

              
                47
                47
                 bspc rule -a '*:ranger'            desktop='^4' focus=on   follow=off

              
                48
                48
                 bspc rule -a Thunar                desktop='^4' focus=on   follow=off

              
                49
                
                -bspc rule -a Joplin                desktop='^5' focus=on   follow=off

              
                50
                
                -bspc rule -a discord               desktop='^6' focus=on   follow=off

              
                
                49
                +bspc rule -a Joplin                desktop='^5' focus=on   follow=on

              
                
                50
                +bspc rule -a Simplenote            desktop='^5' focus=on   follow=on

              
                
                51
                +bspc rule -a discord               desktop='^6' focus=off  follow=off

              
                51
                52
                 bspc rule -a telegram-desktop      desktop='^6' focus=off  follow=off

              
                52
                53
                 bspc rule -a KeePassXC             desktop='^7' focus=on   follow=off

              
                53
                54
                 bspc rule -a Spotify               desktop='^9' focus=on   follow=on

              
M config/bspwm/polybar
···
                21
                21
                 wm-restack = bspwm

              
                22
                22
                 font-0 = Iosevka Nerd Font:style=Medium:size=8;3

              
                23
                23
                 font-1 = FontAwesome5Free:style=Solid:size=7.5;2.5

              
                24
                
                -modules-left = bspwm

              
                25
                
                -modules-center = windowname

              
                26
                
                -modules-right = keyboard pulseaudio weather wifi-signal archupd time

              
                
                24
                +modules-left = bspwm windowname

              
                
                25
                +modules-center = time date weather

              
                
                26
                +modules-right = keyboard pulseaudio  archupd wifi-signal

              
                27
                27
                 tray-position = right

              
                28
                28
                 tray-padding = 0

              
                29
                29
                 

              ···
                74
                74
                 [module/keyboard]

              
                75
                75
                 type = internal/xkeyboard

              
                76
                76
                 format-prefix = ""

              
                77
                
                -label-layout =  %layout%

              
                
                77
                +label-layout = %layout%

              
                78
                78
                 blacklist-0 = num lock

              
                79
                79
                 blacklist-1 = scroll lock

              
                80
                80
                 blacklist-2= caps lock

              ···
                93
                93
                 [module/windowname]

              
                94
                94
                 type = internal/xwindow

              
                95
                95
                 label = %title%

              
                96
                
                -label-maxlen = 90

              
                
                96
                +label-maxlen = 50

              
                97
                97
                 

              
                98
                98
                 [module/date]

              
                99
                99
                 type = internal/date

              
                100
                100
                 interval = 600

              
                101
                
                -date = %d.%m.%Y

              
                
                101
                +date = %d.%m

              
                102
                102
                 label =  %date%

              
                103
                103
                 

              
                104
                104
                 [module/time]

              
M config/i3/config
···
                17
                17
                 

              
                18
                18
                 ############ Variables ###########

              
                19
                19
                 set $terminal alacritty

              
                20
                
                -set $browser firefox

              
                
                20
                +set $browser google-chrome-stable

              
                21
                21
                 set $filemanager alacritty --title=ranger -e ranger

              
                22
                22
                 set $codeeditor alacritty --title=nvim -e nvim

              
                23
                23
                 set $guicode code

              ···
                73
                73
                 bindsym $mod+Shift+f exec $filemanager

              
                74
                74
                 bindsym $mod+Shift+e exec $codeeditor

              
                75
                75
                 bindsym $mod+Shift+c exec $guicode

              
                76
                
                -bindsym $mod+Shift+d exec $documentationreader

              
                77
                76
                 

              
                78
                77
                 # Sceenshot

              
                79
                78
                 bindsym --release Print exec scrot -s /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png

              ···
                88
                87
                 bindsym $mod+Shift+minus exec "amixer sset Master toggle"

              
                89
                88
                 

              
                90
                89
                 ######### Window preferens ########

              
                91
                
                -assign [class="Alacritty"] $ws1

              
                92
                
                -assign [class="(?i)firefox"] $ws2

              
                
                90
                +assign [class="(?i)alacritty|kitty"] $ws1

              
                
                91
                +assign [class="(?i)firefox|google-chorome-stable"] $ws2

              
                93
                92
                 assign [class="(?i)code|vscodium|subl"] $ws3

              
                94
                93
                 assign [title="nvim"] $ws3

              
                95
                94
                 assign [class="(?!)thunar"] $ws4

              ···
                164
                163
                 

              
                165
                164
                 ############### Bar ###############

              
                166
                165
                 bar {

              
                167
                
                -    status_command i3status-rs ~/.config/i3/i3status-rs.toml

              
                
                166
                +    #status_command i3status -c ~/.config/i3/i3status

              
                
                167
                +    status_command i3blocks -c ~/.config/i3/i3blocks

              
                168
                168
                     font pango:JetBrains Mono 10

              
                169
                169
                     position top

              
                170
                170
                     colors {

              ···
                186
                186
                 client.urgent           #002b36  #262A2B  #FFFFFF  #262A2B   #262A2B

              
                187
                187
                 client.placeholder      #000000  #000000  #FFFFFF  #000000   #000000

              
                188
                188
                 client.background       #FFFFFF

              
                
                189
                +

              
                
                190
                +# vim: ft=i3config

              
A config/i3/i3blocks
···
                
                1
                +separator=true

              
                
                2
                +separator_block_width=15

              
                
                3
                +

              
                
                4
                +[keyboard]

              
                
                5
                +command=$HOME/.script/kblayout

              
                
                6
                +label= 

              
                
                7
                +interval=repeat

              
                
                8
                +

              
                
                9
                +[volume]

              
                
                10
                +command=$HOME/.script/volume

              
                
                11
                +interval=repeat

              
                
                12
                +label= 

              
                
                13
                +signal=10

              
                
                14
                +

              
                
                15
                +[weather]

              
                
                16
                +command=python $HOME/.config/polybar/scripts/weather.py

              
                
                17
                +interval=10

              
                
                18
                +

              
                
                19
                +[wiki-signal]

              
                
                20
                +command=$HOME/.config/polybar/scripts/wifi-signal.sh

              
                
                21
                +label= 

              
                
                22
                +interval=5

              
                
                23
                +

              
                
                24
                +[updates-arch]

              
                
                25
                +command=$HOME/.config/polybar/scripts/updates-pacman-aur.sh

              
                
                26
                +interval=60

              
                
                27
                +

              
                
                28
                +[time]

              
                
                29
                +command=date +%H:%M

              
                
                30
                +label= 

              
                
                31
                +interval=60

              
M config/nvim/init.vim
···
                3
                3
                   Plug 'itchyny/lightline.vim'

              
                4
                4
                   Plug 'jiangmiao/auto-pairs'

              
                5
                5
                   Plug 'maxboisvert/vim-simple-complete'

              
                
                6
                +  Plug 'preservim/nerdcommenter'

              
                6
                7
                   Plug 'sheerun/vim-polyglot'

              
                7
                8
                 call plug#end()

              
                8
                9
                 

              ···
                50
                51
                 " Enable mode line

              
                51
                52
                 set modeline

              
                52
                53
                 

              
                
                54
                +" File explorer

              
                
                55
                +let g:netrw_banner = 0

              
                
                56
                +let g:netrw_browse_split = 2

              
                
                57
                +let g:netrw_winsize = 15

              
                
                58
                +

              
                53
                59
                 " Auto reload file

              
                54
                60
                 set autoread

              
                55
                61
                 

              ···
                57
                63
                 set hidden

              
                58
                64
                 

              
                59
                65
                 " Spell checker

              
                60
                
                -set spell spelllang=en_us

              
                
                66
                +set nospell spelllang=en_us

              
                61
                67
                 

              
                62
                68
                 " Space/tab indicator

              
                63
                69
                 set list listchars=tab:>·,trail:~,extends:>,precedes:<,space:·

              ···
                66
                72
                 set visualbell t_vb=

              
                67
                73
                 

              
                68
                74
                 

              
                69
                
                -" == Settings for specific files

              
                
                75
                +"== Settings for specific files

              
                70
                76
                 autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``

              
                71
                77
                 autocmd FileType python,go,json setlocal expandtab shiftwidth=4 tabstop=4

              
                72
                
                -autocmd FileType html,css,javascript,yaml setlocal expandtab shiftwidth=2 tabstop=2

              
                
                78
                +autocmd FileType html,css,javascript,javascriptreact,yaml setlocal expandtab shiftwidth=2 tabstop=2

              
                73
                79
                 

              
                74
                80
                 

              
                75
                81
                 "== Aliases

              ···
                93
                99
                 \             [ 'readonly', 'modified' ] ],

              
                94
                100
                 \  'right': [ [ 'lineinfo' ],

              
                95
                101
                 \             [ 'percent'  ],

              
                96
                
                -\             [ 'filename', 'filetype' ] ]

              
                97
                
                -\ }, }

              
                
                102
                +\             [ 'filename', 'filetype' ] ] }

              
                
                103
                +\ }

              
                98
                104
                 

              
                
                105
                +let g:NERDCreateDefaultMappings = 1

              
                
                106
                +let g:NERDSpaceDelims = 1

              
                
                107
                +let g:NERDCompactSexyComs = 1

              
                99
                108
                 

              
                100
                109
                 "== Mapping

              
                101
                110
                 let mapleader="'"

              
                102
                111
                 

              
                
                112
                +" Alternative keys

              
                103
                113
                 noremap <C-s> :w<CR>

              
                
                114
                +noremap <C-n> :tabnew<CR>

              
                
                115
                +noremap <leader>ww :Wiki<CR>

              
                
                116
                +noremap <leader>e :Ve<CR>

              
                104
                117
                 

              
                105
                118
                 " Window

              
                106
                119
                 noremap <C-h> :wincmd h<CR>

              
M config/ranger/rc.conf
···
                101
                101
                 map sd shell 7z a file.7z %s

              
                102
                102
                 map se shell extract %s

              
                103
                103
                 

              
                104
                
                -# "e" key

              
                105
                
                -map ee encrypt

              
                106
                
                -map ed decrypt

              
                107
                
                -

              
                108
                104
                 # "q"/quit keys/alias

              
                109
                105
                 map     Q quitall

              
                110
                106
                 alias  qa quitall

              ···
                135
                131
                 # Go keys

              
                136
                132
                 map gh cd ~

              
                137
                133
                 map gc cd ~/code

              
                138
                
                -map gd cd ~/docs

              
                139
                
                -map gb cd ~/docs/books

              
                
                134
                +map gd cd ~/Documents

              
                
                135
                +map gb cd ~/Documents/books

              
                140
                136
                 map gm cd ~/.dotfiles

              
                141
                137
                 map gn cd ~/bin

              
                142
                138
                 map gs cd ~/.script

              
                143
                139
                 map gv cd /media/veracrypt1

              
                144
                
                -map gw cd ~/downl

              
                
                140
                +map gw cd ~/Downloads

              
                145
                141
                 

              
                146
                142
                 # Console

              
                147
                143
                 map :  console

              
A script/kblayout
···
                
                1
                +#!/bin/sh

              
                
                2
                +case "$(xkblayout)" in

              
                
                3
                +    Eng) echo "en" ;;

              
                
                4
                +    Ukr) echo "ua" ;;

              
                
                5
                +    *)   echo "  " ;;

              
                
                6
                +esac

              
A script/volume
···
                
                1
                +#!/usr/bin/env bash

              
                
                2
                +if [[ -z "$MIXER" ]] ; then

              
                
                3
                +    MIXER="default"

              
                
                4
                +    if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then

              
                
                5
                +        if amixer -D pulse info >/dev/null 2>&1 ; then

              
                
                6
                +            MIXER="pulse"

              
                
                7
                +        fi

              
                
                8
                +    fi

              
                
                9
                +    [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"

              
                
                10
                +    MIXER="${2:-$MIXER}"

              
                
                11
                +fi

              
                
                12
                +

              
                
                13
                +if [[ -z "$SCONTROL" ]] ; then

              
                
                14
                +    SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |

              
                
                15
                +                      sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |

              
                
                16
                +                      head -n1

              
                
                17
                +                    )}"

              
                
                18
                +fi

              
                
                19
                +

              
                
                20
                +if [[ -z "$STEP" ]] ; then

              
                
                21
                +    STEP="${1:-5%}"

              
                
                22
                +fi

              
                
                23
                +

              
                
                24
                +NATURAL_MAPPING=${NATURAL_MAPPING:-0}

              
                
                25
                +if [[ "$NATURAL_MAPPING" != "0" ]] ; then

              
                
                26
                +    AMIXER_PARAMS="-M"

              
                
                27
                +fi

              
                
                28
                +

              
                
                29
                +capability() {

              
                
                30
                +  amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |

              
                
                31
                +    sed -n "s/  Capabilities:.*cvolume.*/Capture/p"

              
                
                32
                +}

              
                
                33
                +

              
                
                34
                +volume() {

              
                
                35
                +  amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)

              
                
                36
                +}

              
                
                37
                +

              
                
                38
                +format() {

              
                
                39
                +  perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'

              
                
                40
                +  perl_filter+='{CORE::say $4 eq "off" ? "M" : "'

              
                
                41
                +  perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')

              
                
                42
                +  perl_filter+='"; exit}'

              
                
                43
                +  output=$(perl -ne "$perl_filter")

              
                
                44
                +  echo "$LABEL$output"

              
                
                45
                +}

              
                
                46
                +

              
                
                47
                +case $BLOCK_BUTTON in

              
                
                48
                +  3) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle          ;;

              
                
                49
                +  4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;;

              
                
                50
                +  5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;;

              
                
                51
                +esac

              
                
                52
                +

              
                
                53
                +volume | format

              
M tmux.conf
···
                22
                22
                 ###== Keybindongs

              
                23
                23
                 

              
                24
                24
                 ## HOME/END key support

              
                25
                
                -bind -n End send-key C-e

              
                26
                
                -bind -n Home send-key C-a

              
                
                25
                +bind-key -n End send-key C-e

              
                
                26
                +bind-key -n Home send-key C-a

              
                27
                27
                 bind-key -n Home send Escape "OH"

              
                28
                28
                 bind-key -n End send Escape "OF"

              
                29
                29
                 

              
M vscode/settings.json
···
                1
                1
                 {

              
                2
                2
                     // Apperence

              
                3
                
                -    "workbench.colorTheme": "Ayu Dark Bordered",

              
                
                3
                +    "workbench.colorTheme": "Ayu Dark",

              
                4
                4
                     "workbench.iconTheme": "ayu",

              
                5
                
                -    "editor.fontFamily": "'Jetbrain Mono', 'FontAwesome5Free', 'Droid Sans Mono', 'monospace', 'Droid Sans Fallback'",

              
                
                5
                +    "editor.fontFamily": "Jetbrain Mono, Droid Sans Mono, monospace",

              
                6
                6
                     "editor.wordWrap": "off",

              
                7
                7
                     "editor.fontSize": 14,

              
                8
                8
                 

              ···
                46
                46
                     // Minimap

              
                47
                47
                     "editor.minimap.side": "left",

              
                48
                48
                     "editor.minimap.size": "fit",

              
                49
                
                -    "editor.minimap.enabled": false,

              
                50
                49
                 

              
                51
                50
                     // Sidebar 

              
                52
                51
                     "workbench.sideBar.location": "right",

              ···
                115
                114
                         "editor.defaultFormatter": "esbenp.prettier-vscode",

              
                116
                115
                     },

              
                117
                116
                     "git.autofetch": true,

              
                
                117
                +    "editor.formatOnPaste": true,

              
                
                118
                +    "editor.minimap.enabled": false,

              
                118
                119
                     

              
                119
                120
                 }

              
M zshrc
···
                1
                
                -export PATH="$HOME/.yarn/bin:$HOME/bin:$HOME/.application:$PATH"

              
                
                1
                +export PATH="$HOME/.yarn/bin:$HOME/bin:$HOME/.application:$HOME/.local/bin:$PATH"

              
                2
                2
                 

              
                3
                3
                 ### Oh my zsh ###

              
                4
                4
                 export ZSH="$HOME/.oh-my-zsh"

              ···
                14
                14
                 #COMPLETION_WAITING_DOTS="true" # Display red dots whilst waiting for completion.

              
                15
                15
                 export UPDATE_ZSH_DAYS=7        # Change how often to auto-update.

              
                16
                16
                 

              
                17
                
                -plugins=(yarn)

              
                
                17
                +plugins=(yarn nvm)

              
                18
                18
                 source $ZSH/oh-my-zsh.sh

              
                19
                19
                 

              
                20
                20
                 ### Variables

              ···
                23
                23
                 

              
                24
                24
                 ### Functions

              
                25
                25
                 bgcolor() {

              
                26
                
                -    convert -size 1x1 xc:"$1" /tmp/bgc.png

              
                
                26
                +    convert -size 1x1 xc:"#$1" /tmp/bgc.png

              
                27
                27
                     feh --bg-tile /tmp/bgc.png}

              
                28
                28
                 backup() {

              
                29
                29
                     cp $1 $1.bak}

              ···
                36
                36
                 alias df="df -h"

              
                37
                37
                 alias vim="nvim"

              
                38
                38
                 alias vi="vim"

              
                
                39
                +alias wiki="vi +Wiki"

              
                39
                40
                 alias tmux="tmux -2"

              
                40
                41
                 alias :q="exit"

              
                41
                42
                 alias ..="cd .."