all repos

dotfiles @ c7da10d0769ef7ed07f426894c86d4aa8be26d2b

my dotfiles
22 files changed, 256 insertions(+), 282 deletions(-)
Update alacritty, kitty, bspwm, i3wm, vim,tmux configs & sctipts
Author: Smirnov Olexandr ss2316544@gmail.com
Committed at: 2021-01-24 23:08:44 +0200
Parent: 246dc34
M config/alacritty.yml

@@ -36,9 +36,10 @@

scrolling.history: 1000 debug.render_timer: false -draw_bold_text_with_bright_colors: false +#draw_bold_text_with_bright_colors: false +draw_bold_text_with_bright_colors: true background_opacity: 0.75 -dynamic_title: true +dynamic_title: false colors: primary:
M config/bspwm/bspwmrc

@@ -2,9 +2,10 @@ #!/bin/sh

# Smirnov-O <ss2316544@gmail.com> # BSPWM config file -## == Functions +## == Function Run() { - if ! pgrep $1; then $@& fi + if ! pgrep $1 + then $@& fi } ## == Autostart

@@ -12,21 +13,24 @@ setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" &

Run sxhkd -c .config/bspwm/sxhkd & ~/.config/bspwm/bar.sh & Run nitrogen --restore & +~/.script/autolock & Run lxsession & Run picom & ## == BSPWM + +# Workspaces bspc monitor -d 1 2 3 4 5 6 7 8 9 -bspc config border_width 2 -bspc config window_gap 8 - -bspc config split_ratio 0.52 -bspc config borderless_monocle true -bspc config gapless_monocle true -bspc config click_to_focus true -bspc config single_monocle false -bspc config borderless_monocle true +# General +bspc config border_width 2 +bspc config window_gap 8 +bspc config split_ratio 0.50 +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"

@@ -36,14 +40,15 @@ bspc config presel_feedback_color "#51AFEF"

bspc config urgent_border_color "#FF6C6B" # Rules -bspc rule -a Alacritty desktop='^1' focus=on follow=on -bspc rule -a firefox desktop='^2' focus=on -bspc rule -a VSCodium 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 Thunar desktop='^4' focus=on follow=on -bspc rule -a Joplin desktop='^5' focus=on +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 '*:nvim' desktop='^3' focus=on follow=on +bspc rule -a '*:ranger' desktop='^4' focus=on follow=on +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=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
M config/bspwm/polybar

@@ -1,5 +1,6 @@

[settings] enable-ipc = true +format-padding = 1 screenchange-reload = true pseudo-transparency = true

@@ -16,14 +17,13 @@ fixed-center = true

background = ${colors.background} foreground = ${colors.foreground} wm-restack = bspwm -module-margin-left = 1 -module-margin-right = 1 font-0 = Iosevka Nerd Font:style=Medium:size=8;3 font-1 = FontAwesome5Free:style=Solid:size=7.5;2.5 -modules-left = windowname +modules-left = powermenu windowname modules-center = bspwm modules-right = pulseaudio archupd wifi-signal weather memory cpu keyboard time date tray-position = right +tray-padding = 0 [module/bspwm] type = internal/bspwm
M config/bspwm/sxhkd

@@ -1,17 +1,18 @@

# Smirnov-O <ss2316544@gmail.com> # BSPWM/SXKBD config file -## == USER keys +## == USER Applications super + Return - alacritty + kitty + super + shift + w firefox super + shift + f - alacritty --class="ranger" -e ranger + kitty --class=ranger -e ranger super + shift + e - alacritty --class="nvim" -e nvim + kitty --class=nvim -e nvim super + shift + c vscodium

@@ -22,6 +23,18 @@

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

@@ -30,7 +43,7 @@ super + Escape

~/.script/dmenu/dmenu-power.sh super + ctrl + i - passmenu -h 24 -p Passwords + ~/.script/dmenu/dmenu-pass.sh super + ctrl + u ~/.script/dmenu/dmenu-config-edit.sh

@@ -44,13 +57,10 @@ super + control + r

bspc wm -r && pkill -USR1 -x sxhkd ## == BSPWM windows + ## Resize window super + ctrl + {h,j,k,l} bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} - -# Resize floating window -#super + shift + {h,j,k,l} -# bspc node -v {-20 0,0 20,0 -20,20 0} # Change focus & move focus window super + {_,shift + }{h,j,k,l}
M config/i3/bar.sh

