Update rofi, add rifile to ranger, add ale to nvim

This commit is contained in:
Smirnov Alexandr 2021-03-29 19:16:45 +03:00
parent 5cc86198aa
commit 3bad265983
15 changed files with 232 additions and 123 deletions

View file

@ -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

View file

@ -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&

View file

@ -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

View file

@ -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

View file

@ -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 <leader>e :NERDTreeToggle<CR>
" Terminal
tnoremap <Esc> <C-\><C-n>
nnoremap <leader>t :Term<CR>
" Alternative keys
nnoremap <C-s> :w<CR>
nnoremap <C-n> :tabnew<CR>
@ -133,7 +147,3 @@ nnoremap <leader>h :bdele<CR>
" Working with system clipboard
noremap <leader>c "+y<CR>
noremap <leader>v "+p<CR>
" Terminal
tnoremap <Esc> <C-\><C-n>

View file

@ -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

81
config/ranger/rifle.conf Normal file
View file

@ -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

View file

@ -1,4 +1,4 @@
rofi.theme: nten-dmenu
rofi.theme: nten
rofi.font: Jetbarains Mono 12
rofi.auto-select: false
rofi.hide-scrollbar: true

View file

@ -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

View file

@ -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

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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";
}

View file

@ -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

View file

@ -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'",