Files
nix-config/dotconfig/polybar/config.ini.model
2026-04-10 18:38:21 +02:00

263 lines
5.8 KiB
Plaintext

[color]
background = #2f4a36
background-alt = #375740
foreground = #e8e8e8
foreground-dim = #b8c0b8
accent = #a3be8c
alert = #ff6b6b
; =========================
; BASES
; =========================
[bar/base]
monitor = ${env:MONITOR:}
width = 100%
height = 20
offset-x = 0
foreground = ${color.foreground}
border-size = 0
line-size = 0
padding-left = 1
padding-right = 1
module-margin = 1
separator = " · "
separator-foreground = ${color.foreground-dim}
font-0 = "DejaVuSansM Nerd Font Mono:size=10;2"
font-1 = "Noto Sans CJK JP:size=10;2"
font-2 = "Noto Color Emoji:size=10;2"
radius = 10
enable-ipc = true
[module/temp-base]
type = internal/temperature
warn-temperature = 80
format = <label>
label-warn-foreground = ${color.alert}
[fs-base]
type = internal/fs
interval = 30
fixed-values = true
format-mounted = <label-mounted>
; =========================
; BARS
; =========================
[bar/top]
inherit = bar/base
offset-y = 0
background = ${color.background}
modules-left =
modules-center = date-time
modules-right = battery
radius-bottom = 0
[bar/middle]
inherit = bar/base
offset-y = 20
background = ${color.background-alt}
modules-left = cpu memory
modules-center = cpu-temp gpu-temp nvme-temp fan
modules-right = dns
radius = 0
[bar/bottom]
inherit = bar/base
offset-y = 40
background = ${color.background}
modules-left = net-wireless
modules-center = fs-system
modules-right = defaultaudio volume
radius-top = 0
; =========================
; FOOTER
; =========================
[bar/tray-bottom]
inherit = bar/base
bottom = true
offset-y = 0
background = ${color.background-alt}
modules-left = desktops
modules-center = ping-amaury
modules-right = spotify spotify-prev spotify-play-pause spotify-next tray
[bar/bottom-b]
inherit = bar/base
bottom = true
offset-y = 0
background = ${color.background-alt}
modules-left = desktops
modules-center =
modules-right =
; =========================
; MODULES
; =========================
[module/desktops]
type = internal/i3
pin-workspaces = true
enable-click = true
enable-scroll = true
scroll-up = "#i3.prev"
scroll-down = "#i3.next"
label-focused = %name%
label-focused-padding = 1
label-focused-background = ${color.accent}
label-focused-foreground = #1f2a1f
label-unfocused = %name%
label-unfocused-padding = 1
label-unfocused-foreground = ${color.foreground-dim}
label-visible = %name%
label-visible-padding = 1
label-urgent = %name%
label-urgent-padding = 1
label-urgent-background = ${color.alert}
label-urgent-foreground = #ffffff
[module/cpu]
type = internal/cpu
interval = 2
format = <label>
label = CPU %percentage%%
[module/memory]
type = internal/memory
interval = 2
format = <label>
label = RAM %percentage_used%% %used%
[module/cpu-temp]
inherit = module/temp-base
hwmon-path = /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon@HW@/temp1_input
label = CPU %temperature-c%
label-warn = CPU %temperature-c%
[module/gpu-temp]
inherit = module/temp-base
hwmon-path = /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon@HW@/temp2_input
label = GPU %temperature-c%
label-warn = GPU %temperature-c%
[module/nvme-temp]
inherit = module/temp-base
hwmon-path = /sys/devices/pci0000:00/0000:00:06.0/0000:01:00.0/nvme/nvme0/hwmon0/temp1_input
label = NVMe %temperature-c%
label-warn = NVMe %temperature-c%
[module/fan]
type = custom/script
exec = cat /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon*/fan1_input
label = Fan %output% RPM
[module/date-time]
type = internal/date
interval = 1
date = %a %d %b
time = %H:%M:%S
label = %date% · %time%
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
poll-interval = 1
low-at = 15
full-at = 100
time-format = %Hh %Mm
format-charging = <label-charging>
label-charging = 󰂄 %percentage%% %time% %consumption%W
format-discharging = <label-discharging>
label-discharging = 󱟤 %percentage%% %time% %consumption%W
format-full = <label-full>
label-full = 󱈏 %percentage%%
format-low = <label-low>
label-low = 󰂃 %percentage%%
label-low-foreground = ${color.alert}
[module/net-wireless]
type = internal/network
interface-type = wireless
interval = 3
speed-unit = B/s
format-connected = <label-connected>
label-connected = %essid% · %local_ip% · U %upspeed% · D %downspeed%
format-disconnected = <label-disconnected>
label-disconnected = Wi-Fi down
label-disconnected-foreground = ${color.foreground-dim}
[module/fs-system]
inherit = fs-base
mount-0 = /
label-mounted = / %used% on %total%
[module/dns]
type = custom/script
exec = nslookup amauryjoly.fr | sed -n '2p' | awk '{print $2}'
interval = 30
label = DNS %output%
[module/volume]
type = internal/pulseaudio
format-volume = <label-volume>
label-volume = VOL %percentage%%
format-muted = <label-muted>
label-muted = VOL mute
label-muted-foreground = ${color.foreground-dim}
[module/defaultaudio]
type = custom/script
exec = wpctl inspect @DEFAULT_AUDIO_SINK@ 2>/dev/null | awk -F'"' '/^[[:space:]]*device\.api = "bluez5"/ { bt=1 } /^[[:space:]]*media\.name = "/ { name=$2 } END { print (bt && name) ? name : "local" }'
interval = 3
label = %output%
[module/tray]
type = internal/tray
format-margin = 2
tray-spacing = 2
[module/ping-amaury]
type = custom/script
exec = sh -c 'v=$(ping -c 1 -W 1 amauryjoly.fr 2>/dev/null | sed -n "s/.*temps=\\([0-9.]*\\).*/\\1/p"); [ -n "$v" ] && echo "$v ms" || echo "down"'
interval = 60
format = <label>
label = LAT %output%
[module/spotify]
type = custom/script
tail = true
interval = 5
; prefix symbol is shown before the text
format-prefix = " "
format = <label>
exec = ~/.config/polybar/scroll_spotify_status.sh
[module/spotify-prev]
type = custom/text
format = "󰒮"
click-left = playerctl previous -p spotify
[module/spotify-play-pause]
type = custom/ipc
hook-0 = echo '󰏤'
hook-1 = echo ''
initial = 1
click-left = playerctl play-pause -p spotify
[module/spotify-next]
type = custom/text
format = "󰒭"
click-left = playerctl next -p spotify