From 7a466f891af6a264cf5178eaddcda4aca1e44f0f Mon Sep 17 00:00:00 2001 From: horhik Date: Wed, 7 Oct 2020 20:45:54 +0300 Subject: [PATCH] configure statusbar --- .../alacritty/.config/alacritty/alacritty.yml | 14 ++-- home/picom/.config/picom/picom.conf | 55 +++++++------ home/scripts/.local/scripts/status/statusbar | 81 +++++++++++++++---- 3 files changed, 106 insertions(+), 44 deletions(-) diff --git a/home/alacritty/.config/alacritty/alacritty.yml b/home/alacritty/.config/alacritty/alacritty.yml index 32ab8f5..e32527a 100644 --- a/home/alacritty/.config/alacritty/alacritty.yml +++ b/home/alacritty/.config/alacritty/alacritty.yml @@ -41,9 +41,9 @@ # # Blank space added around the window in pixels. This padding is scaled # by DPI and the specified value is always added at both opposing sides. - #padding: - # x: 0 - # y: 0 +padding: + x: 20 + y: 20 # Spread additional padding evenly around the terminal content. #dynamic_padding: false @@ -57,7 +57,7 @@ # Values for `decorations` (macOS only): # - transparent: Title bar, transparent background and title bar buttons # - buttonless: Title bar, transparent background, but no title bar buttons - #decorations: full + decorations: full # Startup Mode (changes require restart) # @@ -201,9 +201,9 @@ colors: # # Allowed values are CellForeground and CellBackground, which reference the # affected cell, or hexadecimal colors like #ff00ff. - #vi_mode_cursor: - # text: CellBackground - # cursor: CellForeground +#vi_mode_cursor: +# text: CellBackground +# cursor: CellForeground # Selection colors # diff --git a/home/picom/.config/picom/picom.conf b/home/picom/.config/picom/picom.conf index e285d7f..94200f4 100644 --- a/home/picom/.config/picom/picom.conf +++ b/home/picom/.config/picom/picom.conf @@ -1,3 +1,4 @@ + corner-radius = 10; rounded-corners-exclude = [ # "class_g = 'awesome'", @@ -8,13 +9,13 @@ rounded-corners-rule = [ "5:class_g = 'Dunst'", ]; -round-borders = 10; +round-borders = 3; round-borders-exclude = []; round-borders-rule = [ "3:class_g = 'XTerm'", "3:class_g = 'URxvt'", - "10:class_g = 'Alacritty'", + "3:class_g = 'Alacritty'", "5:class_g = 'Dunst'", "15:class_g = 'Signal'" ]; @@ -37,7 +38,7 @@ shadow = true; shadow-radius = 20; -shadow-opacity = 0.75 +shadow-opacity = 0.75 @@ -47,7 +48,7 @@ shadow-offset-x = -10; shadow-offset-y = -10; shadow-exclude = [ - + "name = 'Polybar'", "class_g *= 'border'", "name = 'xmobar'", @@ -143,8 +144,7 @@ focus-exclude = [ "class_g = 'Cairo-clock'" ]; opacity-rule = [ "95:class_g = 'Emacs'", - "95:class_g *= 'Alacritty'", - "95:class_g *= 'st'", + "90:class_g *= 'Alacritty'", "78:class_g *= 'Zathura'", "80:class_g = 'dropdown'", "50:class_g = 'Firefox'", @@ -154,25 +154,34 @@ opacity-rule = [ "90:name = 'emacs'", "85:name *= 'xmobar'", "95:class_g = 'Spotify'", - "95:class_g = 'Polybar'" + "95:class_g = 'Polybar'", + "85:name *= 'scratchpad'" + ] -blur-background = true; -blur-method = "kawase"; -blur-strength = 7; -blur-background-exclude = [ - "window_type = 'desktop'", - "_GTK_FRAME_EXTENTS@:c", - "class_g = 'Polybar'" + +blur: +{ + method = "kawase"; + size = 20; + deviation = 2.0; +}; + + +blur-kern = "3x3box"; + +blur-background-exclude = [ + + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" ]; + + backend = "glx"; -vsync = true; - - +vsync = true mark-wmwin-focused = true; - mark-ovredir-focused = true; @@ -372,22 +381,22 @@ wintypes: focus = true; }; - - dock = { + + dock = { full-shadow = true; opacity = 1; } - dnd = { + dnd = { shadow = false; } - popup_menu = { + popup_menu = { full-shaodw = false; opacity = 1; } - dropdown_menu = { + dropdown_menu = { full-shaodw = false; opacity = 1; } diff --git a/home/scripts/.local/scripts/status/statusbar b/home/scripts/.local/scripts/status/statusbar index fe55414..f729e6c 100755 --- a/home/scripts/.local/scripts/status/statusbar +++ b/home/scripts/.local/scripts/status/statusbar @@ -1,19 +1,72 @@ #!/bin/bash -acpi | grep -oh "[[:digit:]]*%" -vol=$(awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master) | head -1| grep -oh "[0-9]*") -RED='\033[0;31m' +battery () +{ +val=$(acpi | grep -oh "[[:digit:]]*%" | grep -oh "[0-9]*") -if [ $vol -ge 100 ] -then - echo 墳$vol -elif [ $vol -ge 50 ] -then - echo 奔$vol -elif [ $vol -ge 1 ] -then - echo 奄$vol -else +case $val in + 100) + echo " $val" + ;; + [5-9][0-9]) + echo " $val" + ;; +[1-4][0-9]) + echo " $val" + ;; +[1-9]) + echo " $val" + ;; +0) + echo  + ;; +esac +} + + +volume () +{ +val=$(amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $2 }'| grep -oh "[0-9]*") +case $val in + 100) + echo 墳 $val% + ;; + [5-9][0-9]) + echo 墳 $val% + ;; +[1-4][0-9]) + echo 奔 $val% + ;; +[1-9]) + echo 奄 $val% + ;; +0) echo 婢 -fi + ;; +esac +} + +diskspace () +{ + echo  $(df -h | grep sda5 | grep -oh "[0-9]*%") +} + +wifi () +{ + name=$(connmanctl services | grep "*AO" | grep -oh "^*AO [A-Za-z]*" | grep -oh "[[:space:]][A-Za-x]*") +if [ $name != " " ]; + then + echo 直 $name + else + echo 睊 off + fi +} + +layout () +{ + echo  $(xkblayout-state print %s) +} + +echo "---------{$(wifi)}--{$(battery)}--{$(volume)}--{$(layout)}--{$(diskspace)}---------" +