diff --git a/.config/polybar/README.org b/.config/polybar/README.org new file mode 100644 index 00000000..a6e3a1f1 --- /dev/null +++ b/.config/polybar/README.org @@ -0,0 +1,405 @@ +#+TITLE: Polybar Configuration +#+AUTHOR: Roger González +#+PROPERTY: header-args:conf :tangle config :mkdirp yes +#+STARTUP: overview +#+OPTIONS: toc:3 num:nil +#+auto_tangle: t + +* Polybar Configuration +:PROPERTIES: +:ID: 2df7b3fd-be4c-4d75-9d6b-e64e7828169a +:END: +This document outlines the configuration for Polybar, a lightweight status bar. It's written using +Org-mode's literate programming features, allowing for documentation alongside the code. The +configuration is automatically tangled into the =config= file required by Polybar upon saving this Org +file, thanks to the =#+auto_tangle: t= property and a corresponding Emacs setup (detailed at the end). + +** Header +:PROPERTIES: +:ID: 575b523c-955f-4d67-8512-f1b527d39d11 +:END: +This section adds an ASCII art header comment to the top of the tangled =config= file for +personalization. It doesn't affect Polybar's functionality. +#+begin_src conf +# +# ██████╗ ██████╗ ██████╗ ███████╗ +# ██╔══██╗██╔═══██╗██╔════╝ ██╔════╝ Roger Gonzalez +# ██████╔╝██║ ██║██║ ███╗███████╗ https://rogs.me +# ██╔══██╗██║ ██║██║ ██║╚════██║ +# ██║ ██║╚██████╔╝╚██████╔╝███████║ +# ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ + +#+end_src + +** Colors +:PROPERTIES: +:ID: ba5e8a13-6e9d-488f-a8c8-591f3f7b33e2 +:END: +Defines the color palette used throughout the Polybar configuration. These variables make it easy to +maintain a consistent theme and can be referenced in other sections using `${colors.variable_name}`. +#+begin_src conf +[colors] +accent = #75d85a +background = #AA000000 +foreground = #ffffff +urgent = #990000 +urgent-underline = #990000 +dimmed = #888888 +highlight = #e5c07b +success = #55ffffff +muted = #666666 +#+end_src + +** Bar Configuration +:PROPERTIES: +:ID: fbd62c62-acfb-48ea-808f-66a37417e420 +:END: +Configures the main properties of the bar itself. This includes its dimensions, position (tied to the +`MONITOR` environment variable), appearance (background, foreground, over/underline styles), padding, +margins, and the fonts used. It also defines the order and placement of modules in the left, center, and +right sections of the bar. +#+begin_src conf +[bar/top] +monitor = ${env:MONITOR:} +enable-ipc = true +width = 100% +height = 26 + +background = ${colors.background} +foreground = ${colors.foreground} + +overline-size = 2 +overline-color = ${colors.accent} +underline-size = 2 +underline-color = ${colors.accent} + +padding-left = 2 +padding-right = 2 +module-margin-left = 2 +module-margin-right = 2 + +font-0 = NotoSans-Regular:size=10;0 +font-1 = MaterialIcons:size=10;2 +font-2 = Termsynu:size=10;0 +font-3 = Siji:pixelsize=10;1 +font-4 = FontAwesome:size=10;0 +font-5 = Noto Color Emoji:scale=12;0 + +modules-left = i3 music +modules-center = xwindow +modules-right = pulseaudio xkeyboard cpu memory wireless-network protonvpn-status dnd battery clock +#+end_src + +** i3 Module +:PROPERTIES: +:ID: 2e3d5e88-0ebb-4074-a406-b489baf141a8 +:END: +Displays i3 window manager workspaces and mode information. It uses icons (from `font-1` and `font-0`) to +represent different workspace states (focused, unfocused, visible, urgent) and applies specific colors +and underlines for clarity. `pin-workspaces = true` ensures workspaces are always shown even if empty on +other monitors (if applicable). +#+begin_src conf +[module/i3] +type = internal/i3 +format = +pin-workspaces = true + +label-dimmed-underline = ${colors.background} + +label-focused =  %name% +label-focused-foreground = ${colors.accent} +label-focused-underline = ${colors.accent} +label-focused-font = 1 +label-focused-padding = 4 + +label-unfocused =  %name% +label-unfocused-font = 0 +label-unfocused-padding = 3 + +label-urgent =  %name% +label-urgent-foreground = ${colors.foreground} +label-urgent-background = ${colors.urgent} +label-urgent-underline = ${colors.urgent-underline} +label-urgent-font = 1 +label-urgent-padding = 3 + +label-visible =  %name% +label-visible-foreground = ${colors.success} +label-visible-font = 0 +label-visible-padding = 4 +#+end_src + +** CPU Module +:PROPERTIES: +:ID: 1244d450-9c41-49b0-9c27-3ebdc31f02de +:END: +Shows the current CPU utilization percentage. Updates frequently (every 0.5 seconds) and uses a '🎛' +prefix (likely from `font-5`, Noto Color Emoji). The value is underlined with the highlight color. A +warning state is triggered if usage exceeds 95%, although no specific format change is defined for the +warning state here. +#+begin_src conf +[module/cpu] +type = internal/cpu +interval = 0.5 +warn-percentage = 95 +format-prefix = "🎛 " +format-underline = ${colors.highlight} +label = %percentage:2%% +#+end_src + +** Memory Module +:PROPERTIES: +:ID: 02bea2d6-482c-4f97-b0fe-a1bb4462080c +:END: +Displays the percentage of RAM currently in use. Updates every 3 seconds and uses a '📊' prefix (likely +from `font-5`). The value is underlined with the accent color. A warning state is triggered if usage +exceeds 90%. +#+begin_src conf +[module/memory] +type = internal/memory +interval = 3 +warn-percentage = 90 +format-prefix = " 📊 " +format-underline = ${colors.accent} +label = %percentage_used%% +#+end_src + +** Network Module +:PROPERTIES: +:ID: 4d75cc95-a5d3-4ac3-83d6-132bfbd2883f +:END: +Monitors the status of the specified wireless network interface (`wlp0s20f3`). Shows the SSID and network +speed (padded to 9 characters) when connected (📶) and a 'not connected' message (🚫) when disconnected. +Includes a blinking animation (⚠/📶) to indicate packet loss. +#+begin_src conf +[module/wireless-network] +type = internal/network +interface = wlp0s20f3 +interval = 2.0 +format-connected = 📶 +format-disconnected = +format-packetloss = +label-connected = %essid% %netspeed:9% +label-connected-foreground = #eefafa +label-disconnected = 🚫 not connected +label-disconnected-foreground = ${colors.dimmed} +animation-packetloss-0 = ⚠ +animation-packetloss-0-foreground = #ffa64c +animation-packetloss-1 = 📶 +animation-packetloss-1-foreground = #000000 +animation-packetloss-framerate = 500 +#+end_src + +** Clock Module +:PROPERTIES: +:ID: b9bc5f2f-60cd-4af1-a7d8-ae08c14fe0db +:END: +Displays the current date and time. Updates every 5 seconds. The format includes day, month, year, hour, +and minute (e.g., 📅 DD-MM-YYYY 🕜 HH:MM). The `%{O4}` adds a 4-pixel right offset for spacing. Icons +likely come from `font-5`. +#+begin_src conf +[module/clock] +type = internal/date +interval = 5 +date = 📅 %d-%m-%Y 🕜 %H:%M% +format =