From 0955dc45350058440db445f39a181fe48b064709 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Tue, 24 Dec 2024 18:09:12 +0300 Subject: [PATCH] Waybar: Separate styles for date and time. --- home/file/waybar/config/default.nix | 18 +++++++++++++++--- home/file/waybar/style/Plugin.css | 7 ++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/home/file/waybar/config/default.nix b/home/file/waybar/config/default.nix index ea20151a..a649cc26 100644 --- a/home/file/waybar/config/default.nix +++ b/home/file/waybar/config/default.nix @@ -15,7 +15,7 @@ in start_hidden = false; output = [ config.module.display.primary ]; modules-left = [ - "clock" + "group/datetime" "sway/scratchpad" "mpris" ]; @@ -42,8 +42,13 @@ in "" ]; }; - clock = { - format = "{:%H:%M %a %d}"; + "clock#time" = { + format = "{:%H:%M}"; + on-click = "xdg-open https://cloud.voronind.com/apps/calendar/"; + tooltip-format = "{calendar}"; + }; + "clock#date" = { + format = "{:%a %d}"; on-click = "xdg-open https://cloud.voronind.com/apps/calendar/"; tooltip-format = "{calendar}"; }; @@ -165,6 +170,13 @@ in "custom/taghw2" ]; }; + "group/datetime" = { + orientation = "horizontal"; + modules = [ + "clock#time" + "clock#date" + ]; + }; "custom/display" = { exec = "swayscript displaywidget"; on-click = "sleep 0.1 && swayscript dnd"; # HACK: https://github.com/Alexays/Waybar/issues/2166 & https://github.com/Alexays/Waybar/issues/1968 diff --git a/home/file/waybar/style/Plugin.css b/home/file/waybar/style/Plugin.css index d0a3bef6..81af5969 100644 --- a/home/file/waybar/style/Plugin.css +++ b/home/file/waybar/style/Plugin.css @@ -12,9 +12,9 @@ } /* Padding for global widgets. */ -#clock, #custom-display, #custom-network, +#datetime, #mpris, #pulseaudio, #scratchpad { @@ -23,6 +23,7 @@ } /* Padding for combined widgets. */ +#clock.date, #cpu.load, #custom-powerlimit, #custom-powersave, @@ -33,9 +34,9 @@ /* Hover style. */ #batteryinfo:hover, -#clock:hover, #custom-display:hover, #custom-network:hover, +#datetime:hover, #hardware:hover, #mpris:hover, #pulseaudio:hover, @@ -89,6 +90,6 @@ border-top: @borderSize@ solid @accent@; } -#clock { +#clock.time { font-weight: bold; }