@@ -1,4 +1,4 @@

#!/bin/bash killall -q polybar while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done -polybar i3bar & +polybar bar &
M config/i3/config

@@ -54,8 +54,8 @@ # Split layout

bindsym $mod+Control+e layout toggle split # Splits -#bindsym $mod+b split h -#bindsym $mod+v split v +bindsym $mod+b split h +bindsym $mod+v split v # Scratchpad bindsym $mod+Shift+grave move scratchpad

@@ -64,11 +64,10 @@

############## User key ########### # Menus -bindsym $mod+Shift+apostrophe exec "rofi -location 6 -show run" -bindsym $mod+Shift+Return exec "rofi -location 6 -show drun" -bindsym $mod+Escape exec ~/.script/dmenu/dmenu-power.sh -b -h 24 -bindsym $mod+Control+u exec ~/.script/dmenu/dmenu-config-edit.sh -b -h 24 -bindsym $mod+Control+i exec passmenu -b -h 24 -p Passwords +bindsym $mod+Shift+Return exec rofi -show drun +bindsym $mod+Escape exec ~/.script/dmenu/dmenu-power.sh +bindsym $mod+Control+u exec ~/.script/dmenu/dmenu-config-edit.sh +bindsym $mod+Control+i exec ~/.script/dmenu/dmenu-pass.sh # Apps bindsym $mod+Return exec $terminal

@@ -77,9 +76,6 @@ bindsym $mod+Shift+f exec $filemanager

bindsym $mod+Shift+e exec $codeeditor bindsym $mod+Shift+c exec $guicode bindsym $mod+Shift+d exec $documentationreader - -# Toogle polybar -bindsym $mod+b exec ~/.script/polybar-toggle # Sceenshot bindsym --release Print exec scrot -s /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png
M config/kitty/kitty.conf

@@ -1,6 +1,3 @@

-# MOD -clear_all_shortcuts yes - # Font font_family Jetbrains Mono bold_font auto

@@ -65,6 +62,7 @@ initial_window_height 480

enabled_layouts * # Keyboard Shortcuts +clear_all_shortcuts yes map ctrl+shift+c copy_to_clipboard map ctrl+shift+v paste_from_clipboard map shift+insert paste_from_selection

@@ -87,17 +85,15 @@

# Theming foreground #dfdfdf background_opacity 0.85 -#background_opacity 1 +dynamic_background_opacity yes background_image none background_image_layout tiled background_image_linear no -dynamic_background_opacity no background_tint 0.0 dim_opacity 0.75 selection_foreground #edebd7 selection_background #073642 -background #262a3b -#background #262a2b +background #262a2b foreground #ffffff cursorColor #d2dae2 selection_background #262a3b
M config/nvim/init.vim

@@ -1,25 +1,35 @@

call plug#begin('~/.vim/plugged') Plug 'Smirnov-O/nten16.vim' " Color scheme 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' " CSS color preview + Plug 'ap/vim-css-color' " HEX/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 'aurieh/discord.nvim' " Discord rich - Plug 'editorconfig/editorconfig-vim' " EditorConfig support + 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 " Completion & snippets - Plug 'ervandew/supertab' + "Plug 'ervandew/supertab' Plug 'jiangmiao/auto-pairs' Plug 'SirVer/ultisnips' + Plug 'mattn/emmet-vim', {'for': ['html', 'javascript']} - " Programing - Plug 'metakirby5/codi.vim' - Plug 'plasticboy/vim-markdown', {'for': 'markdown'} + " Language support + 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 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'} - Plug 'kovetskiy/sxhkd-vim' + Plug 'kovetskiy/sxhkd-vim', {'for': 'sxhkd'} call plug#end()

@@ -72,8 +82,7 @@ set hidden

set smartindent " Spell -set spell -set spelllang=en_us +"set spell spelllang=en_us " Disable sound set visualbell t_vb=

@@ -93,7 +102,7 @@

" Markdown let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_frontmatter = 1 -let g:markdown_fenced_languages = ['go', 'python', 'bash', 'sh=bash'] +let g:markdown_fenced_languages = ['javascript', 'js=javascript', 'python', 'py=python', 'bash', 'sh=bash'] " == Plugins configuration

