From 3b948427617980b8f5ecd8e59bcb151d73884937 Mon Sep 17 00:00:00 2001 From: Xander Swan Date: Wed, 3 Dec 2025 10:00:41 -0500 Subject: Polybar --- .config/polybar/config.ini | 166 +++++++++++++++++++++++++++++++++++++++++++++ .config/polybar/launch.sh | 14 ++++ .config/polybar/media.sh | 13 ++++ 3 files changed, 193 insertions(+) create mode 100644 .config/polybar/config.ini create mode 100755 .config/polybar/launch.sh create mode 100644 .config/polybar/media.sh (limited to '.config/polybar') diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini new file mode 100644 index 0000000..00ca4ca --- /dev/null +++ b/.config/polybar/config.ini @@ -0,0 +1,166 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +background = #333333 +background-alt = #262626 +foreground = #FFFFFF +primary = #F0C674 +secondary = #F0C674 +alert = #A54242 +disabled = #707880 + +[bar/base] +width = 100% +height = 24pt +radius = 0 + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3pt + +border-size = 0pt +border-color = #00000000 + +padding-left = 1 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +bottom = false + +font-0 = Mononoki Nerd Font;2 + +modules-left = xworkspaces +modules-center = +modules-right = pulseaudio date + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +[bar/bar1] +inherit = bar/base +monitor = "HDMI-A-0" + +[bar/bar2] +inherit = bar/base +monitor = "DVI-D-0" + + +[global/wm] +margin-bottom = 0 +margin-top = 0 + +[module/media] +type = custom/script +exec = sh ~/.config/polybar/media.sh +click-left = playerctl play-pause +interval = 1 + +[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 = %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/date] +type = internal/date +interval = 1 + +date = %H:%M %Y-%m-%d %b + +label = %date% +label-foreground = ${colors.primary} + +[settings] +screenchange-reload = true +pseudo-transparency = true + +; vim:ft=dosini diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh new file mode 100755 index 0000000..f4e0ddb --- /dev/null +++ b/.config/polybar/launch.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Terminate already running bar instances +# If all your bars have ipc enabled, you can use +polybar-msg cmd quit +# Otherwise you can use the nuclear option: +# killall -q polybar + +# Launch bar1 and bar2 +echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log +polybar bar1 2>&1 | tee -a /tmp/polybar1.log & disown +polybar bar2 2>&1 | tee -a /tmp/polybar2.log & disown + +echo "Bars launched..." diff --git a/.config/polybar/media.sh b/.config/polybar/media.sh new file mode 100644 index 0000000..38f8d55 --- /dev/null +++ b/.config/polybar/media.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +status=$(playerctl status) +title=$(playerctl metadata title) +artist=$(playerctl metadata artist) + +if [ $status = "Playing" ] +then + echo "󰐊 $title - $artist" +elif [ $status = "Paused" ] +then + echo "󰏤 $title - $artist" +fi -- cgit v1.3-2-g0d8e