Update i3, bspwm config, add screenhot for bspwm

This commit is contained in:
Smirnov Olexandr 2021-02-24 15:56:14 +02:00
parent 5374db696a
commit b11c53f634
13 changed files with 102 additions and 159 deletions

View file

@ -1,7 +1,7 @@
<h1 align="center">dotfiles</h1>
![](./config/qtile/screen.png)
------------------------------
![](config/bspwm/screen.png)
----------------------------
#### System configuration
- `OS` Arch

10
config/bspwm/README.md Normal file
View file

@ -0,0 +1,10 @@
# BSPWM
[](screen.png)
--------------
### Install
```bash
sudo pacman -S bspwm sxhkd
yay -S polybar
```

View file

@ -49,7 +49,7 @@ bspc rule -a Thunar desktop='^4' focus=on follow=off
bspc rule -a Joplin desktop='^5' focus=on follow=on
bspc rule -a Simplenote desktop='^5' focus=on follow=on
bspc rule -a discord desktop='^6' focus=off follow=off
bspc rule -a telegram-desktop desktop='^6' focus=off follow=off
bspc rule -a telegram-desktop desktop='^6' focus=off follow=on
bspc rule -a KeePassXC desktop='^7' focus=on follow=off
bspc rule -a Spotify desktop='^9' focus=on follow=on
bspc rule -a google-tasks-desktop state=floating

BIN
config/bspwm/screen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 KiB

View file

@ -6,17 +6,16 @@ super + {_,shift} Return
{kitty, \
rofi -show drun -theme ntenV2}
super + shift + {w,f,e,c,v,q}
super + shift + {w,f,e,c,v,s,z,q}
{google-chrome-stable, \
alacritty --class=ranger -e ranger, \
alacritty --class=nvim -e nvim, \
kitty --class ranger -e ranger, \
kitty --class nvim -e nvim, \
code, \
veracrypt, \
.applications/simplenote.appimage, \
betterlockscreen --off 180 -t "Computer is locked" -l, \
xkill }
super + shift + z
betterlockscreen --off 180 -t "Computer is locked" -l
super + {equal, minus, shift+minus}
amixer sset Master {2%+,2%-,toggle}

View file

