From e3c86138efc52aa469cd50d7908be29e538a25f3 Mon Sep 17 00:00:00 2001 From: Smirnov Olexandr Date: Tue, 29 Dec 2020 16:49:08 +0200 Subject: [PATCH] Update i3, polybar config, del spectrwm config, add catfatch script --- bin/{arch_upd => arch-upd} | 0 bin/catfetch | 47 +++++++++ bin/ipp | 5 + bin/local-ip | 2 - bin/public-ip | 7 -- config/alacritty.yml | 36 +++---- config/i3/config | 98 +++++++---------- config/nvim/init.vim | 44 ++++---- config/picom.conf | 2 +- config/polybar/config | 107 +++---------------- config/vifm/vifmrc | 14 ++- script/dmenu/dmenu-config-edit.sh | 44 +++----- spectrwm.conf | 170 ------------------------------ zshrc | 9 +- 14 files changed, 174 insertions(+), 411 deletions(-) rename bin/{arch_upd => arch-upd} (100%) create mode 100755 bin/catfetch create mode 100755 bin/ipp delete mode 100755 bin/local-ip delete mode 100755 bin/public-ip delete mode 100644 spectrwm.conf diff --git a/bin/arch_upd b/bin/arch-upd similarity index 100% rename from bin/arch_upd rename to bin/arch-upd diff --git a/bin/catfetch b/bin/catfetch new file mode 100755 index 0000000..fc86a09 --- /dev/null +++ b/bin/catfetch @@ -0,0 +1,47 @@ +#!/bin/sh + +# Kernel version +kernel=$(cat /proc/sys/kernel/osrelease|cut -d '-' -f1) + +# Window manager name +[ ! "$wm" ] && [ "$DISPLAY" ] && command -v xprop >/dev/null && { + wmname="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | cut -f2 -d \")" +} + +# Shell +shell=$(basename $SHELL) + +# Pakages +manager=$(which dnf apt pacman apk yay xbps-query 2>/dev/null) +manager=${manager##*/} +case "$manager" in + apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)";; + pacman) packages="$(pacman -Q | wc -l)";; + apk) packages="$(apk list --installed | wc -l)";; + yay) packages="$(yay -Q | wc -l)";; + xbps-query) packages="$(xbps-query -l | wc -l)";; +esac + + + +# Colors #### +bold="\e[1m" +reset="\e[0m" + +blue="\e[36m" +grey="\e[90m" +black='\e[30m' +red='\e[31m' +green='\e[32m' +yellow='\e[33m' +blue='\e[34m' +magenta='\e[35m' +cyan='\e[36m' +white='\e[37m' + +echo -e " ${blue}${bold} WM ${reset}${wmname}" +echo -e " /\_/\ ${blue}${bold} SHELL ${reset}${shell}" +echo -e " (=^.^=) ${blue}${bold}KERNEL ${reset}${kernel}" +echo -e " (\") (\")_/ ${blue}${bold} PKG ${reset}${packages}" +echo -e " ${black}卑${red}卑${green}卑${yellow}卑${blue}卑${magenta}卑${cyan}卑${reset} " +exit 0 diff --git a/bin/ipp b/bin/ipp new file mode 100755 index 0000000..bc44cbf --- /dev/null +++ b/bin/ipp @@ -0,0 +1,5 @@ +#!/bin/sh +if [ -f '/usr/bin/curl' ] +then curl ipinfo.io/ip +else wget -qO- ipinfo.io/ip +fi diff --git a/bin/local-ip b/bin/local-ip deleted file mode 100755 index 9fbaa5b..0000000 --- a/bin/local-ip +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p' | grep -v '172.[0-9][0-9].0.1' diff --git a/bin/public-ip b/bin/public-ip deleted file mode 100755 index 584377a..0000000 --- a/bin/public-ip +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -if [ -f '/usr/bin/curl' ] -then - curl ipinfo.io/ip -else - wget -qO- ipinfo.io/ip -fi diff --git a/config/alacritty.yml b/config/alacritty.yml index df4f392..2e603fb 100644 --- a/config/alacritty.yml +++ b/config/alacritty.yml @@ -37,8 +37,8 @@ background_opacity: 0.75 colors: primary: - background: '0x262A2D' - foreground: '0xDFDFDF' + background: '0x262A2B' + foreground: '0xFFFFFF' cursor: text: '0x7D7D7D' cursor: '0xDFDFDF' @@ -46,23 +46,23 @@ colors: text: '0xEDEBD7' background: '0x262A3B' normal: - black: '0x32344a' - red: '0xf7768e' - green: '0x9ece6a' - yellow: '0xe0af68' - blue: '0x7aa2f7' - magenta: '0xad8ee6' - cyan: '0x449dab' - white: '0x9699a8' + black: '0x181818' + red: '0xab4642' + green: '0xa1b56c' + yellow: '0xf7ca88' + blue: '0x7cafc2' + magenta: '0xba8baf' + cyan: '0x86c1b9' + white: '0xd8d8d8' bright: - black: '0x444b6a' - red: '0xff7a93' - green: '0xb9f27c' - yellow: '0xff9e64' - blue: '0x7da6ff' - magenta: '0xbb9af7' - cyan: '0x0db9d7' - white: '0xacb0d0' + black: '0x585858' + red: '0xab4642' + green: '0xa1b56c' + yellow: '0xf7ca88' + blue: '0x7cafc2' + magenta: '0xba8baf' + cyan: '0x86c1b9' + white: '0xf8f8f8' key_bindings: - { key: V, mods: Control|Shift, action: Paste } diff --git a/config/i3/config b/config/i3/config index d466f92..91e8cea 100644 --- a/config/i3/config +++ b/config/i3/config @@ -16,89 +16,79 @@ new_float pixel hide_edge_borders smart ############ Variables ########### -set $terminal kitty +set $terminal alacritty set $browser firefox -set $filemanager pcmanfm +set $filemanager thunar ############ Autostart ############ -exec --no-startup-id exec picom -b -exec --no-startup-id exec nmcli radio wifi on && nmcli device wifi connect $(echo $WIFINAME) password $(echo $WIFIPASS) name net -#exec --no-startup-id exec redshift-gtk +exec --no-startup-id exec picom --experimental-backends -b exec --no-startup-id exec nitrogen --restore exec --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" exec --no-startup-id exec org.telegram.desktop -#exec --no-startup-id exec conky -#exec --no-startup-id exec discord exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +exec --no-startup-id xautolock -time 3 -locker "betterlockscreen --off 180 -t \"Computer is lockerd\" -l" exec_always --no-startup-id $HOME/.config/i3/bar.sh +#exec --no-startup-id exec conky +#exec --no-startup-id exec redshift-gtk +#exec --no-startup-id exec discord -############ Key bindings ######### +############## WM keys ############ -### I3 -# Kill focus window +# Kill window bindsym $mod+q kill + # Restart i3wm bindsym $mod+Control+r restart -# Focus the parent container -bindsym $mod+a focus parent -# Floating window -bindsym $mod+Shift+space floating toggle + +# Floating layout +bindsym $mod+Tab floating toggle + +# Tab layout +bindsym $mod+w layout tabbed + +# Split layout +bindsym $mod+e layout toggle split + # Splits bindsym $mod+b split h bindsym $mod+v split v -# Change container layout(stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split + # Scratchpad bindsym $mod+Shift+grave move scratchpad bindsym $mod+grave scratchpad show, floating disable -### Launchers +############## User key ########### + +# Menus bindsym $mod+Shift+apostrophe exec "rofi -show run" bindsym $mod+Shift+Return exec "rofi -show drun" bindsym $mod+Escape exec ~/.script/dmenu/dmenu-power.sh -h 24 bindsym $mod+Control+u exec ~/.script/dmenu/dmenu-config-edit.sh -h 24 bindsym $mod+Control+i exec passmenu -h 24 -p Passwords -### Applications +# Apps bindsym $mod+Return exec $terminal bindsym $mod+F2 exec $browser -bindsym $mod+F4 exec $filemanager -bindsym --release $mod+Shift+Escape exec xkill -bindsym $mod+$alt+t exec $terminal nvim .todo +bindsym $mod+f exec $filemanager - -### Sceenshot +# Sceenshot bindsym --release Print exec "scrot -s /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png" bindsym --release Shift+Print exec "scrot /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png" +# Lockscreen +bindsym $mod+Shift+z exec betterlockscreen --off 180 -t \"Computer is lockerd\" -l -### Volume -bindsym $mod+plus exec "pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo +5%" -bindsym $mod+minus exec "pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo -5%" +# Volume +bindsym $mod+plus exec "pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo +2%" +bindsym $mod+minus exec "pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo -2%" bindsym $mod+Shift+minus exec "pactl set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo toggle" ######### Window preferens ######## -#assign [class="Kitty"] $ws1 -#assign [class="(?i)chromium|firefox|qutebrowser"] $ws2 -#assign [class="(?i)subl|code|emacs"] $ws3 -#assign [class="(?i)thunar"] $ws4 -#assign [title="Notable|Simplenote"] $ws5 +assign [class="(?i)firefox|qutebrowser"] $ws2 assign [class="(?i)telegram|discord|viber"] $ws6 -assign [title="KeePassXC"] $ws7 -#for_window [title="Ranger_FM"] move to workspace $ws4 -#for_window [class="Spotify"] move to workspace $ws9 -for_window [class="(?i)mousepad"] floating enable -for_window [class="(?i)lxappearance|qt5ct"] floating enable -for_window [class="(?i)nitrogen"] floating enable #focus_on_window_activation focus -############## Gaps ############### -#gaps inner 4 -#smart_gaps on - -##### Change containet focus ###### +########## Change focus ########## bindsym $mod+h focus left bindsym $mod+Left focus left bindsym $mod+j focus down @@ -108,7 +98,7 @@ bindsym $mod+Up focus up bindsym $mod+l focus right bindsym $mod+Right focus right -##### Move focused container ###### +########## Move window ############ bindsym $mod+Shift+h move left bindsym $mod+Shift+Left move left bindsym $mod+Shift+j move down @@ -118,7 +108,7 @@ bindsym $mod+Shift+Up move up bindsym $mod+Shift+l move right bindsym $mod+Shift+Right move right -##### Restart focused window ###### +########## Resize window ########## bindsym $mod+Control+h resize shrink width 20 px or 20 ppt bindsym $mod+Control+Left resize shrink width 20 px or 20 ppt bindsym $mod+Control+j resize grow height 20 px or 20 ppt @@ -159,22 +149,6 @@ bindsym $mod+Shift+7 move container to workspace $ws7 bindsym $mod+Shift+8 move container to workspace $ws8 bindsym $mod+Shift+9 move container to workspace $ws9 -############## Modes ############## -bindsym $mod+g mode "gaps" -mode "gaps" { - bindsym plus gaps inner current plus 2 - bindsym minus gaps inner current minus 2 - bindsym 0 gaps inner current set 0 - - bindsym Shift+plus gaps inner all plus 4 - bindsym Shift+minus gaps inner all minus 4 - bindsym Shift+0 gaps inner all set 0 - - bindsym Return mode "default" - bindsym Escape mode "default" - bindsym $mod+g mode "default" -} - ############## Colors ############# # Class Border Backgr Text Indicator Child_border client.focused #008DCD #008DCD #FFFFFF #008DCD #008DCD diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 0e30ec3..084b358 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -1,12 +1,13 @@ +filetype plugin on call plug#begin('~/.vim/plugged') - Plug 'nathanaelkane/vim-indent-guides' " Displaying indent levels - Plug 'voldikss/vim-floaterm' " Terminal window - Plug 'frazrepo/vim-rainbow' " Rainbow brackets - Plug 'airblade/vim-gitgutter' " Git indicator - Plug 'ap/vim-css-color' " CSS color preview - Plug 'mhinz/vim-startify' " Start page - Plug 'tpope/vim-surround' " HTML/XML tag cloaser - Plug 'itchyny/lightline.vim' " Status line + Plug 'nathanaelkane/vim-indent-guides' " Displaying indent levels + Plug 'voldikss/vim-floaterm' " Terminal window + Plug 'frazrepo/vim-rainbow' " Rainbow brackets + Plug 'airblade/vim-gitgutter' " Git indicator + Plug 'ap/vim-css-color' " CSS color preview + Plug 'mhinz/vim-startify' " Start page + Plug 'itchyny/lightline.vim' " Status line + Plug 'vimwiki/vimwiki', {'on': 'VimwikiIndex'} " Notes manager in (n)vim " Color sheme Plug 'Smirnov-O/nten16.vim' @@ -23,20 +24,14 @@ call plug#begin('~/.vim/plugged') Plug 'neoclide/coc.nvim', {'branch': 'release'} " Language support - Plug 'pangloss/vim-javascript', {'for': 'javascript'} Plug 'iamcco/markdown-preview.nvim', {'for': 'markdown'} Plug 'dhruvasagar/vim-table-mode', {'for': 'markdown'} Plug 'plasticboy/vim-markdown', {'for': 'markdown'} Plug 'vim-python/python-syntax', {'for': 'python'} - Plug 'vim-scripts/indentpython.vim', {'for': 'python'} - Plug 'Olical/vim-scheme', {'for': 'scheme'} Plug 'kovetskiy/sxhkd-vim', {'for': 'sxhkd'} Plug 'mattn/emmet-vim', {'on': 'Emmet'} Plug 'cakebaker/scss-syntax.vim', {'for': 'scss'} - Plug 'dag/vim-fish', {'for': 'fish'} Plug 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'} - Plug 'fatih/vim-go', {'for': 'go'} - "Plug 'mitsuhiko/vim-jinja' call plug#end() " Colors @@ -63,7 +58,7 @@ set cursorline " File encoding set encoding=utf-8 -set fileencodings=utf8,cp1251 +set fileencodings=utf8 " Line wrap set nowrap @@ -110,7 +105,7 @@ let g:lightline = { \ }, } " Nerdtree -let NERDTreeIgnore = ['__pycache__', '\.pyc$', '\.o$', '\.so$', '\.a$', '\.swp', '*\.swp', '\.swo', '\.swn', '\.swh', '\.swm', '\.swl', '\.swk', '\.sw*$', '[a-zA-Z]*egg[a-zA-Z]*', '.DS_Store'] +let NERDTreeIgnore = ['__pycache__', '.DS_Store', '.git'] let g:NERDTreeWinPos = "right" let g:NERDTreeWinSize = 28 let NERDTreeMinimalUI = 1 @@ -118,6 +113,14 @@ let NERDTreeShowLineNumbers = 1 let NERDTreeShowHidden = 0 map :NERDTreeToggle +" VimWiki +let g:vimwiki_markdown_link_ext = 0 +let g:vimwiki_list = [{ +\ 'path': '~/Documents/Notes', +\ 'syntax': 'markdown', +\ 'ext': '.md', +\ }] + " Coc inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" @@ -134,6 +137,7 @@ nmap FD (easymotion-overwin-f2) nmap FS (easymotion-bd-w) " CtrlP +let g:ctrlp_custom_ignore = '\v[\/]\.git$' imap :CtrlP nmap :CtrlP @@ -173,7 +177,6 @@ let g:floaterm_height = 0.7 let g:floaterm_width = 0.6 let g:floaterm_autoclose = 2 nmap :FloatermNew -imap :FloatermNew " == Maping let mapleader="," @@ -207,5 +210,8 @@ noremap :tabn 8 noremap :tabn 9 " Buffer(s) -noremap :bnext -noremap :bprev +noremap p :bnext +noremap o :bprev + +" Autostart +"autocmd VimEnter * execute "source ~/.config/nvim/init.vim" diff --git a/config/picom.conf b/config/picom.conf index ce1bb18..456dd45 100644 --- a/config/picom.conf +++ b/config/picom.conf @@ -49,7 +49,7 @@ use-damage = true; log-level = "warn"; wintypes: { tooltip = { fade = true; shadow = false; opacity = 1; focus = true; full-shadow = false; }; - menu = { fade = true; shadow = false; }; + menu = { fade = true; shadow = false; opacity = 1; }; popup_menu = { fade = true; shadow = false; }; dropdown_menu = { fade = true; shadow = false; }; utility = { fade = true; shadow = false; }; diff --git a/config/polybar/config b/config/polybar/config index 961f70f..85963b1 100644 --- a/config/polybar/config +++ b/config/polybar/config @@ -1,16 +1,16 @@ [settings] +screenchange-reload = true pseudo-transparency = true [colors] background = #262A2B -foreground = #ffffff +foreground = #DFDFDF secondary = #008DCD -alert = #008DCD +alert = #FF6C6B [bar/i3bar] width = 100% height = 24 - fixed-center = true wm-restack = i3 background = ${colors.background} @@ -20,15 +20,10 @@ module-margin-right = 1 font-0 = Iosevka Nerd Font:style=Medium:size=8;3 font-1 = FontAwesome5Free:style=Solid:size=7.5;2.5 font-2 = Weather Icons:size=7;2 - -modules-left = i3 -modules-right = keyboard pulseaudio backlight wifi-signal time +modules-left = i3 pacman-up +modules-right = keyboard pulseaudio backlight wifi-signal time date tray-position = right -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[settings] -screenchange-reload = true - [module/i3] type = internal/i3 format = @@ -69,139 +64,61 @@ ws-icon-6 = "7;7 " ws-icon-7 = "8;8 " ws-icon-8 = "9;9 " -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; INCLUDE MODULES -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [module/backlight] type = internal/xbacklight format =