@@ -101,11 +110,23 @@ let g:lightline = {

\ 'colorscheme': 'nten16', \ 'active': { \ 'left': [ [ 'mode', 'paste' ], -\ [ 'readonly', 'modified' ] ], +\ [ 'readonly', 'modified' ], +\ [ 'linter_errors', 'linter_warnings', 'linter_infos' ] ], \ 'right': [ [ 'lineinfo' ], \ [ 'percent' ], \ [ 'filename', 'filetype' ] ] -\ }, } +\ }, +\ 'component_expand': { +\ 'linter_checking': 'lightline#ale#checking', +\ 'linter_infos': 'lightline#ale#infos', +\ 'linter_warnings': 'lightline#ale#warnings', +\ 'linter_errors': 'lightline#ale#errors', +\ 'linter_ok': 'lightline#ale#ok' +\ },} + +" Emmet +let g:user_emmet_expandabbr_key='<tab>' +let g:user_emmet_mode='inv' " UltiSnipts let g:UltiSnipsExpandTrigger = "<tab>"

@@ -157,5 +178,5 @@ noremap <A-8> :tabn 8<CR>

noremap <A-9> :tabn 9<CR> " Buffer(s) -noremap <leader>p :bnext<CR> -noremap <leader>o :bprev<CR> +noremap <leader>b :bnext<CR> +noremap <leader>p :bprev<CR>
M config/nvim/snips/sh.snippets

@@ -1,9 +1,9 @@

-snippet !sh "SH Shebang" +snippet ! "SH Shebang" #!/bin/sh ${1} endsnippet -snippet !bash "BASH Shebang" +snippet #! "BASH Shebang" #!/bin/bash ${1} endsnippet

@@ -27,8 +27,8 @@ done

endsnippet snippet case "Case" -case "${1:$variable}" in - "${2}") ${3} ;; +case "${1}" in + ${2} esac endsnippet
M config/polybar/config

@@ -13,7 +13,6 @@ [bar/bar]

monitor = ${env:MONITOR_MIDDLE} width = 100% height = 24 -bottom = true fixed-center = true wm-restack = i3 background = ${colors.background}

@@ -22,19 +21,50 @@ module-margin-left = 1

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 pacman-up window-name -modules-right = pulseaudio backlight wifi-signal keyboard time date +modules-right = pulseaudio weather wifi-signal keyboard time date tray-position = right -[module/bspwm] -type = internal/bspwm -pin-workspaces = true -inline-mode = false -enable-click = false -enable-scroll = false -reverse-scroll = false -fuzzy-match = true +[module/i3] +type = internal/i3 +format = <label-state><label-mode> +card = intel_backlight +index-sort = false +wrapping-scroll = false +label-mode-padding = 1 +label-mode-background = ${colors.alert} + +label-focused = %icon% +label-focused-background = ${colors.secondary} +label-focused-foreground = ${colors.foreground} +label-focused-padding = 1 +label-focused-underline = ${colors.alert} + +label-unfocused = %icon% +label-unfocused-foreground = ${colors.foreground} +label-unfocused-padding = 1 + +label-urgent = %icon% +label-urgent-background = ${colors.alert} +label-urgent-foreground = ${colors.foreground} +label-urgent-padding = 1 +label-urgent-underline = ${colors.alert} + +label-visible = %icon% +label-visible-background = ${colors.background} +label-visible-foreground = ${colors.foreground} +label-visible-padding = 1 +label-visible-underline = ${colors.background} + +ws-icon-0 = "1;1 " +ws-icon-1 = "2;2 " +ws-icon-2 = "3;3 " +ws-icon-3 = "4;4 " +ws-icon-4 = "5;5 " +ws-icon-5 = "6;6 " +ws-icon-6 = "7;7 " +ws-icon-7 = "8;8 " +ws-icon-8 = "9;9 " [module/wifi-signal] type = custom/script

@@ -72,22 +102,6 @@ label-layout =  %layout%

blacklist-0 = num lock blacklist-1 = scroll lock blacklist-2= caps lock - -[module/menu] -type = custom/menu -format = <label-toggle> <menu> -format-padding = 1 -format-spacing = 2 -label-open =  -label-close =  -menu-0-0 =  -menu-0-0-exec = thunar -menu-0-1 =  -menu-0-1-exec = firefox -menu-0-2 =  -menu-0-2-exec = alacritty -menu-0-3 =  -menu-0-3-exec = emacs [module/date] type = internal/date
M config/polybar/scripts/weather.py

