소스 검색

Update Polybar

Vitaliy Timtsurak 5 달 전
부모
커밋
d9e129f62b
4개의 변경된 파일102개의 추가작업 그리고 221개의 파일을 삭제
  1. 92 4
      config/polybar/config.ini
  2. 0 212
      config/polybar/config.ini.old
  3. 8 3
      config/polybar/launch.sh
  4. 2 2
      config/polybar/scripts/powermenu.sh

+ 92 - 4
config/polybar/config.ini

@@ -56,10 +56,11 @@ green = #50FA7B
 ; -------------------------------------------------------------------
 ;   Основные настройки бара
 ; -------------------------------------------------------------------
-[bar/main]
+[bar/bar1]
 ; Выбор монитора. 'primary' - основной.
 ; Узнать: 'xrandr -q' (например, 'eDP-1')
 #monitor = ${env:MONITOR:primary}
+monitor = HDMI-1
 
 ; Геометрия
 width = 95%
@@ -104,7 +105,7 @@ font-3 = "Hack Nerd Font:style=Bold:size=18;3"
 separator = |
 modules-left = arch-icon bspwm xwindow
 modules-center = date
-modules-right = pulseaudio network bluetooth updates cpu memory filesystem temperature battery powermenu
+modules-right = pulseaudio network-wired bluetooth updates cpu memory filesystem temperature battery powermenu
 
 ; Включить поддержку IPC (для отправки команд в polybar)
 enable-ipc = true
@@ -113,6 +114,65 @@ enable-ipc = true
 tray-position = right
 tray-padding = 2
 
+wm-restack = bspwm
+
+[bar/bar2]
+; Выбор монитора. 'primary' - основной.
+; Узнать: 'xrandr -q' (например, 'eDP-1')
+#monitor = ${env:MONITOR:primary}
+monitor = HDMI-2
+
+; Геометрия
+width = 95%
+offset-x = 2.5%
+
+height = 32
+radius = 8.0
+
+; [!] Эта настройка оцентрует бар,
+; так как его ширина теперь меньше 100%
+fixed-center = true
+
+; Расположение (false = вверху)
+bottom = false
+
+; Отступы
+padding-left = 1
+padding-right = 1
+
+; Отступы для модулей
+module-margin = 1
+
+; Цвета
+background = ${colors.background}
+foreground = ${colors.foreground}
+
+; Шрифты
+; [!] Мы используем 'Hack Nerd Font', как ты и просил.
+; 'font-0' - основной шрифт
+; 'font-1' - шрифт с иконками (Nerd Font)
+font-0 = "Hack Nerd Font:style=Regular:size=12;2"
+font-1 = "Hack Nerd Font:style=Bold:size=12;2"
+
+
+; Для больших иконок
+font-2 = "Hack Nerd Font:style=Regular:size=12;3"
+
+; Для цифр с номерами workspace
+font-3 = "Hack Nerd Font:style=Bold:size=18;3"
+
+; Расположение модулей
+separator = |
+modules-left = arch-icon bspwm xwindow
+modules-center = date
+modules-right = pulseaudio network-wireless bluetooth updates cpu memory filesystem temperature battery powermenu
+
+; Включить поддержку IPC (для отправки команд в polybar)
+enable-ipc = true
+
+; Системный трей
+tray-position = none
+
 wm-restack = bspwm
 ; -------------------------------------------------------------------
 ;   Модули: Левая часть
