From 977743ad0ef96a5edc5e97601d3a9ff5cd0bbbc9 Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 28 Jun 2023 11:31:09 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0polybar=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home/config/polybar/config.ini | 152 +++++++++++++++++++++++++++++++++ home/config/polybar/launch.sh | 10 +++ 2 files changed, 162 insertions(+) create mode 100644 home/config/polybar/config.ini create mode 100755 home/config/polybar/launch.sh diff --git a/home/config/polybar/config.ini b/home/config/polybar/config.ini new file mode 100644 index 0000000..e4654a4 --- /dev/null +++ b/home/config/polybar/config.ini @@ -0,0 +1,152 @@ +[colors] +xfs=#e1e1e1 +xbs=#8c91cf +xbg=#80d0d0d0 +xbg2=#00000000 +xfg=#ffffff + +color0=#282828 +color1=#383838 +color2=#4b4b4b +color3=#5b5b5b +color4=#bdbdbd +color5=#cecece +color6=#e0e0e0 +color7=#f5f5f5 +red=#eb0029 +orange=#E85D00 +yellow=#faa41a +green=#87a566 +aqua=#00a489 +blue=#4169e1 +purple=#7851a9 +brown=#574F4A + +primary = #F0C674 +secondary = #8ABEB7 +alert = #A54242 +disabled = #707880 + + +[variables] +mpadding = 1 +margin = 3 + +[bar/main] +;override-redirect = true +;wm-restack = Cinnamon + +locale = zh_CN.UTF-8 + +background = ${colors.xbg} +foreground = ${colors.xfg} + + +width = 98% +height = 36 + +padding-left = 2 +padding-right = 4 + +offset-x = 1% +offset-y = 12 + + +radius = 18 + + +font-0 = "HarmonyOS Sans SC:size=11;3" +font-1 = "Symbols Nerd Font:size=16;4" +font-2 = "DejaVu Sans:size=16;4" + +fixed-center = true + + +modules-left = logo ws +modules-center = date +modules-right = netspeed space space hibernate space logout + + +tray-position = right +tray-maxsize = 16 + + +enable-ipc = true + + + + + + +[module/logo] +type = custom/text +content =  +content-foreground = ${colors.red} +content-padding = 2 + + +[module/ws] +type = internal/xworkspaces + +icon-0 = "Workspace 1;➊" +icon-1 = "Workspace 2;➋" +icon-2 = "Workspace 3;➌" +icon-default = "➓" + + + +label-active = %icon% +label-active-foreground = ${colors.orange} +label-active-padding = 2 + +label-urgent = %icon% +label-urgent-padding = 2 +label-urgent-foreground = ${colors.color4} + +label-occupied = %icon% +label-occupied-padding = 2 +label-occupied-foreground = ${colors.color4} + +label-empty = %icon% +label-empty-padding = 2 +label-empty-foreground = ${colors.color4} + + +[module/date] +type = internal/date +format-padding = ${variables.mpadding} +date = "%m月%d %A" +time = "%k:%M" +label = %date% %time% +label-font = 1 + + + +[module/netspeed] +type = internal/network +interface = enp86s0 +interval = 1.0 +format-connected = +format-connected-padding = ${variables.mpadding} +label-connected = "↑%upspeed% ↓%downspeed%" + +[module/hibernate] +type = custom/text + +;click-left = lxsession-logout -p "" +content = %{T9}%{T-} +content-foreground = ${colors.yellow} + +[module/logout] +type = custom/text + +;click-left = lxsession-logout -p "" +content = %{T9}襤%{T-} +content-foreground = ${colors.red} +content-padding = 2 + + +[module/space] +type = custom/text + +content = %{T1} %{T-} \ No newline at end of file diff --git a/home/config/polybar/launch.sh b/home/config/polybar/launch.sh new file mode 100755 index 0000000..5e753d0 --- /dev/null +++ b/home/config/polybar/launch.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -u $UID -x polybar > /dev/null; do sleep 1; done + +# Launch polybar +polybar main -r & \ No newline at end of file