@@ -1,7 +1,8 @@

-#!/usr/bin/env python3 -# -*- encoding: utf-8 -*- -import requests -import os +"""For working this script set in ~/.profile 2 variable: +"OWM_POLYBAR": API key +"OWM_CITY": Your city +""" +import requests, os API_KEY = os.getenv("OWM_POLYBAR")

@@ -10,5 +11,5 @@

try: JSON = requests.get(f"http://api.openweathermap.org/data/2.5/weather?q={CITY}&lang=EN&&units=metric&appid={API_KEY}").json() print("", int(JSON["main"]["temp"]), "°С") -except: +except Exception: print(" err °С")
M config/qtile/config.py

@@ -1,17 +1,17 @@

from libqtile import bar, layout, widget, hook from libqtile.config import Click, Drag, Group, Key, Screen from libqtile.lazy import lazy -from typing import List -import kblayout, os +import kblayout +import os mod = "mod4" alt = "mod1" -terminal = "alacritty" -browser = "firefox" +terminal = "alacritty" +browser = "firefox" filemanager = f"{terminal} -e ranger" -editor = "alacritty -e nvim" +editor = "alacritty -e nvim" color = [ "#FFFFFF", # 0. Text color

@@ -34,160 +34,119 @@

keys = [ # Applications Key([mod], "Return", - lazy.spawn(terminal), - desc="Launch terminal" - ), + lazy.spawn(terminal), + desc="Launch terminal"), Key([mod, "shift"], "w", lazy.spawn(browser), - desc="Launch browser" - ), + desc="Launch browser"), Key([mod, "shift"], "f", lazy.spawn(filemanager), - desc="Launch filemanager" - ), + desc="Launch filemanager"), Key([mod, "shift"], "e", lazy.spawn(editor), - desc="Launch code editor" - ), - # Window control - Key([mod], "q", + desc="Launch code editor"), + + # Window control + Key([mod], "q", lazy.window.kill(), - desc="Kill focused window" - ), + desc="Kill focused window"), Key([mod, "shift"], "Tab", lazy.window.toggle_floating(), - desc="Toggle floating mode" - ), - Key([mod], "h", - lazy.layout.left(), - desc="Change focus window(left)" - ), + desc="Toggle floating mode"), + Key([mod], "h", + lazy.layout.left(), + desc="Change focus window(left)"), Key([mod], "j", - lazy.layout.down(), - desc="Change focus window(down)" - ), - Key([mod], "k", + lazy.layout.down(), + desc="Change focus window(down)"), + Key([mod], "k", lazy.layout.up(), - desc="Change focus window(up)" - ), + desc="Change focus window(up)"), Key([mod], "l", lazy.layout.right(), - desc="Change focus window(right)" - ), + desc="Change focus window(right)"), Key([mod, "shift"], "h", lazy.layout.shuffle_left(), - desc="Move focus window(left)" - ), + desc="Move focus window(left)"), Key([mod, "shift"], "j", lazy.layout.shuffle_down(), - desc="Move focus window(down)" - ), + desc="Move focus window(down)"), Key([mod, "shift"], "k", lazy.layout.shuffle_up(), - desc="Move focus window(up)" - ), + desc="Move focus window(up)"), Key([mod, "shift"], "l", lazy.layout.shuffle_right(), - desc="Move focus window(right)" - ), + desc="Move focus window(right)"), Key([mod, "control"], "h", lazy.layout.grow_left(), - desc="Resize focus window(left)" - ), + desc="Resize focus window(left)"), Key([mod, "control"], "j", lazy.layout.grow_down(), - desc="Resize focus window(down)" - ), + desc="Resize focus window(down)"), Key([mod, "control"], "k", lazy.layout.grow_up(), - desc="Resize focus window(up)" - ), + desc="Resize focus window(up)"), Key([mod, "control"], "l", lazy.layout.grow_right(), - desc="Resize focus window(right)" - ), + desc="Resize focus window(right)"), # Layout Key([mod], "Tab", lazy.next_layout(), - desc="Toggle between layouts" - ), + desc="Toggle between layouts"), Key([mod], "space", lazy.layout.next(), - desc="Switch window focus to other pane(s) of stack" - ), + desc="Switch window focus to other pane(s) of stack"), Key([mod, "shift"], "space", lazy.layout.rotate(), - desc="Swap panes of split stack" - ), + desc="Swap panes of split stack"), # Volume Key([mod], "equal", lazy.spawn("amixer sset Master 2%+"), - desc="Plus 2% volume" - ), + desc="Plus 2% volume"), Key([mod], "minus", lazy.spawn("amixer sset Master 2%-"), - desc="Minus 2% volume" - ), + desc="Minus 2% volume"), Key([mod, "shift"], "minus", lazy.spawn("amixer sset Master toggle"), - desc="Mute volume" - ), + desc="Mute volume"), - # Menus(dmenu or/and rofi) + # Menus(dmenu or/and rofi) Key([mod, "shift"], "Return", - lazy.spawn("rofi -location 2 -show drun"), - desc="(Rofi) Program launcher" - ), - Key([mod, "shift"], "apostrophe", - lazy.spawn("rofi -location 2 -show run"), - desc="(Rofi) Program launcher" - ), - Key([mod],"Escape", + lazy.spawn("rofi -show drun"), + desc="(Rofi) Program launcher"), + Key([mod], "Escape", lazy.spawn("./.script/dmenu/dmenu-power.sh"), - desc="Power menu" - ), + desc="Power menu"), Key([mod, "control"], "i", - lazy.spawn("passmenu -h 24 -p Password"), - desc="Dmenu password menu" - ), + lazy.spawn("./.script/dmenu/dmenu-pass.sh"), + desc="Dmenu(rofi) password menu"), Key([mod, "control"], "u", lazy.spawn("./.script/dmenu/dmenu-config-edit.sh"), - desc="Config editor" - ), - Key([mod, "control"], "o", - lazy.spawn("./.script/dmenu/dmenu-sysmon.sh"), - desc="Choice system monitor" - ), + desc="Config editor"), # Screenhot Key([], "Print", lazy.spawn("scrot -s ./$(date +%Y-%m-%d-%H-%M-%S).png"), - desc="Create screenhot(scrot -s)" - ), + desc="Create screenhot(scrot -s)"), Key(["shift"], "Print", - lazy.spawn(f"scrot ./$(date +%Y-%m-%d-%H-%M-%S).png"), - desc="Create screenhot full screen(scrot)" - ), + lazy.spawn("scrot ./$(date +%Y-%m-%d-%H-%M-%S).png"), + desc="Create screenhot full screen(scrot)"), # Qtile Key([mod, "control"], "r", lazy.restart(), - desc="Restart qtile" - ), + desc="Restart qtile"), Key([mod], "r", lazy.spawncmd(), - desc="Spawn a command using a prompt widget" - ), + desc="Spawn a command using a prompt widget"), Key([mod, "shift"], "q", lazy.spawn("xkill"), - desc="Xkill" - ), + desc="Xkill"), Key([mod, "shift"], "z", lazy.spawn("betterlockscreen --off 300 -t \"Computer is locked\" -l"), - desc="Lock screen" - ) + desc="Lock screen") ] # Workspaces name, keys

@@ -199,8 +158,7 @@ ("doc", {"layout": "columns"}),

("chat", {"layout": "columns"}), ("pass", {"layout": "columns"}), ("mus", {"layout": "max"}), - ("flo", {"layout": "columns"}) -] + ("flo", {"layout": "columns"})] groups = [Group(name, **kwargs) for name, kwargs in group_names] for i, (name, kwargs) in enumerate(group_names, 1): keys.append(Key([mod], str(i), lazy.group[name].toscreen()))

