📝 Add keyboard indecator for qtile, dmne theme for rofi. Update nvim, ranger

This commit is contained in:
Smirnov Olexandr 2020-12-11 19:39:37 +02:00
parent 4f3a929be0
commit 917b69171d
18 changed files with 195 additions and 88 deletions

View file

@ -1,18 +1,21 @@
<h1 align="center">dotfiles</h1> <h1 align="center">dotfiles</h1>
![](./config/qtile/screen.png)
------------------------------
#### System configuration #### System configuration
- `OS` Manjaro - `OS` Arch
- `WM` Openbox, berry, i3-gaps, qtile, spectrwm - `WM` Qtile
- `Shell` zsh, fish - `Terminal` Kitty
- `Shell` zsh
- `Editor` nvim - `Editor` nvim
- `Browser` firefox, qutebowser, chromium - `Browser` firefox
- `Font` Jatbrains Mono - `Font` Jatbrains Mono
- `Icon font` FontAwesome5 - `Icon font` FontAwesome5
- `Launcher` dmenu, rofi - `Launcher` dmenu, rofi
#### Install configs #### Install configs
Since i use **rcm** set it Since i use **[rcm](https://github.com/thoughtbot/rcm)** set it
~~~bash ~~~bash
yay -S rcm yay -S rcm
~~~ ~~~

26
config/nvim/README.md Normal file
View file

@ -0,0 +1,26 @@
# nvim
![](screen.png)
---------------
To manage plugins, I use [vim plug](https://github.com/junegunn/vim-plug). I use the following plugins:
- `nten16.vim`: Colorschemes
- `lightline`: Status bar
- `vim-indent-guides`: Visually displaying indent levels
- `vim-easymotion`: Fast navigation
- `nerdtree`: File manager
- `vim-devicons`: Icons for nerdtree
- `ctrlp.vim`: File saecher
- `auto-pairs`: Close brackets, parens, quotes
- `coc.nvim`: Instant completion
- `emmet-vim`: Emmet :D
- `vim-javascript`: Syntax support for JS
- `i3-vim-syntax`: Syntax support for i3
- `sxhkd-vim`: Syntax support for sxhkd
- `vim-scheme`: Syntax support for scheme
- `scss-syntax.vim`: Syntax support for scss
- `vim-fist`: Syntax support for fish
- `vim-css-color`: Color name highlighter
- `vim-markdown`: Syntax support for fish
- `markdown-preview.nvim`: Preview markdown in real-time
- `vim-table-mode`: Automatic markdown table creator & formatter

View file

@ -1,8 +1,8 @@
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
Plug 'overcache/NeoSolarized'
Plug 'ericbn/vim-solarized'
Plug 'ryanoasis/vim-devicons' Plug 'ryanoasis/vim-devicons'
Plug 'itchyny/lightline.vim' Plug 'itchyny/lightline.vim'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'Smirnov-O/nten16.vim'
Plug 'iamcco/markdown-preview.nvim' Plug 'iamcco/markdown-preview.nvim'
Plug 'dhruvasagar/vim-table-mode' Plug 'dhruvasagar/vim-table-mode'
Plug 'easymotion/vim-easymotion' Plug 'easymotion/vim-easymotion'
@ -17,10 +17,10 @@ call plug#begin('~/.vim/plugged')
" Language support " Language support
Plug 'pangloss/vim-javascript', { 'for': 'javascript' } Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
Plug 'pearofducks/ansible-vim', { 'for': 'ansible' }
Plug 'PotatoesMaster/i3-vim-syntax', { 'for': 'i3' } Plug 'PotatoesMaster/i3-vim-syntax', { 'for': 'i3' }
Plug 'kovetskiy/sxhkd-vim', { 'for': 'sxhkd' } Plug 'kovetskiy/sxhkd-vim', { 'for': 'sxhkd' }
Plug 'mattn/emmet-vim', { 'on': 'Emmet' } Plug 'mattn/emmet-vim', { 'on': 'Emmet' }
Plug 'Olical/vim-scheme', { 'for': 'scheme' }
Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' } Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' }
Plug 'dag/vim-fish', { 'for': 'fish' } Plug 'dag/vim-fish', { 'for': 'fish' }
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' } Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
@ -70,14 +70,14 @@ set visualbell t_vb=
set termguicolors set termguicolors
set background=dark set background=dark
colorscheme NeoSolarized colorscheme nten16
" == Plugins configure " == Plugins configure
" Lightline " Lightline
set noshowmode set noshowmode
let g:lightline = { let g:lightline = {
\ 'colorscheme': 'selenized_dark', \ 'colorscheme': 'nten16',
\ 'active': { \ 'active': {
\ 'left': [ [ 'mode', 'paste' ], \ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'modified' ] ], \ [ 'readonly', 'modified' ] ],
@ -113,8 +113,11 @@ map <C-p> :CtrlP<CR>
imap <C-p> :CtrlP<CR> imap <C-p> :CtrlP<CR>
nmap <C-p> :CtrlP<CR> nmap <C-p> :CtrlP<CR>
" Indent guides
let g:indent_guides_enable_on_vim_startup = 1
" == Maping " == Maping
imap fd <Esc> "imap fd <Esc>
let mapleader="," let mapleader=","
" Change window " Change window

BIN
config/nvim/screen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

View file

@ -12,7 +12,6 @@ if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
fi fi
updates=$(("$updates_arch" + "$updates_aur")) updates=$(("$updates_arch" + "$updates_aur"))
if [ "$updates" -gt 0 ]; then if [ "$updates" -gt 0 ]; then
echo "$updates" echo "$updates"
else else

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
import requests, os import requests
import os
API_KEY = os.getenv("OWM_POLYBAR") API_KEY = os.getenv("OWM_POLYBAR")

View file

@ -1,13 +1,13 @@
# Qtile config # Qtile config
![Screenhot](screen.png) ![](screen.png)
------------------------ ---------------
### Install ### Install
----------- -----------
~~~shell ~~~shell
sudo pacman -S qtile sudo pacman -S qtile
yay -S kbdd-git yay -S xkblayout
~~~ ~~~
### Autostart ### Autostart
@ -17,12 +17,11 @@ setxkbmap "us,ru,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps"
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
nitrogen --restore nitrogen --restore
picom -b picom -b
kbdd
~~~~ ~~~~
### Keybindings ### Keybindings
| Hotkey | Action | | Hotkey | Action |
| -------------- | --------------- | | --- | --- |
| MOD + RETURN | Open termianl | | MOD + RETURN | Open termianl |
| MOD + SHIFT + RETURN | Open program launcher(rofi) | | MOD + SHIFT + RETURN | Open program launcher(rofi) |
| MOD + r | Open qtile spawn menu | | MOD + r | Open qtile spawn menu |

View file

@ -3,4 +3,3 @@ setxkbmap "us,ru,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps"
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
nitrogen --restore & nitrogen --restore &
picom -b & picom -b &
kbdd &

View file

@ -2,6 +2,7 @@ from libqtile import bar, layout, widget, hook
from libqtile.config import Click, Drag, Group, Key, Screen from libqtile.config import Click, Drag, Group, Key, Screen
from libqtile.lazy import lazy from libqtile.lazy import lazy
from typing import List from typing import List
import kblayout
import os import os
@ -29,7 +30,6 @@ color = [
@hook.subscribe.startup_once @hook.subscribe.startup_once
def autostart(): os.system("~/.config/qtile/autostart.sh") def autostart(): os.system("~/.config/qtile/autostart.sh")
keys = [ keys = [
# Applications # Applications
Key([mod], "Return", Key([mod], "Return",
@ -88,7 +88,6 @@ keys = [
), ),
Key([mod, "control"], "h", Key([mod, "control"], "h",
lazy.layout.grow_left(), lazy.layout.grow_left(),
#lazy.layout.grow()),
desc="Resize focus window(left)" desc="Resize focus window(left)"
), ),
Key([mod, "control"], "j", Key([mod, "control"], "j",
@ -101,7 +100,6 @@ keys = [
), ),
Key([mod, "control"], "l", Key([mod, "control"], "l",
lazy.layout.grow_right(), lazy.layout.grow_right(),
#lazy.layout.shrink()
desc="Resize focus window(right)" desc="Resize focus window(right)"
), ),
@ -135,12 +133,12 @@ keys = [
# Menus(dmenu or/and rofi) # Menus(dmenu or/and rofi)
Key([mod, "shift"], "Return", Key([mod, "shift"], "Return",
lazy.spawn("j4-dmenu-desktop --dmenu=\"dmenu -h 24 -p Run\""), lazy.spawn("rofi -show drun"),
desc="(j4-dmenu) Program launcher" desc="(Rofi) Program launcher"
), ),
Key([mod, "shift"], "apostrophe", Key([mod, "shift"], "apostrophe",
lazy.spawn("dmenu_run -h 24 -p Run"), lazy.spawn("rofi -show run"),
desc="(Dmenu) Program launcher" desc="(Rofi) Program launcher"
), ),
Key([mod],"Escape", Key([mod],"Escape",
lazy.spawn(f"/home/{user}/.script/dmenu/dmenu-power.sh"), lazy.spawn(f"/home/{user}/.script/dmenu/dmenu-power.sh"),
@ -243,11 +241,10 @@ screens = [Screen(top=bar.Bar([
), ),
widget.Prompt(foreground=color[0]), widget.Prompt(foreground=color[0]),
widget.WindowName(foreground=color[0]), widget.WindowName(foreground=color[0]),
widget.KeyboardKbdd( kblayout.KBLayout(
foreground=color[5], foreground=color[5],
configured_keyboards=["us", "ru", "ua"],
update_interval=0, update_interval=0,
fmt="{}", fmt="{}"
), ),
widget.CurrentLayout( widget.CurrentLayout(
foreground=color[8] foreground=color[8]
@ -285,21 +282,23 @@ main = None
follow_mouse_focus = True follow_mouse_focus = True
bring_front_click = False bring_front_click = False
cursor_warp = False cursor_warp = False
floating_layout = layout.Floating(float_rules=[ floating_layout = layout.Floating(
{"wmclass": "confirm"}, **layout_theme,
{"wmclass": "dialog"}, float_rules=[
{"wmclass": "download"}, {"wmclass": "confirm"},
{"wmclass": "error"}, {"wmclass": "dialog"},
{"wmclass": "file_progress"}, {"wmclass": "download"},
{"wmclass": "notification"}, {"wmclass": "error"},
{"wmclass": "splash"}, {"wmclass": "file_progress"},
{"wmclass": "toolbar"}, {"wmclass": "notification"},
{"wmclass": "confirmreset"}, {"wmclass": "splash"},
{"wmclass": "makebranch"}, {"wmclass": "toolbar"},
{"wmclass": "maketag"}, {"wmclass": "confirmreset"},
{"wname": "branchdialog"}, {"wmclass": "makebranch"},
{"wname": "pinentry"}, {"wmclass": "maketag"},
{"wmclass": "ssh-askpass"}, {"wname": "branchdialog"},
{"wname": "pinentry"},
{"wmclass": "ssh-askpass"},
]) ])
auto_fullscreen = True auto_fullscreen = True
focus_on_window_activation = "smart" focus_on_window_activation = "smart"

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

6
config/qtile/kblay.sh Executable file
View file

@ -0,0 +1,6 @@
#/bin/sh
case "$(xkblayout)" in
"Eng") echo "us" ;;
"Rus") echo "ru" ;;
"Ukr") echo "ua" ;;
esac

23
config/qtile/kblayout.py Normal file
View file

@ -0,0 +1,23 @@
from libqtile.widget import base
import os
class KBLayout(base.InLoopPollText):
"""Widget for displaying the current keyboard layout
It requires setxkbmap and xkblayout"""
orientations = base.ORIENTATION_HORIZONTAL
defaults = [
("background", "#000000", "Backbround color"),
("foreground", "#ffffff", "Foreground color"),
]
def __init__(self, **config):
base.InLoopPollText.__init__(self, **config)
def get_keyboard(self):
kb = os.popen("xkblayout").read().rstrip("\n")
return kb
def poll(self):
kb = os.popen(".config/qtile/kblay.sh").read().rstrip('\n').encode('utf-8').decode('utf-8')
return kb

View file

@ -24,9 +24,8 @@ set vcs_msg_length 30
### Preview ### Preview
set preview_images true set preview_images true
set preview_images_method ueberzug set preview_images_method kitty
set w3m_delay 0.02 #set preview_images_method ueberzug
set w3m_offset 0
set unicode_ellipsis false set unicode_ellipsis false
set bidi_support false set bidi_support false
@ -89,26 +88,33 @@ set nested_ranger_warning true
# Command Aliases in the Console # Command Aliases in the Console
################################# #################################
map E edit
map F set freeze_files!
# "a" key # "a" key
map a rename_append map a rename_append
map a
map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%")) map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
map as shell zip -rf 'file.zip' %s
map ad shell tar -czvf file.tar.gz %s
map az extract
map ax extract_to_dirs
map ac compress
# "q"/quit keys
map Q quitall
map q quit
map <C-c> abort
# quit alias
map ex extract alias q quit
map ed extract_to_dirs
map ec compress
alias e edit
alias q quit alias q quit
alias q! quit! alias q! quit!
alias qa quitall alias qa quitall
alias qa! quitall! alias qa! quitall!
alias qall quitall
alias qall! quitall!
alias setl setlocal alias setl setlocal
alias e edit
# scout alias
alias filter scout -prts alias filter scout -prts
alias find scout -aets alias find scout -aets
alias mark scout -mr alias mark scout -mr
@ -117,17 +123,14 @@ alias search scout -rs
alias search_inc scout -rts alias search_inc scout -rts
alias travel scout -aefklst alias travel scout -aefklst
map Q quitall # Restart/reload fm
map q quit
copymap q ZZ ZQ
map R reload_cwd map R reload_cwd
map F set freeze_files!
map <C-r> reset map <C-r> reset
map <C-l> redraw_window
map <C-c> abort # Modes
map <esc> change_mode normal
map ~ set viewmode! map ~ set viewmode!
map <C-l> redraw_window
map <esc> change_mode normal
map i display_file map i display_file
map <A-j> scroll_preview 1 map <A-j> scroll_preview 1
@ -158,9 +161,6 @@ map Ms linemode sizemtime
map MH linemode sizehumanreadablemtime map MH linemode sizehumanreadablemtime
map Mt linemode metatitle map Mt linemode metatitle
map t tag_toggle
map ut tag_remove
map "<any> tag_toggle tag=%any
map <Space> mark_files toggle=True map <Space> mark_files toggle=True
map v mark_files all=True toggle=True map v mark_files all=True toggle=True
map uv mark_files all=True val=False map uv mark_files all=True val=False
@ -201,15 +201,23 @@ map } traverse
map { traverse_backwards map { traverse_backwards
map ) jump_non map ) jump_non
# Go keys
map gh cd ~ map gh cd ~
map gr cd / map gd cd ~/Code
map gd cd ~/code map gd cd ~/Documents
map gb cd ~/Documents/Books
map dl cd ~/.dotfiles
map E edit
map cw console rename%space
map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
# File keys
map dD shell mv %s /home/${USER}/.local/share/Trash/files/
map dd cut
map ud uncut
map da cut mode=add
map dr cut mode=remove
map dt cut mode=toggle
map pp paste map pp paste
map po paste overwrite=True map po paste overwrite=True
map pP paste append=True map pP paste append=True
@ -222,15 +230,6 @@ map pd console paste dest=
map p`<any> paste dest=%any_path map p`<any> paste dest=%any_path
map p'<any> paste dest=%any_path map p'<any> paste dest=%any_path
#map dD console delete
map dD shell mv %s /home/${USER}/.local/share/Trash/files/
map dT console trash
map dd cut
map ud uncut
map da cut mode=add
map dr cut mode=remove
map dt cut mode=toggle
map yy copy map yy copy
map uy uncut map uy uncut
@ -247,6 +246,7 @@ map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
# Search keys
map / console search%space map / console search%space
map n search_next map n search_next
map N search_next forward=False map N search_next forward=False
@ -257,16 +257,18 @@ map cc search_next order=ctime
map cm search_next order=mtime map cm search_next order=mtime
map ca search_next order=atime map ca search_next order=atime
# Tab keys
map <C-n> tab_new map <C-n> tab_new
map <C-w> tab_close map <C-w> tab_close
map <TAB> tab_move 1 map <TAB> tab_move 1
map <S-TAB> tab_move -1 map <S-TAB> tab_move -1
map <A-Right> tab_move 1 map <A-Right> tab_move 1
map <A-Left> tab_move -1 map <A-Left> tab_move -1
map gt tab_move 1 map tn tab_new
map gT tab_move -1 map tc tab_close
map gn tab_new map tt tag_toggle
map gc tab_close map ut tag_remove
map "<any> tag_toggle tag=%any
map uq tab_restore map uq tab_restore
map <a-1> tab_open 1 map <a-1> tab_open 1
map <a-2> tab_open 2 map <a-2> tab_open 2

View file

@ -1,4 +1,7 @@
rofi.theme: solarized rofi.theme: nten-dmenu
rofi.font: Jetbarains Mono 12 rofi.font: Jetbarains Mono 12
rofi.auto-select: false rofi.auto-select: false
rofi.hide-scrollbar: true rofi.hide-scrollbar: true
rofi.drun-display-format: {name}
rofi.display-drun: Run
rofi.display-run: Run

View file

@ -0,0 +1,40 @@
* {
background-color: #262A2B;
text-color: #93A1A1;
font: "Hack 9";
prompt-padding: 4px;
selected-background: #008DCD;
selected-foreground: #ffffff;
}
#window {
location: north;
width: 100%;
height: 24px;
padding: 0px;
children: [ horibox ];
}
#horibox {
orientation: horizontal;
children: [ prompt, entry, listview ];
}
#prompt {
padding: @prompt-padding;
background-color: @selected-background;
text-color: @selected-foreground;
font: @font;
}
#listview {
layout: horizontal;
spacing: 0px;
lines: 100;
}
#entry {
padding: 4px 4px;
expand: false;
width: 170px;
}
#element { padding: 4px 8px; }
#element selected {
background-color: @selected-background;
text-color: @selected-foreground;
}

6
zshrc
View file

@ -1,4 +1,5 @@
export ZSH="/home/sasha/.oh-my-zsh" export ZSH="$HOME/.oh-my-zsh"
export PATH="$HOME/bin:$PATH"
source ~/.env source ~/.env
source ~/.profile source ~/.profile
@ -41,3 +42,6 @@ alias .6="cd ../../../../../.."
alias tozsh="chsh -s /bin/zsh && echo 'Now log out.'" alias tozsh="chsh -s /bin/zsh && echo 'Now log out.'"
alias tofish="chsh -s /bin/fish && echo 'Now log out.'" alias tofish="chsh -s /bin/fish && echo 'Now log out.'"
alias tobash="chsh -s /bin/bash && echo 'Now log out.'" alias tobash="chsh -s /bin/bash && echo 'Now log out.'"
### Pfetch ###
pfetch