Waybar : Add music & cpu info.

This commit is contained in:
Dmitry Voronin 2024-05-04 09:23:33 +03:00
parent 34e7a12b74
commit aaeb04dbf4
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
4 changed files with 49 additions and 5 deletions

View file

@ -1,4 +1,4 @@
{ ... }: { { setting, ... }: {
text = '' text = ''
// -*- mode: jsonc -*- // -*- mode: jsonc -*-
{ {
@ -13,11 +13,17 @@
"sway/workspaces", "sway/workspaces",
"sway/scratchpad", "sway/scratchpad",
], ],
"modules-center": [
"clock",
"mpris"
],
"modules-right": [ "modules-right": [
"sway/language", "sway/language",
"pulseaudio", "pulseaudio",
"battery", "battery",
"clock", "cpu",
"temperature",
"memory",
"tray" "tray"
], ],
"sway/scratchpad": { "sway/scratchpad": {
@ -49,13 +55,37 @@
"format-icons": ["󰂎", "󱊡", "󱊢", "󱊣", "󱊣"] "format-icons": ["󰂎", "󱊡", "󱊢", "󱊣", "󱊣"]
}, },
"pulseaudio": { "pulseaudio": {
"scroll-step": 0, "scroll-step": ${toString(setting.volume.step)},
"format": "{volume}% {icon}", "format": "{volume}% {icon}",
"format-muted": "󰸈", "format-muted": "󰸈",
"format-icons": { "format-icons": {
"default": ["", "", ""] "default": ["", "", ""]
}, },
"on-click": "pavucontrol" "on-click": "pavucontrol"
},
"mpris": {
"format": "{player_icon} {artist} - {title}",
"format-paused": "{status_icon} {artist} - {title}",
"player-icons": {
"default": "",
"firefox": "󰈹",
"mpv": ""
},
"status-icons": {
"paused": ""
},
// "ignored-players": ["firefox"]
},
"cpu": {
"format": "{usage}% {load}",
"tooltip": false
},
"memory": {
"format": "{percentage}%"
},
"temperature": {
"hwmon-path": "/sys/class/hwmon/hwmon1/temp1_input",
"format": "{temperatureC}°C",
} }
} }
''; '';

View file

@ -2,7 +2,7 @@
text = '' text = ''
* { * {
/* `otf-font-awesome` is required to be installed for icons */ /* `otf-font-awesome` is required to be installed for icons */
font-family: "${style.font.serif.name}", FontAwesome; font-family: "${style.font.serif.name}", "Terminess Nerd Font Propo";
font-size: ${toString(style.font.size.desktop)}px; font-size: ${toString(style.font.size.desktop)}px;
} }
''; '';

View file

@ -4,6 +4,7 @@
#battery, #battery,
#pulseaudio, #pulseaudio,
#tray, #tray,
#mpris,
#language { #language {
padding: 8px 12px; padding: 8px 12px;
} }
@ -11,5 +12,17 @@
#clock { #clock {
font-weight: bold; font-weight: bold;
} }
#cpu {
padding: 8px 0 8px 12px;
}
#temperature {
padding: 8px 0 8px 0;
}
#memory {
padding: 8px 12px 8px 0;
}
''; '';
} }

View file

@ -2,5 +2,6 @@
text = '' text = ''
bindsym $mod+${key.sway.bar} exec pkill -SIGUSR1 waybar bindsym $mod+${key.sway.bar} exec pkill -SIGUSR1 waybar
exec waybar -c ''${WAYBAR_CONFIG} -s ''${WAYBAR_STYLE} exec waybar -c ''${WAYBAR_CONFIG} -s ''${WAYBAR_STYLE}
exec nm-applet
''; '';
} }