@@ -141,6 +201,10 @@ ws-icon-3 = 4;%{T4}%{F#81A1C1}󰬽%{T-}
 ws-icon-4 = 5;%{T4}%{F#A3BE8C}󰬾%{T-}
 ws-icon-5 = 6;%{T4}%{F#F9DE8F}󰬿%{T-}
 ws-icon-6 = 7;%{T4}%{F#ff9b93}󰭀%{T-}
+ws-icon-7 = 8;%{T4}%{F#F9DE8F}󰭁%{T-}
+ws-icon-8 = 9;%{T4}%{F#ff9b93}󰭂%{T-}
+ws-icon-9 = 10;%{T4}%{F#95e1d3}󰿩%{T-}
+
 
 ;label-focused = %icon%
 label-focused = X
@@ -220,7 +284,7 @@ scroll-down = pulseaudio-ctl down 5
 
 ; [Модуль] Сеть (Wi-Fi)
 ; [!] Требует настройки
-[module/network]
+[module/network-wireless]
 type = internal/network
 ; [!] Замени 'wlan0' на имя своего Wi-Fi интерфейса
 ; Узнать: 'ip link'
@@ -242,6 +306,30 @@ label-disconnected-foreground = ${colors.disabled}
 ; ЛКМ: Открыть 'networkmanager_dmenu' для выбора сети
 click-left = networkmanager_dmenu
 
+; [Модуль] Сеть (Wired)
+[module/network-wired]
+type = internal/network
+; [!] Замени 'eth0' на имя своего Ethernet интерфейса
+; Узнать: 'ip link'
+interface = eno2
+interface-type = wired
+interval = 3.0
+
+; Подключено
+format-connected = <label-connected>
+label-connected =  %local_ip%
+label-connected-foreground = ${colors.green}
+
+; Отключено
+format-disconnected = <label-disconnected>
+label-disconnected =  (нет сети)
+label-disconnected-foreground = ${colors.disabled}
+
+; [!] Управление сетью (как ты просил)
+; ЛКМ: Открыть 'networkmanager_dmenu' для выбора сети
+click-left = networkmanager_dmenu
+
+
 ; [Модуль] Bluetooth
 ; [!] Требует кастомных скриптов (см. ниже)
 [module/bluetooth]
@@ -395,4 +483,4 @@ pseudo-transparency = false
 
 ; ===================================================================
 ;   Конец конфига
-; ===================================================================
+; ===================================================================

+ 0 - 212
config/polybar/config.ini.old

@@ -1,212 +0,0 @@
-;==========================================================
-;
-;
-;   ██████╗  ██████╗ ██╗  ██╗   ██╗██████╗  █████╗ ██████╗
-;   ██╔══██╗██╔═══██╗██║  ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
-;   ██████╔╝██║   ██║██║   ╚████╔╝ ██████╔╝███████║██████╔╝
-;   ██╔═══╝ ██║   ██║██║    ╚██╔╝  ██╔══██╗██╔══██║██╔══██╗
-;   ██║     ╚██████╔╝███████╗██║   ██████╔╝██║  ██║██║  ██║
-;   ╚═╝      ╚═════╝ ╚══════╝╚═╝   ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝
-;
-;
-;   To learn more about how to configure Polybar
-;   go to https://github.com/polybar/polybar
-;
-;   The README contains a lot of information
-;
-;==========================================================
-
-[colors]
-background = #282A2E
-background-alt = #373B41
-foreground = #C5C8C6
-primary = #F0C674
-secondary = #8ABEB7
-alert = #A54242
-disabled = #707880
-
-[bar/example]
-width = 198%
-height = 26pt
-radius = 8
-
-; dpi = 96
-
-background = ${colors.background}
-foreground = ${colors.foreground}
-
-line-size = 3pt
-
-border-size = 4pt
-border-color = #00000000
-
-padding-left = 0
-padding-right = 1
-
-module-margin = 1
-
-separator = |
-separator-foreground = ${colors.disabled}
-
-font-0 = Hack Nerd Font:style=Bold:pixelsize=13;2
-
-modules-left = xworkspaces xwindow
-modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date
-
-cursor-click = pointer
-cursor-scroll = ns-resize
-
-enable-ipc = true
-
-; wm-restack = generic
-wm-restack = bspwm
-; wm-restack = i3
-
-; override-redirect = true
-
-; This module is not active by default (to enable it, add it to one of the
-; modules-* list above).
-; Please note that only a single tray can exist at any time. If you launch
-; multiple bars with this module, only a single one will show it, the others
-; will produce a warning. Which bar gets the module is timing dependent and can
-; be quite random.
-; For more information, see the documentation page for this module:
-; https://polybar.readthedocs.io/en/stable/user/modules/tray.html
-[module/systray]
-type = internal/tray
-
-format-margin = 8pt
-tray-spacing = 16pt
-
-[module/xworkspaces]
-type = internal/xworkspaces
-
-label-active = %name%
-label-active-background = ${colors.background-alt}
-label-active-underline= ${colors.primary}
-label-active-padding = 1
-
-label-occupied = %name%
-label-occupied-padding = 1
-
-label-urgent = %name%
-label-urgent-background = ${colors.alert}
-label-urgent-padding = 1
-
-label-empty = %name%
-label-empty-foreground = ${colors.disabled}
-label-empty-padding = 1
-
-[module/xwindow]
-type = internal/xwindow
-label = %title:0:60:...%
-
-[module/filesystem]
-type = internal/fs
-interval = 25
-
-mount-0 = /
-
-label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
-
-label-unmounted = %mountpoint% not mounted
-label-unmounted-foreground = ${colors.disabled}
-
-[module/pulseaudio]
-type = internal/pulseaudio
-
-format-volume-prefix = "VOL "
-format-volume-prefix-foreground = ${colors.primary}
-format-volume = <label-volume>
-
-label-volume = %percentage%%
-
-label-muted = muted
-label-muted-foreground = ${colors.disabled}
-
-[module/xkeyboard]
-type = internal/xkeyboard
-blacklist-0 = num lock
-
-label-layout = %layout%
-label-layout-foreground = ${colors.primary}
-
-label-indicator-padding = 2
-label-indicator-margin = 1
-label-indicator-foreground = ${colors.background}
-label-indicator-background = ${colors.secondary}
-
-[module/memory]
-type = internal/memory
-interval = 2
-format-prefix = "RAM "
-format-prefix-foreground = ${colors.primary}
-label = %percentage_used:2%%
-
-[module/cpu]
-type = internal/cpu
-interval = 2
-format-prefix = "CPU "
-format-prefix-foreground = ${colors.primary}
-label = %percentage:2%%
-
-[network-base]
-type = internal/network
-interval = 5
-format-connected = <label-connected>
-format-disconnected = <label-disconnected>
-label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
-
-[module/wlan]
-inherit = network-base
-interface-type = wireless
-label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip%
-
-[module/eth]
-inherit = network-base
-interface-type = wired
-label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%
-
-[module/date]
-type = internal/date
-interval = 1
-
-date = %H:%M
-date-alt = %d.%m.%Y %H:%M:%S
-
-label = %date%
-label-foreground = ${colors.primary}
-
-[settings]
-screenchange-reload = true
-pseudo-transparency = true
-
-[module/battery]
-type = internal/battery
-
-; This is useful in case the battery never reports 100% charge
-; Default: 100
-full-at = 99
-
-; format-low once this charge percentage is reached
-; Default: 10
-; New in version 3.6.0
-low-at = 5
-
-; Use the following command to list batteries and adapters:
-; $ ls -1 /sys/class/power_supply/
-battery = BAT0
-adapter = AC0
-
-; If an inotify event haven't been reported in this many
-; seconds, manually poll for new values.
-;
-; Needed as a fallback for systems that don't report events
-; on sysfs/procfs.
-;
-; Disable polling by setting the interval to 0.
-;
-; Default: 5
-poll-interval = 5
-
-; vim:ft=dosini

+ 8 - 3
config/polybar/launch.sh

@@ -6,7 +6,12 @@ killall -q polybar
 # Ожидание полного завершения работы процессов
 while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
 
-# Запуск Polybar со стандартным расположением конфигурационного файла в ~/.config/polybar/config
-polybar main &
+# Запуск Polybar
+if [[ $(xrandr -q | grep " connected" | wc -l) -ge 2 ]]; then
+    polybar bar1 &
+    polybar bar2 &
+else
+    polybar bar1 &
+fi
 
-notify-send "Polybar загрузился..."
+notify-send "Polybar загрузился..."

+ 2 - 2
config/polybar/scripts/powermenu.sh

@@ -23,12 +23,12 @@ case "$selected" in
         ;;
     "$lock")
         # [!] Замени 'betterlockscreen -l' на свою команду блокировки
-        betterlockscreen -l
+        physlock -m "Система заблокирована. Введите пароль.\n" -p "Авторизация: "
         ;;
     "$logout")
         # [!] Замени на команду выхода из твоего WM
         # i3:     i3-msg exit
         # bspwm:  bspc quit
-        bspc exit
+        sudo systemctl restart ly.service
         ;;
 esac