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 = ''
// -*- mode: jsonc -*-
{
@ -13,15 +13,21 @@
"sway/workspaces",
"sway/scratchpad",
],
"modules-center": [
"clock",
"mpris"
],
"modules-right": [
"sway/language",
"pulseaudio",
"battery",
"clock",
"cpu",
"temperature",
"memory",
"tray"
],
"sway/scratchpad": {
"format": "{icon} {count}",
"format": "{icon} {count}",
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
@ -49,13 +55,37 @@
"format-icons": ["󰂎", "󱊡", "󱊢", "󱊣", "󱊣"]
},
"pulseaudio": {
"scroll-step": 0,
"scroll-step": ${toString(setting.volume.step)},
"format": "{volume}% {icon}",
"format-muted": "󰸈",
"format-icons": {
"default": ["", "", ""]
},
"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 = ''
* {
/* `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;
}
'';

View file

@ -4,6 +4,7 @@
#battery,
#pulseaudio,
#tray,
#mpris,
#language {
padding: 8px 12px;
}
@ -11,5 +12,17 @@
#clock {
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 = ''
bindsym $mod+${key.sway.bar} exec pkill -SIGUSR1 waybar
exec waybar -c ''${WAYBAR_CONFIG} -s ''${WAYBAR_STYLE}
exec nm-applet
'';
}