dotfiles/.config/waybar/config.jsonc.cgt

93 lines
3.5 KiB
Text
Raw Normal View History

2023-09-02 14:02:00 +02:00
;<! tmpl:setPostProcessor(opt.fennelToJSON) !>
;; vim: ft=fennel
2024-08-23 22:04:25 +02:00
<!
local cpu_temp_hwmon = nil
for d in require("lfs").dir("/sys/class/hwmon") do
if d ~= "." and d ~= ".." then
local namef = io.open("/sys/class/hwmon/" .. d .. "/name", "r")
if namef:read("*a"):gsub("%s+", "") == "coretemp" then
cpu_temp_hwmon = "/sys/class/hwmon/" .. d .. "/temp1_input"
end
namef:close()
end
end
!>
2024-06-17 21:17:17 +02:00
(local format-icons ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"])
2023-09-02 14:02:00 +02:00
{:spacing 4
:layer :top
;<! if opt.wayland_compositor == "river" then !>
:modules-left [:river/tags :river/window]
;<! elseif opt.wayland_compositor == "hyprland" then !>
:modules-left [:hyprland/workspaces :hyprland/window]
;<! end !>
:modules-right [:mpris
2024-06-17 21:17:17 +02:00
:cava
2023-09-02 14:02:00 +02:00
:cpu
:memory
2024-08-10 18:36:06 +02:00
:network
2023-09-02 14:02:00 +02:00
:pulseaudio
:gamemode
:temperature
:battery
:clock
:tray]
2024-06-17 21:17:17 +02:00
:cava {:hide_on_silence true
:bars 16
:bar_delimiter 0
:method :pipewire
: format-icons}
2023-09-02 14:02:00 +02:00
:mpris {:format "{status_icon} {dynamic}"
2024-05-08 23:09:29 +02:00
:interval 5
2023-09-02 14:02:00 +02:00
:dynamic-order [:title :artist :position :length]
:dynamic-importance-order [:position :length :artist :album]
2023-09-02 14:02:00 +02:00
:status-icons {:playing "󰏤" :paused "󰐊" :stopped "󰓛"}
2024-08-23 22:57:43 +02:00
:title-len 32
:dynamic-len 64
2023-09-02 14:02:00 +02:00
:dynamic-separators " 󱓜 "}
:gamemode {:format "{glyph} {count}"}
:tray {:spacing 10}
:clock {:tooltip-format "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
:format-alt "{:%Y-%m-%d}"}
2024-04-22 12:08:09 +02:00
:cpu {:format (.. (faccumulate [s "" i 0 (- (cg.opt.system :nproc) 1)]
(.. s "{icon" i "}")) " {usage}% ")
2024-06-17 21:17:17 +02:00
:interval 2
: format-icons}
2023-09-02 14:02:00 +02:00
:memory {:format "{}% "}
2024-08-23 22:04:25 +02:00
:temperature {:hwmon-path "<% cpu_temp_hwmon %>"
2023-09-02 14:02:00 +02:00
:critical-threshold 80
:format "{temperatureC}°C {icon}"
:format-icons ["" "" ""]}
:battery {:states {:warning 50 :critical 20}
:format "{capacity}% {icon}"
:format-charging "{capacity}% 󰂄"
:format-plugged "{capacity}% "
:format-alt "{time} {icon}"
:format-icons ["" "" "" "" ""]}
:pulseaudio (let [fstring (fn [muted bluetooth]
(.. (if muted "󰝟" "{volume}%")
(if (and muted (not bluetooth)) "" " {icon}")
(if bluetooth "" "") " {format_source}"))]
{:format (fstring false false)
:format-muted (fstring true false)
:format-bluetooth (fstring false true)
:format-bluetooth-muted (fstring true true)
:format-source "{volume}% "
:format-source-muted ""
:format-icons {:headphone ""
2024-07-16 22:59:15 +02:00
:hands-free "󰋏"
:headset "󰋎"
2023-09-02 14:02:00 +02:00
:phone ""
:portable ""
:car ""
:default ["" "" ""]}
2024-08-10 18:36:06 +02:00
:on-click :pavucontrol})
:network {:interval 10
:format "{bandwidthDownBytes}  {bandwidthUpBytes} "
:tooltip-format-ethernet "{ifname} {ipaddr}"
:tooltip-format-wifi "{essid} {ipaddr}"
:on-click "<% opt.term.command %> nmtui"
2024-08-28 12:22:28 +02:00
:on-click-right "<% opt.term.command %> nmtui"}}