@ -16,22 +16,17 @@ new_float pixel
hide_edge_borders smart
############ Variables ###########
set $terminal alacritty
set $terminal kitty
set $browser google-chrome-stable
set $filemanager alacritty --title=ranger -e ranger
set $codeeditor alacritty --title=nvim -e nvim
set $filemanager kitty --class ranger -e ranger
set $codeeditor kitty --class nvim -e nvim
set $guicode code
############ Autostart ############
exec_always --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps"
exec_always --no-startup-id exec picom --experimental-backends -b
exec --no-startup-id exec picom -b
exec --no-startup-id exec nitrogen --restore
exec --no-startup-id exec lxsession
#exec --no-startup-id exec $HOME/.script/autolock
#exec --no-startup-id exec org.telegram.desktop
#exec --no-startup-id exec discord
#exec --no-startup-id exec redshift-gtk
#exec_always --no-startup-id exec $HOME/.config/i3/bar.sh
############## WM keys ############
@ -62,7 +57,7 @@ bindsym $mod+grave scratchpad show, floating disable
############## User key ###########
# Menus
bindsym $mod+Shift+Return exec rofi -show drun
bindsym $mod+Shift+Return exec rofi -show drun -theme ntenV2
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
@ -73,31 +68,32 @@ bindsym $mod+Shift+w exec $browser
bindsym $mod+Shift+f exec $filemanager
bindsym $mod+Shift+e exec $codeeditor
bindsym $mod+Shift+c exec $guicode
bindsym $mod+Shift+v exec veracrypt
bindsym $mod+Shift+s exec ~/.applications/simplenote.appimage
# 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
bindsym Shift+Print exec scrot /home/${USER}/$(date +%Y-%m-%d-%H-%M-%S).png
# Lockscreen
bindsym $mod+Shift+z exec betterlockscreen --off 180 -t "Computer is lockerd" -l
# Volume
bindsym $mod+plus exec "amixer sset Master 2%+"
bindsym $mod+minus exec "amixer sset Master 2%-"
bindsym $mod+Shift+minus exec "amixer sset Master toggle"
bindsym $mod+plus exec amixer sset Master 2%+
bindsym $mod+minus exec amixer sset Master 2%-
bindsym $mod+Shift+minus exec amixer sset Master toggle
######### Window preferens ########
assign [class="(?i)alacritty|kitty"] $ws1
assign [class="(?i)firefox|google-chorome-stable"] $ws2
assign [class="(?i)code|vscodium|subl"] $ws3
assign [title="nvim"] $ws3
assign [class="(?!)thunar"] $ws4
assign [title="ranger"] $ws4
assign [title="Joplin"] $ws5
assign [class="(?i)telegram|discord"] $ws6
assign [class="(?i)google-chrome-stable|firefox"] $ws2
assign [class="Code|nvim"] $ws3
assign [class="Thunar|ranger"] $ws4
assign [class="Joplin|Simplenote"] $ws5
assign [class="TelegramDesktop|discord"] $ws6
for_window [class="TelegramDesktop|discord"] layout tabbed
assign [class="KeePassXC"] $ws7
assign [class="Spotify"] $ws9
for_window [title="Google Tasks"] floating enable
for_window [class="(?i)telegram|discord"] layout tabbed
focus_on_window_activation focus
########## Change focus ###########
@ -164,7 +160,7 @@ bindsym $mod+Shift+9 move container to workspace $ws9
############### Bar ###############
bar {
# status_command i3status -c ~/.config/i3/i3status
status_command i3blocks -c ~/.config/i3/i3blocks
status_command i3status-rs ~/.config/i3/i3status-rs.toml
font pango:JetBrains Mono 10
position top
colors {

View file

@ -1,31 +0,0 @@
separator=true
separator_block_width=15
[keyboard]
command=$HOME/.script/kblayout
label=
interval=repeat
[volume]
command=$HOME/.script/volume
interval=repeat
label=
signal=10
[weather]
command=python $HOME/.config/polybar/scripts/weather.py
interval=10
[wiki-signal]
command=$HOME/.config/polybar/scripts/wifi-signal.sh
label=
interval=5
[updates-arch]
command=$HOME/.config/polybar/scripts/updates-pacman-aur.sh
interval=60
[time]
command=date +%H:%M
label=
interval=60

40
config/i3/i3status Normal file
View file

@ -0,0 +1,40 @@
# vim: ft=conf
general {
colors = false
interval = 1
output_format = "i3bar"
}
order += "volume master"
order += "wireless _first_"
#order += "battery all"
order += "tztime local"
volume master {
format = " %volume"
format_muted = " %volume"
device = "default"
mixer = "Master"
mixer_idx = 2
}
wireless _first_ {
format_up = "%quality"
format_down = "W: down"
}
battery all {
format = "%status %percentage"
last_full_capacity = true
format_down = "No battery"
status_chr = ""
status_bat = ""
status_unk = "? UNK"
status_full = ""
path = "/sys/class/power_supply/BAT%d/uevent"
low_threshold = 10
}
tztime local {
format = " %d %b  %H:%M"
}

View file

@ -1,39 +1,21 @@
theme = "native"
icons = "awesome5"
#icons = "awesome5"
### CPU load
[[block]]
block = "cpu"
interval = 5
### Blacklight
[[block]]
block = "backlight"
device = "intel_backlight"
### Volume
[[block]]
block = "sound"
step_width = 2
### WiFi signal
#[[block]]
#block = "custom"
#command = "cat /proc/net/wireless | grep \"wlp3s0\" | awk '{print $4}' | grep -o '[0-9]*'"
#interval = 10
### Keyboard layout
[[block]]
block = "custom"
command = "~/.script/kblayout"
interval = 0
command = """
case "$(xkblayout)" in
Eng) echo "us" ;;
Ukr) echo "ua" ;;
esac"""
### Date && time
[[block]]
block = "sound"
[[block]]
block = "net"
device = "wlp3s0"
format = "{signal_strength}"
interval = 4
[[block]]
block = "time"
interval = 60
format = "%H:%M"
format = "%R"

View file

@ -3,7 +3,6 @@ call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'maxboisvert/vim-simple-complete'
Plug 'preservim/nerdcommenter'
Plug 'sheerun/vim-polyglot'
call plug#end()
@ -102,16 +101,13 @@ let g:lightline = {
\ [ 'filename', 'filetype' ] ] }
\ }
let g:NERDCreateDefaultMappings = 1
let g:NERDSpaceDelims = 1
let g:NERDCompactSexyComs = 1
"== Mapping
let mapleader="'"
" Alternative keys
noremap <C-s> :w<CR>
noremap <C-n> :tabnew<CR>
noremap <C-t> :tabnew<CR>
noremap <leader>ww :Wiki<CR>
noremap <leader>e :Ve<CR>

View file

@ -1,53 +0,0 @@
#!/usr/bin/env bash
if [[ -z "$MIXER" ]] ; then
MIXER="default"
if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
if amixer -D pulse info >/dev/null 2>&1 ; then
MIXER="pulse"
fi
fi
[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
MIXER="${2:-$MIXER}"
fi
if [[ -z "$SCONTROL" ]] ; then
SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |
head -n1
)}"
fi
if [[ -z "$STEP" ]] ; then
STEP="${1:-5%}"
fi
NATURAL_MAPPING=${NATURAL_MAPPING:-0}
if [[ "$NATURAL_MAPPING" != "0" ]] ; then
AMIXER_PARAMS="-M"
fi
capability() {
amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |
sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
}
volume() {
amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)
}
format() {
perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
perl_filter+='{CORE::say $4 eq "off" ? "M" : "'
perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
perl_filter+='"; exit}'
output=$(perl -ne "$perl_filter")
echo "$LABEL$output"
}
case $BLOCK_BUTTON in
3) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;;
4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;;
5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;;
esac
volume | format

View file

@ -116,5 +116,7 @@
"git.autofetch": true,
"editor.formatOnPaste": true,
"editor.minimap.enabled": false,
"tabnine.experimentalAutoImports": true,
"git.confirmSync": false,
}

8
zshrc
View file

@ -24,18 +24,20 @@ export VISUAL="nvim"
### Functions
bgcolor() {
convert -size 1x1 xc:"#$1" /tmp/bgc.png
feh --bg-tile /tmp/bgc.png}
feh --bg-tile /tmp/bgc.png
}
backup() {
cp $1 $1.bak}
cp $1 $1.bak
}
### Aliases
alias cls="clear"
alias mkdir="mkdir -p"
alias cp="cp -r"
alias du="du -sh"
alias df="df -h"
alias vim="nvim"
alias vi="vim"
alias d="docker"
alias wiki="vi +Wiki"
alias tmux="tmux -2"
alias :q="exit"