From dd6e26bb493b144c40f7f5c8b3bf91f77c641b94 Mon Sep 17 00:00:00 2001 From: kar Date: Tue, 11 Nov 2025 23:02:46 -0600 Subject: [PATCH] feat: Adding config files --- config.ini | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++ launch.sh | 16 ++++ 2 files changed, 230 insertions(+) create mode 100644 config.ini create mode 100755 launch.sh diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..24ba344 --- /dev/null +++ b/config.ini @@ -0,0 +1,214 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +background = #050505 +background-alt = #2b12121 +foreground = #ffffff +primary = #53e500 +secondary = #53e500 +alert = #307848 +disabled = #707880 + +[bar/example] +monitor=${env:MONITOR:} +width = 100% +height = 21pt +radius = 0 + +; dpi = 96 + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3pt + +border-size = 1pt +border-color = #53e500 + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = monospace;2 + +modules-left = xworkspaces xwindow +modules-right = mpd htb_status system-uptime filesystem pulseaudio xkeyboard memory cpu wlan eth battery-alt 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 = %class:0:60:...% + +[module/htb_status] +type = custom/script +exec = ~/.config/bin/htb_status.sh +interval = 30 + +[module/system-uptime] +type = custom/script +exec = ~/.config/bin/script_uptime.sh +interval = 30 + +[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/mpd] +type = internal/mpd +host = 127.0.0.1 +port = 6600 +interval = 1 +label-song = 𝄞 %title% + + +[module/pulseaudio] +type = internal/pulseaudio + +format-volume-prefix = "VOL " +format-volume-prefix-foreground = ${colors.primary} +format-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%% + +[module/battery-alt] +type=external/script +exec=acpi | cut -d ' ' -f 4 |grep -E "*%" 2>/dev/null +interval=30 +tail=true + +[network-base] +type = internal/network +interval = 5 +format-connected = +format-disconnected = +label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected + +[module/wlan] +inherit = network-base +interface-type = wireless +label-connected = %local_ip% + +[module/eth] +inherit = network-base +interface-type = wired +label-connected = %local_ip% + +[module/vboxnet0] +inherit = network-base +interface-type = virtual +label-connected = %{F#78ff34}%ifname%%{F-} %local_ip% + +[module/date] +type = internal/date +interval = 1 + +date = %H:%M +date-alt = %Y-%m-%d %H:%M:%S + +label = %date% +label-foreground = ${colors.primary} + +[settings] +screenchange-reload = true +pseudo-transparency = true + +; vim:ft=dosini diff --git a/launch.sh b/launch.sh new file mode 100755 index 0000000..3f95d07 --- /dev/null +++ b/launch.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Termina instancias de barras que ya se estén ejecutando +killall -q polybar + +# Espera a que los procesos se hayan cerrado +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + +# Lanza Polybar en todos los monitores detectados +if type "xrandr"; then + for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar --reload example & + done +else + polybar --reload example & +fi