configure waybar and mpris.

This commit is contained in:
2025-10-13 11:37:57 +08:00
parent 078c65614b
commit 6444a74337
5 changed files with 87 additions and 89 deletions

View File

@@ -0,0 +1 @@
/home/agxcoy/.config/systemd/user/mpris-proxy.service

View File

@@ -0,0 +1 @@
/home/agxcoy/.config/systemd/user/playerctld.service

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Forward bluetooth media controls to MPRIS
[Service]
Type=simple
ExecStart=/usr/bin/mpris-proxy
[Install]
WantedBy=default.target

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Keep track of media player activity
[Service]
Type=oneshot
ExecStart=/usr/bin/playerctld daemon
[Install]
WantedBy=default.target

View File

@@ -1,65 +1,39 @@
{ {
"layer": "top", "layer": "top",
"modules-left": ["sway/workspaces", "niri/workspaces", "niri/window", "sway/mode"], "modules-left": ["niri/workspaces", "niri/window"],
"modules-center": ["clock"], "modules-center": ["clock"],
"modules-right": ["gamemode", "tray", "sway/scratchpad", "battery", "cpu", "memory", "pulseaudio"], "modules-right": ["mpris", "tray", "battery", "cpu", "memory", "temperature", "pulseaudio"],
"sway/scratchpad": { "sway/scratchpad": {
"format": "󱂬 {count}" "format": "󱂬 {count}"
}, },
"pulseaudio": { "pulseaudio": {
"format": " {volume}%", "format": " {volume}%",
"on-click": "swayosd-client --output-volume mute-toggle", "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
"on-click-right": "flatpak run com.saivert.pwvucontrol" "on-click-right": "flatpak run com.saivert.pwvucontrol"
}, },
"sway/workspaces": {
"format": "{name}{windows}",
"format-window-separator": "|",
"window-rewrite-default": " {class} ",
"window-format": "<span color='#e0e0e0'>{name}</span>",
"window-rewrite": {
"class<firefox>": " 󰈹 ",
"class<spotify>": " 󰓇 ",
"class<kitty>": "  ",
"class<vesktop>": "  ",
"class<kitty> title<nvim.*>": "  ",
"class<kitty> title<htop.*>": "  ",
"class<kitty> title<yazi.*>": " 󰈔 ",
"class<kitty> title<cava.*>": " 󰝪 ",
"class<kitty> title<man.*>": "  ",
"class<steam>": "  ",
"class<.*.bottles>": " 󰡔 ",
"class<heroic>": " 󱢾 ",
"class<org.gnome.Calculator>": " 󰪚 ",
"class<org.gnome.Builder>": "  ",
"class<io.github.idevecore.Valuta>": "  ",
"class<io.github.fizzyizzy05.binary>": "  ",
"class<org.gnome.Loupe>": " 󰋩 ",
"class<com.saivert.pwvucontrol>": " 󰕾 ",
"class<org.qbittorrent.qBittorrent>": "  ",
"class<VSCodium>": "  ",
"class<libreoffice-writer>": "  ",
"class<libreoffice-math>": "  ",
"class<libreoffice-calc>": "  ",
"class<libreoffice-base>": "  ",
"class<libreoffice-impress>": "  ",
"class<libreoffice-draw>": "  ",
"class<libreoffice>": "  ",
"class<libreoffice-startcenter>": "  ",
"class<soffice>": "  ",
"class<vlc>": " 󰕼 "
}
},
"niri/workspaces": { "niri/workspaces": {
"format": "{index}" "format": "{index}"
}, },
"niri/window": {
"format": "{}",
"icon": true,
"max-length": 40,
"icon-size": 14,
"rewrite": {
"(.*) — Mozilla Firefox": "$1",
"(.*) - Visual Studio Code": "$1",
"(.*) - VLC media player": "$1",
"Yazi: (.*)": "$1"
}
},
"mpris": { "mpris": {
"format": "{status_icon} {artist} - {title}", "format": "{status_icon} {artist} - {title}",
"format-stopped": "", "format-stopped": "",
"status-icons": { "status-icons": {
"paused": "", "paused": "",
"playing": "󰐊" "playing": "󰐊"
}, },
"interval": "0.1" "interval": "3"
}, },
"clock": { "clock": {
"format": "{:%d %b %H:%M}", "format": "{:%d %b %H:%M}",
@@ -69,19 +43,21 @@
"tray": { "tray": {
"spacing": 12 "spacing": 12
}, },
"gamemode": { "temperature": {
"glyph": "  ", "thermal-zone": 1,
"format": "{glyph}", // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"use-icon": false, "critical-threshold": 80,
"icon-spacing": 16 // "format-critical": "{temperatureC}°C {icon}",
"format": "{icon} {temperatureC}°C",
"format-icons": ["", "", ""]
}, },
"memory": { "memory": {
"format": " {percentage}%", "format": " {percentage}%",
"interval": 1 "interval": 5
}, },
"cpu": { "cpu": {
"format": " {usage}%", "format": " {usage}%",
"interval": 1 "interval": 2
}, },
"battery": { "battery": {
"format": "{icon} {capacity}%", "format": "{icon} {capacity}%",