@@ -225,7 +183,7 @@ # layout.Floating(**layout_theme),

# layout.MonadWide(), # layout.RatioTile(), # layout.Tile(**layout_theme), - # layout.TreeTab(), + # layout.TreeTab(), # layout.VerticalTile(), # layout.Zoomy(), ]

@@ -277,7 +235,7 @@ ),

widget.Clock( format=" %d.%m.%Y", foreground=color[4] - )], 24 # Panel size + )], 24 # Panel size ))] # Drag floating layouts

@@ -308,8 +266,7 @@ {"wmclass": "makebranch"},

{"wmclass": "maketag"}, {"wname": "branchdialog"}, {"wname": "pinentry"}, - {"wmclass": "ssh-askpass"} -]) + {"wmclass": "ssh-askpass"}]) auto_fullscreen = True focus_on_window_activation = "smart" wmname = "LG3D"
M config/rofi/themes/nten-dmenu.rasi

@@ -7,6 +7,7 @@ selected-background: #008DCD;

selected-foreground: #ffffff; } #window { + location: north; width: 100%; height: 24px; padding: 0px;

@@ -25,8 +26,6 @@ }

#listview { layout: horizontal; spacing: 0px; - fixed-height: false; - dynamic: true; lines: 100; } #entry {
A rcrc

