nix/module/desktop/waybar/config/default.nix

133 lines
3.3 KiB
Nix
Raw Normal View History

2024-05-08 21:12:48 +03:00
{ setting, style, ... }: let
refreshInterval = 1;
in {
2024-05-02 04:47:21 +03:00
text = ''
// -*- mode: jsonc -*-
{
2024-05-07 03:22:01 +03:00
"layer": "top",
"position": "top",
"height": 30,
"spacing": 4,
"margin-top": ${toString(style.window.gap)},
"margin-left": ${toString(style.window.gap)},
"margin-right": ${toString(style.window.gap)},
2024-05-07 01:39:13 +03:00
"mode": "dock",
// "exclusive": false,
2024-05-02 04:47:21 +03:00
"start_hidden": true,
"modules-left": [
"sway/workspaces",
"sway/scratchpad",
],
2024-05-04 09:23:33 +03:00
"modules-center": [
"clock",
"mpris"
],
2024-05-02 04:47:21 +03:00
"modules-right": [
"sway/language",
"pulseaudio",
"battery",
"custom/powerlimit",
2024-05-04 09:23:33 +03:00
"cpu",
2024-05-08 22:34:32 +03:00
// "temperature",
2024-05-04 09:23:33 +03:00
"memory",
"custom/powersave",
2024-05-08 19:19:59 +03:00
"custom/display",
2024-05-02 04:47:21 +03:00
"tray"
],
2024-05-07 04:12:11 +03:00
"sway/language": {
"tooltip": false,
"on-click": "swaymsg 'input * xkb_switch_layout next'"
},
2024-05-02 04:47:21 +03:00
"sway/scratchpad": {
2024-05-04 09:23:33 +03:00
"format": "{icon} {count}",
2024-05-02 04:47:21 +03:00
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}",
"on-click": "swaymsg 'scratchpad show'",
"on-click-right": "sway_scratchpad_kill"
2024-05-02 04:47:21 +03:00
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big><tt>{calendar}</tt></big>",
"format-alt": "{:%d %a %H:%M}"
},
"battery": {
"states": {
"good": 60,
"warning": 40,
"critical": 20
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
"format-icons": ["󰂎", "󱊡", "󱊢", "󱊣", "󱊣"],
"on-click-right": "powerlimit toggle"
},
"custom/powerlimit": {
"exec": "powerlimit waybar",
2024-05-08 21:12:48 +03:00
"interval": ${toString(refreshInterval)},
"on-click-right": "powerlimit toggle"
2024-05-02 04:47:21 +03:00
},
"pulseaudio": {
2024-05-04 09:23:33 +03:00
"scroll-step": ${toString(setting.volume.step)},
2024-05-02 04:47:21 +03:00
"format": "{volume}% {icon}",
"format-muted": "󰸈",
"format-icons": {
"default": ["", "", ""]
},
"on-click": "sound_output_cycle",
"on-click-right": "pavucontrol"
2024-05-04 09:23:33 +03:00
},
"mpris": {
"format": "{player_icon} {artist} - {title}",
"format-paused": "{status_icon} {artist} - {title}",
"player-icons": {
"default": "",
"firefox": "󰈹",
"mpv": ""
},
"status-icons": {
"paused": ""
},
"on-click-middle": "playerctl stop"
2024-05-04 09:23:33 +03:00
// "ignored-players": ["firefox"]
},
"cpu": {
2024-05-04 10:06:29 +03:00
"format": "{usage}% ({load})",
2024-05-04 17:37:03 +03:00
"tooltip": false,
"on-click": "foot -e bash -c btop",
"on-click-right": "powersave toggle"
2024-05-04 09:23:33 +03:00
},
"memory": {
2024-05-04 17:37:03 +03:00
"format": "{percentage}%",
"on-click": "foot -e bash -c btop",
"on-click-right": "powersave toggle"
2024-05-04 09:23:33 +03:00
},
"temperature": {
2024-05-04 17:37:03 +03:00
"format": "{temperatureC}°C",
"on-click": "foot -e bash -c btop",
2024-05-07 04:12:11 +03:00
"on-click-right": "powersave toggle"
},
"custom/powersave": {
"exec": "powersave waybar",
2024-05-08 21:12:48 +03:00
"interval": ${toString(refreshInterval)},
"on-click": "foot -e bash -c btop",
"on-click-right": "powersave toggle"
2024-05-08 19:19:59 +03:00
},
"custom/display": {
2024-05-08 21:12:48 +03:00
"exec": "swayscript monbar",
"interval": ${toString(refreshInterval)},
"return-type": "json",
2024-05-08 21:53:43 +03:00
"on-click": "sleep 0.1 && swayscript montoggle", // FIXME: remove sleep when resolved: https://github.com/Alexays/Waybar/issues/2166
"on-click-right": "sleep 0.1 && swayscript vrrtoggle"
2024-05-02 04:47:21 +03:00
}
}
'';
}