From ca968c4e5040f1ff4b5b5e12d9312360d807dcc1 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 3 Jun 2024 19:56:39 +0800 Subject: added submodules, change . -> dot (see man stow --dotfiles) --- dot-config/polybar/.module | 0 dot-config/polybar/.system | 0 dot-config/polybar/colors.ini | 27 ++ dot-config/polybar/config.ini | 116 +++++ dot-config/polybar/decor.ini | 64 +++ dot-config/polybar/launch.sh | 46 ++ dot-config/polybar/modules.ini | 824 +++++++++++++++++++++++++++++++++ dot-config/polybar/polybar.sh | 45 ++ dot-config/polybar/scripts/polywins.sh | 242 ++++++++++ dot-config/polybar/system.ini | 25 + 10 files changed, 1389 insertions(+) create mode 100644 dot-config/polybar/.module create mode 100644 dot-config/polybar/.system create mode 100644 dot-config/polybar/colors.ini create mode 100644 dot-config/polybar/config.ini create mode 100644 dot-config/polybar/decor.ini create mode 100755 dot-config/polybar/launch.sh create mode 100644 dot-config/polybar/modules.ini create mode 100755 dot-config/polybar/polybar.sh create mode 100755 dot-config/polybar/scripts/polywins.sh create mode 100644 dot-config/polybar/system.ini (limited to 'dot-config/polybar') diff --git a/dot-config/polybar/.module b/dot-config/polybar/.module new file mode 100644 index 00000000..e69de29b diff --git a/dot-config/polybar/.system b/dot-config/polybar/.system new file mode 100644 index 00000000..e69de29b diff --git a/dot-config/polybar/colors.ini b/dot-config/polybar/colors.ini new file mode 100644 index 00000000..324cccb2 --- /dev/null +++ b/dot-config/polybar/colors.ini @@ -0,0 +1,27 @@ +[color] + +#transparent = #00000000 +#BACKGROUND = #dd2E3440 +# C7 = 78% transparent +BACKGROUND = #C7242931 +FOREGROUND = #D8DEE9 +ALTBACKGROUND = #39404f +ALTFOREGROUND = #768bb2 +ACCENT = #81A1C1 + +BLACK = #3B4252 +RED = #BF616A +GREEN = #A3BE8C +YELLOW = #EBCB8B +BLUE = #81A1C1 +MAGENTA = #B48EAD +CYAN = #88C0D0 +WHITE = #E5E9F0 +ALTBLACK = #4C566A +ALTRED = #BF616A +ALTGREEN = #A3BE8C +ALTYELLOW = #EBCB8B +ALTBLUE = #81A1C1 +ALTMAGENTA = #B48EAD +ALTCYAN = #8FBCBB +ALTWHITE = #ECEFF4 diff --git a/dot-config/polybar/config.ini b/dot-config/polybar/config.ini new file mode 100644 index 00000000..e26a2be9 --- /dev/null +++ b/dot-config/polybar/config.ini @@ -0,0 +1,116 @@ +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +;; Global WM Settings + +[global/wm] +margin-bottom = 0 +margin-top = 0 + +include-file = ./system.ini +include-file = ./colors.ini +include-file = ./modules.ini +include-file = ./decor.ini + +[bar/main] +monitor = ${env:MONITOR:} +monitor-strict = false +override-redirect = false + +bottom = false +fixed-center = true + +width = 90% +height = 30 +; doesn't work +;rounded = true +;rounded-size = 5 +offset-x = 5% +offset-y = 10 + +background = ${color.BACKGROUND} +foreground = ${color.FOREGROUND} + +radius-top = 10.0 +radius-bottom = 10.0 + +line-size = 2 +line-color = ${color.ACCENT} + +border-size = 4 +border-color = ${color.BACKGROUND} +radius = 10.0 + +padding = 1 +module-margin-left = 0 +module-margin-right = 0 + + +font-0 = "Iosevka Nerd Font:size=10;3" +font-1 = "Iosevka Nerd Font:size=12;3" +font-2 = "google\-mdi:size=12;3" +#font-2 = "placeholder" +font-3 = "Iosevka:style=bold:"size=12;3" +font-4 = "Iosevka:style=bold:size=10;4" +font-5 = "archcraft:size=12;3" +font-6 = "Noto Sans CJK:size=12;3" + + +# changewallpaper +modules-left = mod blank archicon sep workspaces gmail +modules-center = polywins +# modules-right = volume sep bna sep network sep battery sep date +#need improve +# cava wifi-up wifi-down +modules-right = cpu-info space memory-info space gpu-info space temp-info sep ethernet sep date blank powermenu + +separator = +spacing = 0 + +dim-value = 1.0 + +wm-name = bspwm +; locale = zh_CN.UTF-8 +locale = + +tray-position = right +tray-detached = false +tray-maxsize = 16 +tray-transparent = true +tray-background = ${color.BACKGROUND} +tray-offset-x = 0 +tray-offset-y = 0 +tray-padding = 0 +tray-scale = 1.0 + +wm-restack = bspwm + +enable-ipc = true + +; bspwm +scroll-up = bspc desktop -f prev.local +scroll-down = bspc desktop -f next.local + + +[settings] +throttle-output = 5 +throttle-output-for = 10 +throttle-input-for = 30 + +screenchange-reload = true + +compositing-background = source +compositing-foreground = over +compositing-overline = over +compositing-underline = over +compositing-border = over + +pseudo-transparency = true + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +;; __________ ______ +;; / ____/ __ \/ ____/ +;; / __/ / / / / /_ +;; / /___/ /_/ / __/ +;; /_____/\____/_/ +;; +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ diff --git a/dot-config/polybar/decor.ini b/dot-config/polybar/decor.ini new file mode 100644 index 00000000..a90fe288 --- /dev/null +++ b/dot-config/polybar/decor.ini @@ -0,0 +1,64 @@ +;; DECOR _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/sep] +type = custom/text +content = ◆ + +content-background = ${color.BACKGROUND} +content-foreground = ${color.ALTBACKGROUND} +content-padding = 2 + +[module/blank] +type = custom/text +content = ◆ + +content-background = ${color.BACKGROUND} +content-foreground = ${color.ALTBACKGROUND} +content-padding = 1 + +[module/space] +type = custom/text +content = " " + +content-background = ${color.BACKGROUND} +content-foreground = ${color.ALTBACKGROUND} +content-padding = 0 + +[module/dot] +type = custom/text +content =  +content-foreground = ${color.ALTBACKGROUND} +content-padding = 1 +content-font = 4 + +[module/dot-alt] +inherit = module/dot +content-foreground = ${color.ALTFOREGROUND} + +[module/nothing] +type = custom/script +exec = echo "" +hidden = false + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/LD] +type = custom/text +content = "%{T3}%{T-}" +content-background = ${color.BACKGROUND} +content-foreground = ${color.ALTBACKGROUND} + +[module/RD] +type = custom/text +content = "%{T3}%{T-}" +content-background = ${color.BACKGROUND} +content-foreground = ${color.ALTBACKGROUND} + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +;; __________ ______ +;; / ____/ __ \/ ____/ +;; / __/ / / / / /_ +;; / /___/ /_/ / __/ +;; /_____/\____/_/ +;; +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ diff --git a/dot-config/polybar/launch.sh b/dot-config/polybar/launch.sh new file mode 100755 index 00000000..b53112df --- /dev/null +++ b/dot-config/polybar/launch.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +CARD="$(light -L | grep 'backlight' | head -n1 | cut -d'/' -f3)" +INTERFACE="$(ip link | awk '/state UP/ {print $2}' | tr -d :)" +RFILE="$DIR/.module" + +# Fix backlight and network modules +fix_modules() { + if [[ -z "$CARD" ]]; then + sed -i -e 's/backlight/bna/g' "$DIR"/config.ini + elif [[ "$CARD" != *"intel_"* ]]; then + sed -i -e 's/backlight/brightness/g' "$DIR"/config.ini + fi + + if [[ "$INTERFACE" == e* ]]; then + sed -i -e 's/network/ethernet/g' "$DIR"/config.ini + fi +} + +# Launch the bar +launch_bar() { + # Terminate already running bar instances + #killall -q polybar + if pgrep polybar > /dev/null; then + polybar-msg cmd restart + elif ! pgrep polybar > /dev/null; then + + # Wait until the processes have been shut down + while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + + # Launch the bar + for mon in $(polybar --list-monitors | cut -d":" -f1); do + MONITOR=$mon polybar -q main -c "$DIR"/config.ini & + done + else + echo "An error had occured" + fi +} + +# Execute functions +if [[ ! -f "$RFILE" ]]; then + fix_modules + touch "$RFILE" +fi +launch_bar diff --git a/dot-config/polybar/modules.ini b/dot-config/polybar/modules.ini new file mode 100644 index 00000000..e451de2e --- /dev/null +++ b/dot-config/polybar/modules.ini @@ -0,0 +1,824 @@ +[module/volume] +type = internal/pulseaudio + +; Sink to be used, if it exists (find using `pacmd list-sinks`, name field) +; If not, uses default sink +;sink = alsa_output.pci-0000_12_00.3.analog-stereo +sink = + +; Use PA_VOLUME_UI_MAX (~153%) if true, or PA_VOLUME_NORM (100%) if false Default: true +use-ui-max = false + +; Interval for volume increase/decrease (in percent points) +; Default: 5 +interval = 1 + +format-volume = + +format-muted = +format-muted-prefix = 婢 +format-muted-prefix-font = 2 +format-muted-prefix-foreground = ${color.RED} + +label-volume = %percentage%% +label-muted = " Mute" +label-muted-foreground = ${color.ALTFOREGROUND} + +ramp-volume-0 = 奄 +ramp-volume-1 = 奄 +ramp-volume-2 = 奄 +ramp-volume-3 = 奔 +ramp-volume-4 = 奔 +ramp-volume-5 = 奔 +ramp-volume-6 = 墳 +ramp-volume-7 = 墳 +ramp-volume-8 = 墳 +ramp-volume-9 = 墳 +ramp-volume-font = 2 +ramp-volume-foreground = ${color.BLUE} + +ramp-headphones-0 =  +ramp-headphones-1 =  + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/bna] +type = custom/text + +content = " NA" +content-prefix =  +content-prefix-font = 2 +content-prefix-foreground = ${color.RED} +content-padding = 0 + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + +[module/backlight] +type = internal/xbacklight + +card = intel_backlight + +format =