@@ -0,0 +1,2 @@

+EXCLUDES="README.md screen.png" +UNDOTTED="bin"
M script/dmenu/dmenu-config-edit.sh

@@ -2,15 +2,12 @@ #!/bin/sh

declare options=("exit i3 qtile -berry -openbox -dwm +bspwm alacritty kitty picom ranger qutebrowser -emacs nvim tmux dunst

@@ -18,61 +15,39 @@ castero

redshift rofi") -choice=$(echo -e "${options[@]}"|dmenu -p "Config edit" $@) +menucmd="rofi -location 2 -dmenu" +choice=$(echo -e "${options[@]}"|${menucmd} -p "Config edit" $@) case "$choice" in exit) exit 0 ;; i3) - case "$(echo -e "config\npolybar"|dmenu -p "I3wm" $@)" in + case "$(echo -e "config\npolybar"|${menucmd} -p "I3wm" $@)" in config) choice="$HOME/.config/i3/config" ;; polybar) choice="$HOME/.config/polybar/config" ;; esac ;; qtile) - case "$(echo -e "config\nautostart"|dmenu -p "Qtile" $@)" in + case "$(echo -e "config\nautostart"|${menucmd} -p "Qtile" $@)" in config) choice="$HOME/.config/qtile/config.py" ;; autostart) choice="$HOME/.config/qtile/autostart.sh" ;; esac ;; - berry) - case "$(echo -e "config\npolybar\nsxhkd"|dmenu -p "Berry" $@)" in - config) choice="$HOME/.config/berry/autostart" ;; - polybar) choice="$HOME/.config/berry/polybar/polybar" ;; - sxhkd) choice="$HOME/.config/berry/sxhkdrc" ;; - esac - ;; - openbox) - case "$(echo -e "config\nautostart\nmenu\ntint2"|dmenu -p "OpenBox" $@)" in - config) choice="$HOME/.config/openbox/rc.xml" ;; - autostart) choice="$HOME/.config/openbox/autostart" ;; - menu) choice="$HOME/.config/openbox/menu.xml" ;; - tint2) choice="$HOME/.config/tint2/tint2rc" ;; - esac - ;; - dwm) - case "$(echo -e "config\nautostart\nbar"|dmenu -p "DWM" $@)" in - config) choice="$HOME/.config/dwm/config.def.h " ;; - autostart) choice="$HOME/.config/dwm/autostart.sh" ;; - bar) choice="$HOME/.script/dwmbar.sh" ;; + bspwm) + case "$(echo -e "config\nsxhkd\npolybar"|${menucmd} -p "Bspwm" $@)" in + config) choice="$HOME/.config/bspwm/config" ;; + sxhkd) choice="$HOME/.config/bspwm/sxhkd" ;; + polybar) choice="$HOME/.config/bspwm/polybar" ;; esac ;; - alacritty) choice="$hoME/.config/alacritty.yml" ;; + alacritty) choice="$HOME/.config/alacritty.yml" ;; kitty) choice="$HOME/.config/kitty/kitty.conf" ;; picom) choice="$HOME/.config/picom.conf" ;; ranger) choice="$HOME/.config/ranger/rc.conf" ;; qutebrowser) - case "$(echo -e "config\nquickmarks"|dmenu -p "Qutebrowser" $@)" in + case "$(echo -e "config\nquickmarks"|${menucmd} -p "Qutebrowser" $@)" in config) choice="$HOME/.config/qutebrowser/config.py" ;; quickmarks) choice="$HOME/.config/qutebrowser/quickmarks" ;; esac ;; - emacs) - case "$(echo -e "config\ncustom\ninit\npackages"|dmenu -p "Doom emacs" $@)" in - config) choice="$HOME/.doom.d/config.el" ;; - init) choice="$HOME/.doom.d/init.el" ;; - custom) choice="$HOME/.doom.d/custom.el" ;; - packages) choice="$HOME/.doom.d/packages.el" ;; - esac - ;; nvim) choice="$HOME/.config/nvim/init.vim" ;; tmux) choice="$HOME/.tmux.conf" ;; dunst) choice="$HOME/.config/dunst/dunstrc" ;;

@@ -80,11 +55,10 @@ zsh) choice="$HOME/.zshrc" ;;

