From 3bad26598355d78a7586e6f059a98137bbfa6159 Mon Sep 17 00:00:00 2001 From: Smirnov Alexandr Date: Mon, 29 Mar 2021 19:16:45 +0300 Subject: [PATCH] Update rofi, add rifile to ranger, add ale to nvim --- config/bspwm/bspwmrc | 2 +- config/bspwm/polybar/bar.sh | 3 +- config/bspwm/polybar/polybar | 44 +------------- config/bspwm/sxhkd | 7 +-- config/nvim/init.vim | 22 +++++-- config/ranger/rc.conf | 2 +- config/ranger/rifle.conf | 81 ++++++++++++++++++++++++ config/rofi/config | 2 +- config/rofi/script/passmenu.sh | 17 ------ config/rofi/script/powermenu.sh | 32 +++++----- config/rofi/themes/nten-dmenu.rasi | 19 +++--- config/rofi/themes/nten.rasi | 98 ++++++++++++++++++++++++++++++ config/rofi/themes/ntenV2.rasi | 22 ------- tmux.conf | 2 +- vscode/settings.json | 2 +- 15 files changed, 232 insertions(+), 123 deletions(-) create mode 100644 config/ranger/rifle.conf delete mode 100755 config/rofi/script/passmenu.sh create mode 100644 config/rofi/themes/nten.rasi delete mode 100644 config/rofi/themes/ntenV2.rasi diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index d4e84fc..b757fd0 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -24,7 +24,7 @@ bspc monitor -d 1 2 3 4 5 6 7 8 9 # General C border_width 2 -C window_gap 4 +C window_gap 8 C split_ratio 0.50 C borderless_monocle true C gapless_monocle true diff --git a/config/bspwm/polybar/bar.sh b/config/bspwm/polybar/bar.sh index d2ea137..edda644 100755 --- a/config/bspwm/polybar/bar.sh +++ b/config/bspwm/polybar/bar.sh @@ -1,5 +1,4 @@ #!/bin/bash killall -q polybar while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done -polybar -c ~/.config/bspwm/polybar/polybar min& -#polybar -c ~/.config/bspwm/polybar/polybar bar& +polybar -c ~/.config/bspwm/polybar/polybar bar& diff --git a/config/bspwm/polybar/polybar b/config/bspwm/polybar/polybar index 10a7b56..0637451 100644 --- a/config/bspwm/polybar/polybar +++ b/config/bspwm/polybar/polybar @@ -1,14 +1,11 @@ # vim: ft=dosini - [settings] enable-ipc = true format-padding = 1 -#screenchange-reload = true -#pseudo-transparency = true [colors] background = #262A2B -foreground = #DFDFDF +foreground = #cfd1dd secondary = #008DCD alert = #FF6C6B @@ -21,25 +18,11 @@ 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 = bspwm windowname -modules-center = time date weather -modules-right = keyboard pulseaudio archupd wifi-signal +modules-left = bspwm archupd +modules-right = pulseaudio keyboard time wifi-signal tray-position = right tray-padding = 0 -[bar/min] -width = 100% -height = 24 -fixed-center = true -background = ${colors.background} -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 = bspwm -modules-right = keyboard pulseaudio archupd time wifi-signal -tray-position = right - [module/bspwm] type = internal/bspwm pin-workspaces = true @@ -68,11 +51,6 @@ label-volume-foreground = ${root.foreground} label-muted =  ramp-volume-0 =  -[module/weather] -type = custom/script -exec = python3 ~/.config/bspwm/polybar/scripts/weather.py -interval = 60 - [module/archupd] type = custom/script exec = ~/.config/bspwm/polybar/scripts/updates-pacman-aur.sh @@ -92,22 +70,6 @@ blacklist-0 = num lock blacklist-1 = scroll lock blacklist-2= caps lock -[module/cpu] -type = internal/cpu -format-prefix = " " -interval = 2 - -[module/memory] -type = internal/memory -interval = 2 -label = %percentage_used%% -format-prefix = " " - -[module/windowname] -type = internal/xwindow -label = %title% -label-maxlen = 50 - [module/date] type = internal/date interval = 600 diff --git a/config/bspwm/sxhkd b/config/bspwm/sxhkd index adb1cd0..8257b80 100644 --- a/config/bspwm/sxhkd +++ b/config/bspwm/sxhkd @@ -3,7 +3,7 @@ ## == USER keys super + {_,shift} Return - {kitty, rofi -show drun -theme ntenV2} + {kitty, rofi -show drun} super + shift + {w, e, f, c, s, t, q} {google-chrome-stable, \ @@ -20,9 +20,8 @@ super + shift + {w, e, f, c, s, t, q} super + {equal, minus, shift+minus} amixer sset Master {2%+,2%-,toggle} -super + {Escape, ctrl+i} - {.config/rofi/script/powermenu.sh, \ - .config/rofi/script/passmenu.sh } +super + Escape + .config/rofi/script/powermenu.sh ### == BSPWM keys super + q diff --git a/config/nvim/init.vim b/config/nvim/init.vim index b2fda2b..5e36c8c 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -3,6 +3,7 @@ call plug#begin("~/.vim/plugged") Plug 'sheerun/vim-polyglot' Plug 'jiangmiao/auto-pairs' Plug 'scrooloose/nerdtree' + Plug 'w0rp/ale' call plug#end() "== General @@ -67,8 +68,7 @@ set visualbell t_vb= "== Aliases -command! VTerm :vs | res 40 | set nonu nornu | startinsert | wincmd L | term -command! Term :sp | res 40 | set nonu nornu | startinsert | wincmd J | term +command! Term :vs|wincmd L|vert res 50|set nonu nornu|startinsert|term command! Prettier :silent !prettier % --write command! ESlint :!eslint % command! Black :silent !black % @@ -84,6 +84,16 @@ autocmd FileType go setlocal noex sw=4 ts=4 autocmd FileType javascript,javascriptreact,yaml setlocal et sw=2 ts=2 +"== ALE +let g:ale_disable_lsp = 1 +let g:ale_echo_msg_format = '%severity%: %s' +let g:ale_linters = { +\ 'javascript': ['eslint'], +\ 'python': ['flake8'], +\ 'go': ['golint'] +\ } + + "== NERDTree let g:NERDTreeWinPos = "right" let g:NERDTreeMinimalUI = 1 @@ -96,6 +106,10 @@ let mapleader=";" " NerdTree nnoremap e :NERDTreeToggle +" Terminal +tnoremap +nnoremap t :Term + " Alternative keys nnoremap :w nnoremap :tabnew @@ -133,7 +147,3 @@ nnoremap h :bdele " Working with system clipboard noremap c "+y noremap v "+p - - -" Terminal -tnoremap diff --git a/config/ranger/rc.conf b/config/ranger/rc.conf index 8302117..70ade23 100644 --- a/config/ranger/rc.conf +++ b/config/ranger/rc.conf @@ -26,10 +26,10 @@ map @ shell $SHELL # go to map gc cd ~/code -map gn cd ~/notes map gd cd ~/Documents map gw cd ~/Downloads map g. cd ~/.dotfiles +map gu cd /mnt/usb # delete map dD delete diff --git a/config/ranger/rifle.conf b/config/ranger/rifle.conf new file mode 100644 index 0000000..1c6d6cc --- /dev/null +++ b/config/ranger/rifle.conf @@ -0,0 +1,81 @@ +# vim: ft=cfg +#== Websites +ext x?html?, has firefox, X, flag f = firefox -- "$@" +ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@" +ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@" +ext x?html?, has chromium, X, flag f = chromium -- "$@" +ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@" +ext x?html?, has w3m, terminal = w3m "$@" + +#== Misc +mime ^text, label editor = ${EDITOR} -- "$@" +mime ^text, label pager = "$PAGER" -- "$@" +!mime ^text, label editor, ext json|csv|tex|py|rb|js|sh = ${EDITOR} -- "$@" +!mime ^text, label pager, ext json|csv|tex|py|rb|js|sh = "$PAGER" -- "$@" +name ^[mM]akefile$ = make + +#== Scripts +ext py = python -- "$1" +ext rb = ruby -- "$1" +ext js = node -- "$1" +ext sh = sh -- "$1" + +#== Video/Audio +mime ^video, has mpv, X, flag f = mpv -- "$@" +mime ^video, has mpv, X, flag f = mpv --fs -- "$@" +mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@" +mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@" +mime ^video, has mplayer, X, flag f = mplayer -- "$@" +mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@" +mime ^video|audio, has vlc, X, flag f = vlc -- "$@" + +#== Documents +ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@" +ext pdf, has zathura, X, flag f = zathura -- "$@" +ext djvu, has zathura, X, flag f = zathura -- "$@" +ext epub, has zathura, X, flag f = zathura -- "$@" + +#== Images +mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@" +mime ^image, has feh, X, flag f = feh -- "$@" +mime ^image, has ristretto, X, flag f = ristretto "$@" +mime ^image, has gimp, X, flag f = gimp -- "$@" +ext xcf, X, flag f = gimp -- "$@" + +#== Archives +ext 7z, has 7z = 7z -p l "$@" | "$PAGER" +ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER" +ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER" +ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@" +ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@" +ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER" +ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done +ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done +ext zip, has unzip = unzip -l "$1" | less +ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done +ext rar, has unrar = unrar l "$1" | less +ext rar, has unrar = for file in "$@"; do unrar x "$file"; done + +#== Fonts +mime ^font, has fontforge, X, flag f = fontforge "$@" + +#== Terminals +mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@" +mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@" + +#== Misc +label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1" +label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1" +label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1" +label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" + +#== Generic file openers +label open, has xdg-open = xdg-open -- "$@" +label open, has open = open -- "$@" + + !mime ^text, !ext json|csv|tex|py|rb|js|sh = ask +label editor, !mime ^text, !ext json|csv|tex|py|rb|js|sh = ${EDITOR} -- "$@" +label pager, !mime ^text, !ext json|csv|tex|py|rb|js|sh = "$PAGER" -- "$@" +mime application/x-executable = "$1" +label trash, has trash-put = trash-put -- "$@" +label trash = mkdir -p -- ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash; mv -- "$@" ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash diff --git a/config/rofi/config b/config/rofi/config index 8e2bb63..35f0d24 100644 --- a/config/rofi/config +++ b/config/rofi/config @@ -1,4 +1,4 @@ -rofi.theme: nten-dmenu +rofi.theme: nten rofi.font: Jetbarains Mono 12 rofi.auto-select: false rofi.hide-scrollbar: true diff --git a/config/rofi/script/passmenu.sh b/config/rofi/script/passmenu.sh deleted file mode 100755 index 00ada56..0000000 --- a/config/rofi/script/passmenu.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -shopt -s nullglob globstar - -menucmd="rofi -dmenu" -prefix=${PASSWORD_STORE_DIR-~/.password-store} -password_files=( "$prefix"/**/*.gpg ) -password_files=( "${password_files[@]#"$prefix"/}" ) -password_files=( "${password_files[@]%.gpg}" ) -password=$(printf '%s\n' "${password_files[@]}"|${menucmd} -p "Passwords" "$@") -[[ -n $password ]] || exit - -if [[ $typeit -eq 0 ]]; then - pass show -c "$password" 2>/dev/null -else - pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | - xdotool type --clearmodifiers --file - -fi diff --git a/config/rofi/script/powermenu.sh b/config/rofi/script/powermenu.sh index cd6f1b1..606b350 100755 --- a/config/rofi/script/powermenu.sh +++ b/config/rofi/script/powermenu.sh @@ -1,26 +1,24 @@ -#!/bin/sh -declare options=("ShutDown -Lock -Logout -Reboot") +#!/usr/bin/env bash +declare options=("ShutDown\nLogOut\nReboot") -menucmd="rofi -dmenu" -choice=$(echo -e "${options[@]}"|${menucmd} -p "Power" $@) -case "$choice" in +choice=$(echo -e ${options[@]} | rofi -dmenu -p "Power" -theme nten-dmenu) +case $choice in "ShutDown") - case "$(echo -e "Yes\nNo"|${menucmd} -p "ShutDown" $@)" in + case "$(echo -e "Yes\nNo" | rofi -dmenu -p "ShutDown" -theme nten-dmenu)" in "Yes") exec systemctl poweroff ;; - "No") exec exit 0 ;; - esac ;; - "Lock") exec betterlockscreen --off 300 -t "Computer is lockerd" -l ;; - "Logout") - case "$(echo -e "Yes\nNo"|${menucmd} -p "Logout" $@)" in + "no") exec exit 0 ;; + esac + ;; + "LogOut") + case "$(echo -e "Yes\nNo" | rofi -dmenu -p "LogOut" -theme nten-dmenu)" in "Yes") exec loginctl terminate-session $XDG_SESSION_ID ;; "No") exec exit 0 ;; - esac ;; + esac + ;; "Reboot") - case "$(echo -e "Yes\nNo"|${menucmd} -p "Reboot" $@)" in + case "$(echo -e "Yes\nNo" | rofi -dmenu -p "Reboot" -theme nten-dmenu)" in "Yes") exec systemctl reboot ;; "No") exec exit 0 ;; - esac ;; + esac + ;; esac diff --git a/config/rofi/themes/nten-dmenu.rasi b/config/rofi/themes/nten-dmenu.rasi index b224b42..52ce3f7 100644 --- a/config/rofi/themes/nten-dmenu.rasi +++ b/config/rofi/themes/nten-dmenu.rasi @@ -1,40 +1,41 @@ * { background-color: #262A2B; text-color: #93A1A1; - font: "Hack 9"; + font: "JetbrainsMono Nerd Font 9"; prompt-padding: 4px; selected-background: #008DCD; selected-foreground: #ffffff; } -#window { +window { + anchor: north; location: north; width: 100%; - height: 24px; padding: 0px; children: [ horibox ]; } -#horibox { +horibox { orientation: horizontal; + height: 24px; children: [ prompt, entry, listview ]; } -#prompt { +prompt { padding: @prompt-padding; background-color: @selected-background; text-color: @selected-foreground; font: @font; } -#listview { +listview { layout: horizontal; spacing: 0px; lines: 100; } -#entry { +entry { padding: 4px 4px; expand: false; width: 170px; } -#element { padding: 4px 8px; } -#element selected { +element { padding: 4px 8px; } +element selected { background-color: @selected-background; text-color: @selected-foreground; } diff --git a/config/rofi/themes/nten.rasi b/config/rofi/themes/nten.rasi new file mode 100644 index 0000000..4352552 --- /dev/null +++ b/config/rofi/themes/nten.rasi @@ -0,0 +1,98 @@ +configuration { + show-icons: true; + display-drun: ""; + drun-display-format: "{name}"; + disable-history: false; + hide-scrollbar: true; + sidebar-mode: true; +} +* { + bg: #262A2b; + fg: #cfd1dd; + ac: #008dcd; + background-color: @bg; + text-color: @fg; +} + +window { + width: 40%; +} + +prompt { + enabled: true; + padding: 0.3% 1% 0% -0.5%; + margin: 0 0 0 0; + background-color: @bg; + text-color: @fg; + font: "JetBrainsMono Nerd Font 12"; +} + +entry { + background-color: @bg; + text-color: @fg; + placeholder-color: @fg; + expand: true; + horizontal-align: 0; + placeholder: "Type to search"; + padding: 0.1% 0% 0% 0%; + margin: 0.6% 0 0 0; + blink: true; +} + +inputbar { + children: [ prompt, entry ]; + background-color: @bg; + text-color: @bg; + expand: false; + border: 0% 0% 0% 0%; + border-radius: 0px; + border-color: @ac; + margin: 0% 0% 0% 0%; + padding: 1.5%; +} + +listview { + background-color: @al; + padding: 10px; + columns: 4; + lines: 3; + spacing: 0%; + cycle: false; + dynamic: true; + layout: vertical; +} + +mainbox { + background-color: @bg; + border: 0% 0% 0% 0%; + border-radius: 0% 0% 0% 0%; + border-color: @bg; + children: [ inputbar, listview ]; + spacing: 0%; + padding: 1%; +} + +element { + background-color: @al; + text-color: @fg; + orientation: vertical; + border-radius: 0%; + padding: 2% 0% 2% 0%; +} + +element-icon { + size: 49px; + border: 0px; +} + +element-text { + expand: true; + horizontal-align: 0.5; + vertical-align: 0.5; + margin: 0.5% 0.5% -0.5% 0.5%; +} + +element selected { + background-color: @ac; + text-color: @bg; +} diff --git a/config/rofi/themes/ntenV2.rasi b/config/rofi/themes/ntenV2.rasi deleted file mode 100644 index b41ffd0..0000000 --- a/config/rofi/themes/ntenV2.rasi +++ /dev/null @@ -1,22 +0,0 @@ -configuration { - width: 25; - lines: 13; - columns: 2; - font: "RobotoCondensed 12"; - bw: 2; - location: 1; - padding: 3; - yoffset: 27; - xoffset: 3; - show-icons: true; - icon-theme: "Paper"; - drun-display-format: "{name}"; - case-sensitive: false; - cycle: false; - auto-select: false; - line-padding: 6; - separator-style: "solid"; - hide-scrollbar: true; - color-normal: "#262A2B,#abb2bf,#262A2B,#008DCD,#262A2B"; - color-window: "#262A2B,#1F2324,#58676C"; -} diff --git a/tmux.conf b/tmux.conf index 0aae169..01ad50d 100644 --- a/tmux.conf +++ b/tmux.conf @@ -2,7 +2,7 @@ set -sg escape-time 0 ## Set prefix -set -g prefix C-f +set -g prefix C-d ## Set base index set -g base-index 1 diff --git a/vscode/settings.json b/vscode/settings.json index 7ec86d2..440213b 100644 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -1,5 +1,5 @@ { - "workbench.colorTheme": "One Dark Pro", + "workbench.colorTheme": "Cobalt2", "editor.wordWrap": "off", "editor.fontSize": 14, "editor.fontFamily": "'Jetbrains Mono', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",