From c7da10d0769ef7ed07f426894c86d4aa8be26d2b Mon Sep 17 00:00:00 2001 From: Smirnov Olexandr Date: Sun, 24 Jan 2021 23:08:44 +0200 Subject: [PATCH] Update alacritty, kitty, bspwm, i3wm, vim,tmux configs & sctipts --- config/alacritty.yml | 5 +- config/bspwm/bspwmrc | 43 ++++---- config/bspwm/polybar | 6 +- config/bspwm/sxhkd | 28 ++++-- config/i3/bar.sh | 2 +- config/i3/config | 16 ++- config/kitty/kitty.conf | 10 +- config/nvim/init.vim | 51 +++++++--- config/nvim/snips/sh.snippets | 8 +- config/polybar/config | 68 ++++++++----- config/polybar/scripts/weather.py | 11 +- config/qtile/config.py | 155 +++++++++++------------------ config/rofi/themes/nten-dmenu.rasi | 3 +- rcrc | 2 + script/dmenu/dmenu-config-edit.sh | 52 +++------- script/dmenu/dmenu-pass.sh | 17 ++++ script/dmenu/dmenu-power.sh | 9 +- script/dwmbar.sh | 25 ----- script/polybar-toggle | 9 -- script/random-wallpaper.sh | 7 ++ script/snap-remove-old-pkg.sh | 3 +- tmux.conf | 8 ++ 22 files changed, 256 insertions(+), 282 deletions(-) create mode 100644 rcrc create mode 100755 script/dmenu/dmenu-pass.sh delete mode 100755 script/dwmbar.sh delete mode 100755 script/polybar-toggle create mode 100644 script/random-wallpaper.sh diff --git a/config/alacritty.yml b/config/alacritty.yml index 190987e..b12d1c4 100644 --- a/config/alacritty.yml +++ b/config/alacritty.yml @@ -36,9 +36,10 @@ cursor: 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: diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index edfcad4..b5e3fa6 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -2,9 +2,10 @@ # Smirnov-O # 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 diff --git a/config/bspwm/polybar b/config/bspwm/polybar index 0a5a101..ac9a1dd 100644 --- a/config/bspwm/polybar +++ b/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 diff --git a/config/bspwm/sxhkd b/config/bspwm/sxhkd index f817fa0..9948629 100644 --- a/config/bspwm/sxhkd +++ b/config/bspwm/sxhkd @@ -1,17 +1,18 @@ # Smirnov-O # 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 + d 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,14 +57,11 @@ 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} bspc node -{f,s} {west,south,north,east} diff --git a/config/i3/bar.sh b/config/i3/bar.sh index 5ef8304..23fa6a2 100755 --- a/config/i3/bar.sh +++ b/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 & diff --git a/config/i3/config b/config/i3/config index 985e65f..435acdb 100644 --- a/config/i3/config +++ b/config/i3/config @@ -54,8 +54,8 @@ bindsym $mod+Control+w layout tabbed 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 @@ bindsym $mod+grave scratchpad show, floating disable ############## 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 @@ -78,9 +77,6 @@ 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 bindsym --release Shift+Print exec scrot /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 4ef4e7c..b84e71c 100644 --- a/config/kitty/kitty.conf +++ b/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 @@ map alt+ctrl+backspace change_font_size all 0 # 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 diff --git a/config/nvim/init.vim b/config/nvim/init.vim index aae0c4f..50e79aa 100644 --- a/config/nvim/init.vim +++ b/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']} + + " Language support + Plug 'othree/yajs.vim', {'for': 'javascript'} + Plug 'maxmellon/vim-jsx-pretty', {'for': 'javascript'} - " Programing - Plug 'metakirby5/codi.vim' - Plug 'plasticboy/vim-markdown', {'for': 'markdown'} 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 @@ let g:python_highlight_class_vars = 1 " 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='' +let g:user_emmet_mode='inv' " UltiSnipts let g:UltiSnipsExpandTrigger = "" @@ -157,5 +178,5 @@ noremap :tabn 8 noremap :tabn 9 " Buffer(s) -noremap p :bnext -noremap o :bprev +noremap b :bnext +noremap p :bprev diff --git a/config/nvim/snips/sh.snippets b/config/nvim/snips/sh.snippets index afa28f2..d4cbe0d 100644 --- a/config/nvim/snips/sh.snippets +++ b/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 diff --git a/config/polybar/config b/config/polybar/config index 89069c9..57a5119 100644 --- a/config/polybar/config +++ b/config/polybar/config @@ -13,7 +13,6 @@ alert = #FF6C6B 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 = +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 @@ -73,22 +103,6 @@ blacklist-0 = num lock blacklist-1 = scroll lock blacklist-2= caps lock -[module/menu] -type = custom/menu -format = -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 interval = 600 diff --git a/config/polybar/scripts/weather.py b/config/polybar/scripts/weather.py index 84e05cb..7277b14 100755 --- a/config/polybar/scripts/weather.py +++ b/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 @@ CITY = os.getenv("OWM_CITY") 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 °С") diff --git a/config/qtile/config.py b/config/qtile/config.py index 870c04d..87e86c3 100644 --- a/config/qtile/config.py +++ b/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 @@ def autostart(): 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 @@ group_names = [("term", {"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 @@ layouts = [ # layout.MonadWide(), # layout.RatioTile(), # layout.Tile(**layout_theme), - # layout.TreeTab(), + # layout.TreeTab(), # layout.VerticalTile(), # layout.Zoomy(), ] @@ -277,7 +235,7 @@ screens = [Screen(top=bar.Bar([ widget.Clock( format=" %d.%m.%Y", foreground=color[4] - )], 24 # Panel size + )], 24 # Panel size ))] # Drag floating layouts @@ -308,8 +266,7 @@ floating_layout = layout.Floating( {"wmclass": "maketag"}, {"wname": "branchdialog"}, {"wname": "pinentry"}, - {"wmclass": "ssh-askpass"} -]) + {"wmclass": "ssh-askpass"}]) auto_fullscreen = True focus_on_window_activation = "smart" wmname = "LG3D" diff --git a/config/rofi/themes/nten-dmenu.rasi b/config/rofi/themes/nten-dmenu.rasi index 2abd9c7..b224b42 100644 --- a/config/rofi/themes/nten-dmenu.rasi +++ b/config/rofi/themes/nten-dmenu.rasi @@ -7,6 +7,7 @@ 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 { diff --git a/rcrc b/rcrc new file mode 100644 index 0000000..5cba0cb --- /dev/null +++ b/rcrc @@ -0,0 +1,2 @@ +EXCLUDES="README.md screen.png" +UNDOTTED="bin" diff --git a/script/dmenu/dmenu-config-edit.sh b/script/dmenu/dmenu-config-edit.sh index 5e659e2..5f3e3ca 100755 --- a/script/dmenu/dmenu-config-edit.sh +++ b/script/dmenu/dmenu-config-edit.sh @@ -2,15 +2,12 @@ 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" ;; + 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 ;; - 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" ;; - 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 @@ case "$choice" in 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" diff --git a/script/dmenu/dmenu-pass.sh b/script/dmenu/dmenu-pass.sh new file mode 100755 index 0000000..ffb1eec --- /dev/null +++ b/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 diff --git a/script/dmenu/dmenu-power.sh b/script/dmenu/dmenu-power.sh index f04c909..1b51662 100755 --- a/script/dmenu/dmenu-power.sh +++ b/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 diff --git a/script/dwmbar.sh b/script/dwmbar.sh deleted file mode 100755 index a951d8c..0000000 --- a/script/dwmbar.sh +++ /dev/null @@ -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 diff --git a/script/polybar-toggle b/script/polybar-toggle deleted file mode 100755 index 7ae0373..0000000 --- a/script/polybar-toggle +++ /dev/null @@ -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 diff --git a/script/random-wallpaper.sh b/script/random-wallpaper.sh new file mode 100644 index 0000000..19f5f9c --- /dev/null +++ b/script/random-wallpaper.sh @@ -0,0 +1,7 @@ +#!/bin/sh +WALLPATH="~/Pictures/wallp" + +while true; do + feh --randomize --bg-scale $WALLPATH + sleep 900 +done diff --git a/script/snap-remove-old-pkg.sh b/script/snap-remove-old-pkg.sh index c816e81..bb6cde1 100755 --- a/script/snap-remove-old-pkg.sh +++ b/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 diff --git a/tmux.conf b/tmux.conf index 8b011f7..511f7fe 100644 --- a/tmux.conf +++ b/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"