From 96281526f578f8bb03d61475157d5aaddae057c7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 3 Mar 2024 14:10:09 +0800 Subject: [PATCH] feat(waybar): better calendar --- .config/waybar/style.css | 1 + .config/waybar/sway-modules.json | 165 ++++++++++++++++++------------- 2 files changed, 96 insertions(+), 70 deletions(-) diff --git a/.config/waybar/style.css b/.config/waybar/style.css index e57a81b..6378eb7 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -54,6 +54,7 @@ window#waybar { #clock { color: @foreground; + font-weight: bold; } #battery { diff --git a/.config/waybar/sway-modules.json b/.config/waybar/sway-modules.json index 5ccceb2..94bf97a 100644 --- a/.config/waybar/sway-modules.json +++ b/.config/waybar/sway-modules.json @@ -1,72 +1,97 @@ { - "sway/workspaces": { - "show_special": true, - "on-click": "activate" - }, - "sway/window": { - "max-length": 50 - }, - "tray": { - "spacing": 10 - }, - "cpu": { - "format": " {load}", - "format-alt": " {usage}% @ {avg_frequency}GHz" - }, - "memory": { - "format": "󰍛 {used:0.1f}G / {total:0.1f}G", - "format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G" - }, - "network": { - "format-wifi": " {essid} ({signalStrength}%)", - "format-ethernet": "󰈀 {ifname}", - "format-linked": " {ifname}", - "format-disconnected": "󰌙 Disconnected", - "format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}", - "tooltip-format": "{ifname} via {gwaddr}" - }, - "battery": { - "states": { - "good": 75, - "warning": 15, - "critical": 5 - }, - "format": "{icon} {capacity}%", - "format-charging": "󰉁 {capacity}%", - "format-plugged": " {capacity}%", - "format-alt": "{icon} ETA: {time}", - "format-icons": ["", "", "", "", ""] - }, - "clock": { - "format": "{:󰅐 %H:%M  %m-%d}", - "tooltip-format": "{:%Y %B}\n{calendar}" - }, - "custom/notification": { - "tooltip": true, - "format": "{icon}", - "format-icons": { - "notification": " Unread", - "none": " Empty", - "dnd-notification": " DND on", - "dnd-none": " DND on" - }, - "return-type": "json", - "exec-if": "which swaync-client", - "exec": "swaync-client -swb", - "on-click": "swaync-client -t -sw", - "on-click-right": "swaync-client -d -sw", - "escape": true - }, - "custom/player": { - "format": "{icon} {}", - "format-icons": { - "Playing": "󰎈 ", - "Paused": "󰏤 " - }, - "return-type": "json", - "exec": "playerctl -a metadata --format '{\"text\": \"{{playerName}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{markup_escape(title)}} - {{markup_escape(album)}}\", \"class\": \"{{status}}\", \"alt\": \"{{status}}\" }' -F", - "max-length": 40, - "on-click": "playerctl play-pause", - "on-click-right": "pavucontrol" - } + "sway/workspaces": { + "show_special": true, + "on-click": "activate" + }, + "sway/window": { + "max-length": 50 + }, + "tray": { + "spacing": 10 + }, + "cpu": { + "format": " {load}", + "format-alt": " {usage}% @ {avg_frequency}GHz" + }, + "memory": { + "format": "󰍛 {used:0.1f} / {total:0.1f}G", + "format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G" + }, + "network": { + "format-wifi": " {essid} ({signalStrength}%)", + "format-ethernet": "󰈀 {ifname}", + "format-linked": " {ifname}", + "format-disconnected": "󰌙 Disconnected", + "format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}", + "tooltip-format": "{ifname} via {gwaddr}" + }, + "battery": { + "states": { + "good": 75, + "warning": 15, + "critical": 5 + }, + "format": "{icon} {capacity}%", + "format-charging": "󰉁 {capacity}%", + "format-plugged": " {capacity}%", + "format-alt": "{icon} ETA: {time}", + "format-icons": [ + "", + "", + "", + "", + "" + ] + }, + "clock": { + "format": "{:󰅐 %H:%M}", + "format-alt": "{: %m-%d}", + "tooltip-format": "{calendar}", + "calendar": { + "mode": "year", + "mode-mon-col": 3, + "on-scroll": 1, + "on-click-right": "mode", + "format": { + "months": "{}", + "days": "{}", + "weeks": "W{}", + "weekdays": "{}", + "today": "{}" + } + }, + "actions": { + "on-click-right": "mode", + "on-scroll-down": "shift_up", + "on-scroll-up": "shift_down" + } + }, + "custom/notification": { + "tooltip": true, + "format": "{icon}", + "format-icons": { + "notification": " Unread", + "none": " Empty", + "dnd-notification": " DND on", + "dnd-none": " DND on" + }, + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true + }, + "custom/player": { + "format": "{icon} {}", + "format-icons": { + "Playing": "󰎈 ", + "Paused": "󰏤 " + }, + "return-type": "json", + "exec": "playerctl -a metadata --format '{\"text\": \"{{playerName}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{markup_escape(title)}} - {{markup_escape(album)}}\", \"class\": \"{{status}}\", \"alt\": \"{{status}}\" }' -F", + "max-length": 40, + "on-click": "playerctl play-pause", + "on-click-right": "pavucontrol" + } }