castero) choice="$HOME/.config/castero/castero.conf" ;; redshift) choice="$HOME/.config/redshift.conf" ;; rofi) - case "$(echo -e "config\nnten-dmenu"|dmenu -p "Rofi" $@)" in + case "$(echo -e "config\nnten-dmenu"|${menucmd} -p "Rofi" $@)" in config) choice="$HOME/.config/rofi/config" ;; nten-dmenu) choice="$HOME/.config/rofi/themes/nten-dmenu.rasi" ;; esac ;; esac alacritty -e nvim "$choice" -# emacsclient -c -a emacs "$choice"
A script/dmenu/dmenu-pass.sh

@@ -0,0 +1,17 @@

+#!/bin/sh +shopt -s nullglob globstar + +menucmd="rofi -location 2 -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
M script/dmenu/dmenu-power.sh

@@ -4,23 +4,24 @@ Lock

Logout Reboot") -choice=$(echo -e "${options[@]}"|dmenu -p "Power" $@) +menucmd="rofi -location 2 -dmenu" +choice=$(echo -e "${options[@]}"|${menucmd} -p "Power" $@) case "$choice" in "ShutDown") - case "$(echo -e "Yes\nNo"|dmenu -p "ShutDown" $@)" in + case "$(echo -e "Yes\nNo"|${menucmd} -p "ShutDown" $@)" 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"|dmenu -p "ShutDown" $@)" in + case "$(echo -e "Yes\nNo"|${menucmd} -p "ShutDown" $@)" in "Yes") exec loginctl terminate-session $XDG_SESSION_ID ;; "No") exec exit 0 ;; esac ;; "Reboot") - case "$(echo -e "Yes\nNo"|dmenu -p "Reboot" $@)" in + case "$(echo -e "Yes\nNo"|${menucmd} -p "Reboot" $@)" in "Yes") exec systemctl reboot ;; "No") exec exit 0 ;; esac
D script/dwmbar.sh

@@ -1,25 +0,0 @@

-#!/bin/sh -getDate() { - local date="$(date +%d.%m.%Y)" - echo " ${date}" -} -getTime() { - local time="$(date +%H:%M)" - echo " ${time}" -} -getVolume() { - local volume="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')" - echo " ${volume}" -} -getKeyLayout() { - case "$(xkblayout)" in - "Eng") echo " us" ;; - "Rus") echo " ru" ;; - "Ukr") echo " ua" ;; - esac -} - -while true; do - xsetroot -name " $(getVolume) | $(getKeyLayout) | $(getTime) | $(getDate)" - sleep 0 -done
D script/polybar-toggle

@@ -1,9 +0,0 @@

-#!/bin/sh -if [ $(pgrep polybar) ] -then - polybar i3bar >/dev/null - # ~/.config/i3/bar.sh -else - killall -q polybar - pkill polybar -fi
A script/random-wallpaper.sh

@@ -0,0 +1,7 @@

+#!/bin/sh +WALLPATH="~/Pictures/wallp" + +while true; do + feh --randomize --bg-scale $WALLPATH + sleep 900 +done
M script/snap-remove-old-pkg.sh

@@ -1,6 +1,5 @@

#!/bin/sh LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | -while read snapname revision -do +while read snapname revision; do sudo snap remove "$snapname" --revision="$revision" done
M tmux.conf

@@ -35,3 +35,11 @@ set -g status-style fg=colour110

set -g pane-border-style fg=colour240 set -g pane-active-border-style fg=colour39 set-window-option -g window-status-current-style fg=colour39 + +# VIM tmux navigation +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" +bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" +bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" +bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"