Files
dotfiles/dot_config/waybar/config.tmpl
2026-01-26 15:24:19 +01:00

269 lines
7.1 KiB
Cheetah
Executable File

// vim: ft=json5
{{ $hasBattery := false -}}
{{- if eq .chezmoi.os "linux" -}}
{{- if (glob "/sys/class/power_supply/BAT*") -}}
{{- $hasBattery = true -}}
{{- end -}}
{{- end -}}
{
"include": ["~/.config/waybar/media.json"],
"layer": "top",
{{- with (index . "swayProfile") }}
{{ include (printf "dot_config/waybar/outputs.d/%s.conf" .) }}
{{- end }}
"gtk-layer-shell": "true",
"spacing": 0,
"margin-top": 0,
"margin-bottom": 2,
"height": 32,
"modules-left": ["custom/launcher","sway/workspaces","cpu","memory","disk","sway/window"],
"modules-center": ["custom/media"],
"modules-right": ["custom/update_audio","sway/mode","custom/kernel",{{- if eq .chezmoi.os "linux" -}}"network"{{- else }} "custom/network"{{ end}},"pulseaudio","tray","clock",{{- if $hasBattery -}}"battery",{{- end -}}"custom/power"],
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"wlr/taskbar": {
"format": "{icon} {app_id}",
"icon-size": 16,
"icon-theme": "Papirus",
"tooltip-format": "{title}",
"on-click": "activate",
"on-click-middle": "close",
"on-click-right": "minimize-raise",
"ignore-list": [
"Alacritty"
],
"app_ids-mapping": {
}
},
"sway/workspaces": {
"sort-by-name": true,
"on-click": "activate",
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": "",
"10": "",
"urgent": "",
"active": "",
"focused": ""
},
"window-rewrite": {}
// "sort-by-coordinates": true
},
"sway/window": {
"format": "{}",
"max-length": 45,
// "icon":true,
"rewrite": {
"(.*) — Mozilla Firefox": "<span color=\"#EE915D\" >󰈹</span> $1",
"(.*)gitui(.*)": "<span color=\"#EE915D\" >󰊢</span> Gitui",
"(jika@.+)": ">_ $1",
"nvim.*": "<span color=\"#8bcd5b\" ></span> NeoVim"
},
"tooltip": false
},
"temperature": {
"hwmon-path": "/sys/module/k10temp/drivers/pci:k10temp/0000:00:18.3/hwmon/hwmon3/temp1_input",
"format": " {temperatureC}°C",
"interval": 2,
"on-click" : "",
},
"sway/language": {
"format": "{short}  "
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
"spacing": 10,
"icon-size": 14,
},
"clock": {
// "timezone": "America/New_York",
"format": " {:%H:%M}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "󰃭 {:%A, %B %d, %Y}",
"on-click" : "",
},
"backlight": {
// "device": "acpi_video1",
"format": " {percent}%",
},
"cpu": {
"format": "{usage}% ",
"tooltip": false,
"interval": 2,
"on-click" : "alacritty -e htop",
},
"memory": {
"format": "{}%  ",
"interval": 5,
"on-click" : "alacritty -e htop",
},
"custom/memory": {
"format": "{} ",
"interval": 5,
"exec": "$HOME/.local/bin/mem3",
"on-click" : "",
},
"disk": {
"interval": 30,
"format": "{percentage_used}% 󰋊",
"path": "/",
"on-click" : "",
},
"network": {
// "interface": "wlan0", // (Optional) To force the use of this interface
"format-wifi": " {bandwidthDownBytes}",
"format-ethernet": " {ifname}: {ipaddr}/{cidr}",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "睊 Not connected",
"format-alt": "{ifname}: {ipaddr}/{cidr}",
"tooltip-format": "{essid} {signalStrength}%"
},
"battery": {
"format": "{icon} {capacity}%",
"states": {
"warning": 30,
"critical": 15
},
"format-icons": ["", "", "", "", ""]
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}% {format_source}",
"format-bluetooth-muted": "  {volume}% {format_source}",
"format-muted": " {format_source}",
"format-source": "",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"tooltip-format": "{desc}, {volume}%",
"on-scroll-up": "mixer vol=+5%",
"on-scroll-down": "mixer vol=-5%",
"on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle && mixer vol.mute=toggle",
"on-click-right": "pactl set-source-mute @DEFAULT_SOURCE@ toggle",
"on-click-middle": "pavucontrol"
},
"custom/update_audio": {
"format":"",
"exec": "pactl get-sink-volume @DEFAULT_SINK@",
"restart-interval": 1,
},
"custom/updater":{
"format": "<span font='14' rise='1000'></span> {}",
"exec": "checkupdates | wc -l",
"exec-if": "[[ $(checkupdates | wc -l) ]]",
"interval": 300,
"on-click": "kitty --class update -T update -e yay -Syu && notify-send -i '/usr/share/icons/hicolor/256x256/apps/kitty.png' 'Kitty Terminal' 'The system has been updated' "
},
"custom/power": {
"format": "",
"on-click": "~/.config/rofi/powermenu",
"on-click-right": "killall -9 rofi",
"tooltip": false
},
"custom/launcher": {
{{ if eq .chezmoi.os "linux" -}}
"format": "󰣇",
{{ else -}}
"format": "",
{{ end -}}
"on-click": "~/.config/rofi/launcher",
"on-click-right": "killall -9 rofi",
"tooltip": false
},
"custom/dunst": {
"exec": "~/.config/waybar/scripts/dunst.sh",
"on-click": "dunstctl set-paused toggle",
"restart-interval": 1,
"format": "{}",
"return-type": "json",
"on-click" : "",
},
"custom/dot4": {
"format": " ",
"on-click" : "",
},
"custom/dot": {
"format": "",
"on-click" : "",
},
"custom/dot2": {
"format": " ",
"on-click" : "",
},
"custom/dot3": {
"format": " ",
"on-click" : "",
},
"custom/network": {
"format": "󰈀 {} Mb/s",
"exec": "netstat -w 1 -q 1 -I re0 | tail -n 1 | awk -F ' ' '{mb =0 $4/1048576; printf \"%.2f\", mb}'",
"interval": 1,
"on-click" : "",
},
"custom/gputmp": {
"format": "{}",
"exec": "$HOME/.local/bin/gputemp",
"interval": 2,
"on-click" : "",
},
"custom/uptime": {
"format": " {}",
"interval": 30,
"exec": "$HOME/.local/bin/upt2",
"on-click" : "",
},
"custom/kernel": {
{{ if eq .chezmoi.os "linux" -}}
"format": "󰣇 {}",
"exec": "uname -rn | cut -d '-' -f1",
{{ else -}}
"format": " {}",
"exec": "uname -v | cut -d '-' -f1",
{{ end -}}
"interval": 7200,
"on-click" : "",
},
"custom/eix": {
"format": "{}  ",
"interval": 3600, // every hour
"exec": "(eix --installed --upgrade --format '<installedversions:NAMEVERSION>') | wc -l",
"exec-if": "exit 0", // always run; consider advanced run conditions
"signal": 8,
"tooltip": false,
}
}