diff --git a/README.md b/README.md index aaf4932..f06f716 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ #### System configuration - `OS` Arch -- `WM` Qtile, i3 +- `WM` bspwm, i3 - `Terminal` Alacritty - `Shell` zsh - `Editor` nvim diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index 1613c7d..ac7d2ea 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -4,16 +4,16 @@ ## == Function Run() { - if ! pgrep $1 - then $@& fi + if ! pgrep $1 + then $@& fi } ## == Autostart Run setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" & +Run feh --randomize --bg-scale ~/Pictures/wallp & Run sxhkd -c ./.config/bspwm/sxhkd & ~/.config/bspwm/bar.sh & -Run nitrogen --restore & -~/.script/autolock & +Run ~/.script/autolock & Run lxsession & Run picom -b & @@ -30,7 +30,6 @@ bspc config borderless_monocle true bspc config gapless_monocle true bspc config single_monocle true bspc config focus_follows_pointer true -bspc config borderless_monocle true # Colors bspc config normal_border_color "#262A2B" @@ -42,13 +41,14 @@ bspc config urgent_border_color "#FF6C6B" # Rules bspc rule -a Alacritty desktop='^1' focus=on follow=on bspc rule -a kitty desktop='^1' focus=on follow=on -bspc rule -a firefox desktop='^2' focus=off -bspc rule -a VSCodium desktop='^3' focus=on follow=on +bspc rule -a firefox desktop='^2' focus=on follow=off +bspc rule -a VSCodium desktop='^3' focus=on follow=off +bspc rule -a Sublime_text desktop='^3' focus=on follow=on bspc rule -a '*:nvim' desktop='^3' focus=on follow=on -bspc rule -a '*:ranger' desktop='^4' focus=on follow=on +bspc rule -a '*:ranger' desktop='^4' focus=on follow=off bspc rule -a Thunar desktop='^4' focus=on follow=on -bspc rule -a Joplin desktop='^5' focus=off -bspc rule -a discord descord='^6' focus=on -bspc rule -a TelegramDesktop descord='^6' focus=off -bspc rule -a Spotify descord='^9' focus=on -bspc rule -a google-tasks-desktop state=floating +bspc rule -a Joplin desktop='^5' focus=on follow=off +bspc rule -a discord descord='^6' focus=off follow=off +bspc rule -a telegram-desktop descord='^6' focus=off follow=off +bspc rule -a Spotify descord='^9' focus=on follow=on +bspc rule -a google-tasks-desktop state=floating diff --git a/config/bspwm/polybar b/config/bspwm/polybar index ac9a1dd..4e02caf 100644 --- a/config/bspwm/polybar +++ b/config/bspwm/polybar @@ -7,8 +7,8 @@ pseudo-transparency = true [colors] background = #262A2B foreground = #DFDFDF -secondary = #008DCD -alert = #FF6C6B +secondary = #008DCD +alert = #FF6C6B [bar/bar] width = 100% @@ -19,7 +19,7 @@ foreground = ${colors.foreground} wm-restack = bspwm font-0 = Iosevka Nerd Font:style=Medium:size=8;3 font-1 = FontAwesome5Free:style=Solid:size=7.5;2.5 -modules-left = powermenu windowname +modules-left = windowname modules-center = bspwm modules-right = pulseaudio archupd wifi-signal weather memory cpu keyboard time date tray-position = right diff --git a/config/bspwm/screen.png b/config/bspwm/screen.png deleted file mode 100644 index 6cd0ba4..0000000 Binary files a/config/bspwm/screen.png and /dev/null differ diff --git a/config/bspwm/sxhkd b/config/bspwm/sxhkd index 9948629..d8895e1 100644 --- a/config/bspwm/sxhkd +++ b/config/bspwm/sxhkd @@ -2,52 +2,27 @@ # BSPWM/SXKBD config file ## == USER Applications -super + Return - kitty +super + {_,shift} Return + {alacritty, \ + rofi -show drun } -super + shift + w - firefox +super + shift + {w,f,e,c,q} + {firefox, \ + alacritty --class=ranger -e ranger, \ + alacritty --class=nvim -e nvim, \ + subl, \ + xkill } -super + shift + f - kitty --class=ranger -e ranger +super + shift + z + betterlockscreen --off 180 -t "Computer is lokerd" -l -super + shift + e - kitty --class=nvim -e nvim - -super + shift + c - vscodium - -super + shift + d - org.zealdocs.Zeal - -super + shift + q - xkill - - -## == USER volume -super + minus - amixer sset Master 2%- - -super + equal - amixer sset Master 2%+ - -super + shift + minus - amixer sset Master toggle - - -## == USER Menus -super + shift + Return - rofi -location 2 -show drun - -super + Escape - ~/.script/dmenu/dmenu-power.sh - -super + ctrl + i - ~/.script/dmenu/dmenu-pass.sh - -super + ctrl + u - ~/.script/dmenu/dmenu-config-edit.sh +super + {equal, minus, shift + minus} + amixer sset Master {2%+,2%-,toggle} +super + {Escape, ctrl + u, ctrl + i} + {./.script/dmenu/dmenu-power.sh, \ + ./.script/dmenu/dmenu-config-edit.sh, \ + ./.script/dmenu/dmenu-pass.sh } ## == BSPWM keys super + q @@ -66,35 +41,21 @@ super + ctrl + {h,j,k,l} super + {_,shift + }{h,j,k,l} bspc node -{f,s} {west,south,north,east} -# Change focus window -super + {_,shift + }c - bspc node -f {next,prev}.local.!hidden.window - # Preselect the direction super + alt + {h,j,k,l} bspc node -p {west,south,north,east} - -# Preselect the ratio super + alt + {1-9} bspc node -o 0.{1-9} - -# Cancel the preselection -super + ctrl + space +super + alt + {space,0} bspc node -p cancel ## == BSPWM workspace -## Next/Prev workspace -super + bracket{left,right} - bspc desktop -f {prev,next}.local - -# Change WP & send window to WP super + {_,shift + }{1-9} bspc {desktop -f,node -d} focused:'^{1-9}' ## == BSPWM windwo layouts -# Set window layouts for specific window -super + {t,shift + t,s,f} - bspc node -t {tiled,pseudo_tiled,floating,fullscreen} +super + ctrl + {t, s, f} + bspc node -t {tiled,floating,fullscreen} # Change windows layout super + ctrl + {m,x,y,z} diff --git a/config/i3/config b/config/i3/config index 435acdb..0440398 100644 --- a/config/i3/config +++ b/config/i3/config @@ -21,10 +21,9 @@ set $browser firefox set $filemanager alacritty -e ranger set $codeeditor alacritty -e nvim set $guicode vscodium -set $documentationreader org.zealdocs.Zeal ############ Autostart ############ -exec --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" +exec_always --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" exec_always --no-startup-id exec picom --experimental-backends -b exec_always --no-startup-id exec $HOME/.config/i3/bar.sh exec --no-startup-id exec nitrogen --restore diff --git a/config/nvim/coc-settings.json b/config/nvim/coc-settings.json new file mode 100644 index 0000000..19091e8 --- /dev/null +++ b/config/nvim/coc-settings.json @@ -0,0 +1,22 @@ +{ + // Snippets + "snippets.ultisnips.directories": [ + "snips" + ], + "snippets.userSnippetsDirectory": "~/.config/nvim", + // Emmet + "emmet.includeLanguages": { + "javascript": "javascriptreact" + }, + // Autoload + "coc.preferences.hoverTarget": "float", + "coc.preferences.formatOnSaveFiletypes": [ + "css", + "html", + "markdown", + "yaml", + "json", + "javascript", + "pytnon" + ] +} diff --git a/config/nvim/init.vim b/config/nvim/init.vim index ab1eab1..dc5ad36 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -3,32 +3,28 @@ call plug#begin('~/.vim/plugged') Plug 'itchyny/lightline.vim' " Status line Plug 'maximbaz/lightline-ale' " ALE in status line Plug 'airblade/vim-gitgutter' " Git indicator - Plug 'ap/vim-css-color' " HEX/CSS color preview + Plug 'mbbill/undotree' " Git like history + Plug 'ap/vim-css-color' " CSS color preview Plug 'mhinz/vim-startify' " Start page - Plug 'scrooloose/nerdtree' " File manager Plug 'dense-analysis/ale' " Linter - Plug 'kassio/neoterm' " Terminal wrapper - Plug 'metakirby5/codi.vim' " Live REPL Plug 'editorconfig/editorconfig-vim' " EditorConfig support Plug 'christoomey/vim-tmux-navigator' " Jump from vim to tmux and back - Plug 'Xuyuanp/nerdtree-git-plugin' " NERDTree git status - Plug 'preservim/nerdcommenter' " Code commenter + + " NERDTree + Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} + Plug 'Xuyuanp/nerdtree-git-plugin', {'on': 'NERDTreeToggle'} " Completion & snippets - Plug 'ervandew/supertab' + Plug 'neoclide/coc.nvim' Plug 'jiangmiao/auto-pairs' - Plug 'SirVer/ultisnips' - Plug 'mattn/emmet-vim', {'for': ['html', 'javascript']} " Language support + Plug 'metakirby5/codi.vim', {'on': 'Codi'} " Live REPL Plug 'othree/yajs.vim', {'for': 'javascript'} Plug 'maxmellon/vim-jsx-pretty', {'for': 'javascript'} - Plug 'vim-python/python-syntax', {'for': 'python'} - Plug 'cakebaker/scss-syntax.vim', {'for': ['scss', 'sass']} - - Plug 'plasticboy/vim-markdown', {'for': 'markdown'} + Plug 'plasticboy/vim-markdown', {'for': 'markdown'} Plug 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'} Plug 'kovetskiy/sxhkd-vim', {'for': 'sxhkd'} call plug#end() @@ -133,17 +129,22 @@ let NERDTreeMinimalUI=1 let NERDTreeShowHidden=0 let g:NERDTreeWinSize = 28 -" Emmet -"let g:user_emmet_expandabbr_key='' -let g:user_emmet_leader_key=',' -let g:user_emmet_mode='inv' - -" UltiSnipts -let g:UltiSnipsExpandTrigger = "" -let g:UltiSnipsEditSplit = "vertical" -let g:UltiSnipsJumpForwardTrigger = "" -let g:UltiSnipsJumpBackwardTrigger = "" -let g:UltiSnipsSnippetDirectories = ["snips"] +" Coc +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" +let g:coc_global_config="$HOME/.config/nvim/coc-settings.json" +imap (coc-snippets-expand) +vmap (coc-snippets-select) +let g:coc_global_extensions = [ 'coc-snippets', +\ 'coc-emmet', +\ 'coc-html', +\ 'coc-css', +\ 'coc-yaml', +\ 'coc-json', +\ 'coc-tsserver', +\ 'coc-eslint', +\ 'coc-prettier', +\ ] " Startify let g:startify_custom_header = [ @@ -172,6 +173,10 @@ nmap :wincmd K nmap :wincmd L nmap :wincmd n +" C-j/k as up/dwon in menu +inoremap ("\") +inoremap ("\") + " Tab(s) noremap :tabnext noremap :tabprev diff --git a/config/nvim/snips/python.snippets b/config/nvim/snips/python.snippets index a34ee0a..72ec25e 100644 --- a/config/nvim/snips/python.snippets +++ b/config/nvim/snips/python.snippets @@ -2,6 +2,12 @@ priority -50 snippet #! "Shebang" #!/usr/bin/env python +${1} +endsnippet + +snippet ! "Shebang" +#!/bin/python +${1} endsnippet snippet ifmain "If __main...." diff --git a/config/qtile/config.py b/config/qtile/config.py index 87e86c3..01d3734 100644 --- a/config/qtile/config.py +++ b/config/qtile/config.py @@ -164,6 +164,7 @@ for i, (name, kwargs) in enumerate(group_names, 1): keys.append(Key([mod], str(i), lazy.group[name].toscreen())) keys.append(Key([mod, "shift"], str(i), lazy.window.togroup(name))) + # Window layout(s) layout_theme = { "border_width": 2, @@ -188,6 +189,7 @@ layouts = [ # layout.Zoomy(), ] + # Panel widget_defaults = dict( font="Jatbrains Mono", @@ -238,13 +240,20 @@ screens = [Screen(top=bar.Bar([ )], 24 # Panel size ))] + # Drag floating layouts mouse = [ - Drag([mod], "Button1", lazy.window.set_position(), start=lazy.window.get_position()), - Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), - Click([mod], "Button2", lazy.window.bring_to_front()) + Drag([mod], "Button1", + lazy.window.set_position(), + start=lazy.window.get_position()), + Drag([mod], "Button3", + lazy.window.set_size_floating(), + start=lazy.window.get_size()), + Click([mod], "Button2", + lazy.window.bring_to_front()) ] + dgroups_key_binder = None dgroups_app_rules = [] main = None diff --git a/config/qtile/kblay.sh b/config/qtile/kblay.sh deleted file mode 100755 index 0fb76dc..0000000 --- a/config/qtile/kblay.sh +++ /dev/null @@ -1,6 +0,0 @@ -#/bin/sh -case "$(xkblayout)" in - "Eng") echo "us" ;; - "Rus") echo "ru" ;; - "Ukr") echo "ua" ;; -esac diff --git a/gitconfig b/gitconfig index 72956ef..129442d 100644 --- a/gitconfig +++ b/gitconfig @@ -3,6 +3,9 @@ name = Smirnov Olexandr email = ss2316544@gmail.com +[init] + defaultBranch = main + [web] browser = firefox diff --git a/script/dmenu/dmenu-pass.sh b/script/dmenu/dmenu-pass.sh index ffb1eec..00ada56 100755 --- a/script/dmenu/dmenu-pass.sh +++ b/script/dmenu/dmenu-pass.sh @@ -1,7 +1,7 @@ #!/bin/sh shopt -s nullglob globstar -menucmd="rofi -location 2 -dmenu" +menucmd="rofi -dmenu" prefix=${PASSWORD_STORE_DIR-~/.password-store} password_files=( "$prefix"/**/*.gpg ) password_files=( "${password_files[@]#"$prefix"/}" ) diff --git a/script/dmenu/dmenu-power.sh b/script/dmenu/dmenu-power.sh index 1b51662..ed23368 100755 --- a/script/dmenu/dmenu-power.sh +++ b/script/dmenu/dmenu-power.sh @@ -4,7 +4,7 @@ Lock Logout Reboot") -menucmd="rofi -location 2 -dmenu" +menucmd="rofi -dmenu" choice=$(echo -e "${options[@]}"|${menucmd} -p "Power" $@) case "$choice" in "ShutDown")