Improved Polybar

This commit is contained in:
Roger Gonzalez 2025-01-07 18:13:39 -03:00
parent e5fd0a5733
commit 7c44905a47
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6
3 changed files with 72 additions and 57 deletions

View File

@ -5,27 +5,34 @@
; |___/ ; |___/
[colors] [colors]
accent = #fba922 accent = #75d85a
background = #AA000000
foreground = #ffffff
urgent = #990000
urgent-underline = #990000
dimmed = #888888
highlight = #e5c07b
success = #55ffffff
muted = #666666
[bar/top] [bar/top]
monitor = ${env:MONITOR:} monitor = ${env:MONITOR:}
enable-ipc = true enable-ipc = true
width = 100% width = 100%
height = 17 height = 26 ; Increased for better font visibility
;background = #222 background = ${colors.background}
background = #33000000 foreground = ${colors.foreground}
foreground = #fff
overline-size = 1 overline-size = 2
overline-color = ${self.background} overline-color = ${colors.accent}
underline-size = 1 underline-size = 2
underline-color = ${self.background} underline-color = ${colors.accent}
padding-left = 1 padding-left = 2
padding-right = 1 padding-right = 2
module-margin-left = 1 module-margin-left = 2
module-margin-right = 1 module-margin-right = 2
font-0 = NotoSans-Regular:size=10;0 font-0 = NotoSans-Regular:size=10;0
font-1 = MaterialIcons:size=10;2 font-1 = MaterialIcons:size=10;2
@ -33,86 +40,95 @@ font-2 = Termsynu:size=10;0
font-3 = Siji:pixelsize=10;1 font-3 = Siji:pixelsize=10;1
font-4 = FontAwesome:size=10;0 font-4 = FontAwesome:size=10;0
font-5 = Noto Color Emoji:scale=12;0 font-5 = Noto Color Emoji:scale=12;0
modules-left = i3 music modules-left = i3 music
modules-center = xwindow modules-center = xwindow
modules-right = pulseaudio xkeyboard cpu memory wireless-network protonvpn-status dnd battery clock modules-right = pulseaudio xkeyboard cpu memory wireless-network protonvpn-status dnd battery clock
[module/i3] [module/i3]
type = internal/i3 type = internal/i3
format = <label-state> <label-mode> format = <label-state> <label-mode>
pin-workspaces = true pin-workspaces = true
label-dimmed-underline = ${root.background} label-dimmed-underline = ${colors.background}
label-focused = %name% label-focused =  %name%
label-focused-foreground = #f3f3f3 label-focused-foreground = ${colors.accent}
label-focused-background = ${root.background} label-focused-underline = ${colors.accent}
label-focused-underline = #75d85a label-focused-font = 1
label-focused-font = 4 label-focused-padding = 4
label-focused-padding = 3
label-unfocused = %name% label-unfocused = %name%
label-unfocused-font = 4 label-unfocused-font = 0
label-unfocused-padding = 3 label-unfocused-padding = 3
label-urgent = %name% label-urgent = %name%
label-urgent-foreground = #000000 label-urgent-foreground = ${colors.foreground}
label-urgent-background = #bd2c40 label-urgent-background = ${colors.urgent}
label-urgent-underline = #9b0a20 label-urgent-underline = ${colors.urgent-underline}
label-urgent-font = 4 label-urgent-font = 1
label-urgent-padding = 4 label-urgent-padding = 3
label-visible = %name% label-visible = %name%
label-visible-foreground = #55ffffff label-visible-foreground = ${colors.success}
label-visible-font = 4 label-visible-font = 0
label-visible-padding = 4 label-visible-padding = 4
[module/cpu] [module/cpu]
type = internal/cpu type = internal/cpu
interval = 2 interval = 0.5
warn-percentage = 95
format-prefix = "🎛 " format-prefix = "🎛 "
format-underline = #f90000 format-underline = ${colors.highlight}
label = %percentage:2%% label = %percentage:2%%
[module/memory] [module/memory]
type = internal/memory type = internal/memory
interval = 2 interval = 3
warn-percentage = 90
format-prefix = " 📊 " format-prefix = " 📊 "
format-underline = #4bffdc format-underline = ${colors.accent}
label = %percentage_used%% label = %percentage_used%%
[module/wireless-network] [module/wireless-network]
type = internal/network type = internal/network
interface = wlp0s20f3 interface = wlp0s20f3
interval = 2.0 interval = 2.0
ping-interval = 10 format-connected = 📶 <label-connected>
label-connected = 📶 %essid% format-disconnected = <label-disconnected>
format-packetloss = <animation-packetloss> <label-connected>
label-connected = %essid% %netspeed:9%
label-connected-foreground = #eefafa
label-disconnected = 🚫 not connected label-disconnected = 🚫 not connected
label-disconnected-foreground = #66 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
[module/clock] [module/clock]
type = internal/date type = internal/date
interval = 5 interval = 5
format-padding = 5
date = 📅 %d-%m-%Y 🕜 %H:%M% date = 📅 %d-%m-%Y 🕜 %H:%M%
format = <label> %{O4}
[module/battery] [module/battery]
type = internal/battery type = internal/battery
full-at = 99 full-at = 99
battery = BAT0 battery = BAT0
adapter = AC adapter = AC
format-charging = %{T4} 🔌 <label-charging> %{T-} format-charging = %{T3} 🔌 <label-charging> %{T-}
format-discharging = %{T4}🔋 <label-discharging> %{T-} format-discharging = %{T3}🔋 <label-discharging> %{T-}
format-full = %{T4}🔌 <label-full> %{T-} format-full = %{T3}🔌 <label-full> %{T-}
label-charging-font = 3 label-charging-font = 2
label-discharging-font = 3 label-discharging-font = 2
label-full = 100% label-full = 100%
[module/xwindow] [module/xwindow]
type = internal/xwindow type = internal/xwindow
label-maxlen = 75 label-maxlen = 50
label-foreground = #FFF label-foreground = ${colors.foreground}
[module/xkeyboard] [module/xkeyboard]
type = custom/script type = custom/script
@ -123,12 +139,13 @@ interval = 1
type = internal/pulseaudio type = internal/pulseaudio
label-volume = 🔊 %percentage%% label-volume = 🔊 %percentage%%
label-muted = 🔈 label-muted = 🔈
label-muted-foreground = #666 label-muted-foreground = ${colors.muted}
interval = 1
[module/spotify] [module/spotify]
type = custom/script type = custom/script
interval = 1 interval = 1
exec = python /home/roger/.config/polybar/spotify_status.py -t 80 --playpause-font=5 -p '⏯,⏸️' -f ' {play_pause} {song} - {artist} - {album}' exec = python /home/roger/.config/polybar/spotify_status.py -t 80 --playpause-font=1 -p '⏯,⏸️' -f ' {play_pause} {song} - {artist} - {album}'
[module/music] [module/music]
type = custom/script type = custom/script
@ -139,7 +156,7 @@ exec = ~/.config/polybar/music
[module/protonvpn-status] [module/protonvpn-status]
type = custom/script type = custom/script
exec = /home/roger/.config/polybar/protonvpn_status.sh exec = /home/roger/.config/polybar/protonvpn_status.sh
interval = 5 interval = 15
[module/dnd] [module/dnd]
type = custom/script type = custom/script
@ -168,5 +185,3 @@ warn-temperature = 80
type = custom/script type = custom/script
exec = python ~/.config/polybar/pcrypto.py --base USD --coins btc exec = python ~/.config/polybar/pcrypto.py --base USD --coins btc
interval = 60 interval = 60
font-0 = "coins:style=Regular;0"

View File

@ -5,7 +5,7 @@ IFS=$'\n\t'
STATE=$(xfconf-query -c xfce4-notifyd -p /do-not-disturb) STATE=$(xfconf-query -c xfce4-notifyd -p /do-not-disturb)
if [ "$STATE" = "true" ]; then if [ "$STATE" = "true" ]; then
echo "DND " echo "DND "
else else
echo "DND " echo "DND "
fi fi

View File

@ -5,7 +5,7 @@ IFS=$'\n\t'
PROTONVPN_STATUS=$(curl -s https://am.i.mullvad.net/country) PROTONVPN_STATUS=$(curl -s https://am.i.mullvad.net/country)
if echo $PROTONVPN_STATUS | grep -q 'Uruguay'; then if echo $PROTONVPN_STATUS | grep -q 'Uruguay'; then
echo "%{u#f90000}VPN %{T5}🚫%{T-}" echo "🚫 VPN"
else else
echo "%{u#75d85a}VPN %{T5}✅%{T-}" echo "✅ VPN"
fi fi