From 946566abc62313f68c2846f089560f5d999abbeb Mon Sep 17 00:00:00 2001 From: Smirnov Alexandr Date: Thu, 25 Mar 2021 11:08:58 +0200 Subject: [PATCH] Add alt+f4 to sxhkd, update polybar scripts --- config/bspwm/README.md | 2 +- config/bspwm/bspwmrc | 7 +++---- config/bspwm/polybar/polybar | 4 ++-- .../polybar/scripts/updates-pacman-aur.sh | 6 +----- config/bspwm/polybar/scripts/weather.py | 5 ++++- config/bspwm/polybar/scripts/wifi-signal.sh | 5 ++++- config/bspwm/sxhkd | 18 +++++++++++------- config/nvim/init.vim | 2 +- 8 files changed, 27 insertions(+), 22 deletions(-) diff --git a/config/bspwm/README.md b/config/bspwm/README.md index 13056ba..0a64c33 100644 --- a/config/bspwm/README.md +++ b/config/bspwm/README.md @@ -5,6 +5,6 @@ ### Install ```bash -sudo pacman -S bspwm sxhkd +sudo pacman -S bspwm sxhkd kitty yay -S polybar ``` diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index 25fb3bf..d4e84fc 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -1,13 +1,13 @@ #!/bin/sh ###== Functions -A() { +A() { # AutoStart if ! pgrep $1 then $@& fi } -C() { +C() { # BSPWM config bspc config $@ } -R() { +R() { # BSPWM rule bspc rule -a $@ } @@ -41,7 +41,6 @@ C urgent_border_color "#FF6C6B" ###== BSPWM Rules R kitty desktop='^1' focus=on follow=on R Google-chrome desktop='^2' focus=on follow=on -R LibreWolf desktop='^2' focus=on follow=on R Code desktop='^3' focus=on follow=on R '*:nvim' desktop='^3' focus=on follow=off R Todoist desktop='^4' focus=on follow=off diff --git a/config/bspwm/polybar/polybar b/config/bspwm/polybar/polybar index cac1a36..10a7b56 100644 --- a/config/bspwm/polybar/polybar +++ b/config/bspwm/polybar/polybar @@ -23,7 +23,7 @@ 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-right = keyboard pulseaudio archupd wifi-signal tray-position = right tray-padding = 0 @@ -37,7 +37,7 @@ 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 time wifi-signal +modules-right = keyboard pulseaudio archupd time wifi-signal tray-position = right [module/bspwm] diff --git a/config/bspwm/polybar/scripts/updates-pacman-aur.sh b/config/bspwm/polybar/scripts/updates-pacman-aur.sh index fa05565..e964beb 100755 --- a/config/bspwm/polybar/scripts/updates-pacman-aur.sh +++ b/config/bspwm/polybar/scripts/updates-pacman-aur.sh @@ -1,13 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then updates_arch=0 fi if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then -# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then -# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then -# if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then -# if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then updates_aur=0 fi diff --git a/config/bspwm/polybar/scripts/weather.py b/config/bspwm/polybar/scripts/weather.py index 36bd4e6..abfdb3b 100755 --- a/config/bspwm/polybar/scripts/weather.py +++ b/config/bspwm/polybar/scripts/weather.py @@ -1,8 +1,11 @@ import requests, os + API_KEY = os.getenv("OWM_POLYBAR") 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() + 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 Exception as e: print(" err") diff --git a/config/bspwm/polybar/scripts/wifi-signal.sh b/config/bspwm/polybar/scripts/wifi-signal.sh index e97a8b0..da5c0f2 100755 --- a/config/bspwm/polybar/scripts/wifi-signal.sh +++ b/config/bspwm/polybar/scripts/wifi-signal.sh @@ -1,2 +1,5 @@ #!/bin/sh -cat /proc/net/wireless | grep "wlp3s0" | awk '{print $4}' | grep -o '[0-9]*' +cat /proc/net/wireless \ + | grep "wlp3s0" \ + | awk '{print $4}' \ + | grep -o '[0-9]*' diff --git a/config/bspwm/sxhkd b/config/bspwm/sxhkd index d358375..adb1cd0 100644 --- a/config/bspwm/sxhkd +++ b/config/bspwm/sxhkd @@ -5,13 +5,14 @@ super + {_,shift} Return {kitty, rofi -show drun -theme ntenV2} -super + shift + {w, e, f, c, t, q} - {google-chrome-stable, \ - kitty --class nvim -e nvim, \ - kitty --class ranger -e ranger, \ - code, \ - .applications/todoist.appimage, \ - xkill } +super + shift + {w, e, f, c, s, t, q} + {google-chrome-stable, \ + kitty --class nvim -e nvim, \ + kitty --class ranger -e ranger, \ + code, \ + .applications/simplenote.appimage, \ + .applications/todoist.appimage, \ + xkill } {_,shift,ctrl} Print {scrot -s, scrot, scrot -u} @@ -27,6 +28,9 @@ super + {Escape, ctrl+i} super + q bspc node -c +alt + F4 + bspc node -c + super + control + r bspc wm -r \ && pkill sxhkd \ diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 9019995..f269613 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -68,7 +68,7 @@ set visualbell t_vb= "== Settings for specific files autocmd FileType python,json setlocal ex sw=4 ts=4 autocmd FileType go setlocal noex sw=4 ts=4 -autocmd FileType javascript,javascriptreact setlocal noet sw=2 ts=2 +autocmd FileType javascript,javascriptreact setlocal et sw=2 ts=2 autocmd FileType css,yaml setlocal ex sw=4 ts=4 "== Aliases