From dab2a8722b41e3b289d286ec3c23e49aaa848e74 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Wed, 26 Mar 2025 15:44:48 +0100 Subject: [PATCH] feat: adds minute counter, will be trying that out for now --- modules/home/waybar/default.nix | 32 ++++++++++++++++---------------- modules/home/waybar/scripts.nix | 8 ++++++++ 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/modules/home/waybar/default.nix b/modules/home/waybar/default.nix index cdba48f..c8d0d33 100644 --- a/modules/home/waybar/default.nix +++ b/modules/home/waybar/default.nix @@ -268,14 +268,14 @@ "critical": 10 }, "format-time": "{H}:{m}", - "format": "{icon} {time} {capacity}%", - "format-discharging": "{icon} {capacity}%", - "format-discharging-warning": "{icon} {capacity}%", - "format-discharging-critical": "{icon} {capacity}%", - "format-charging": "{icon} {capacity}% @ {power:2.0f}W", - "format-full": "󱐥 {capacity}%", - "format-not-charging": "󱐤 {capacity}%", - "format-icons": ["", "", "", "", ""], + "format": "{icon} {time} {capacity}%", + "format-discharging": "{icon} {capacity}%", + "format-discharging-warning": "{icon} {capacity}%", + "format-discharging-critical": "{icon} {capacity}%", + "format-charging": "{icon} {capacity}% @ {power:2.0f}W", + "format-full": "󱐥 {capacity}%", + "format-not-charging": "󱐤 {capacity}%", + "format-icons": [" ", " ", " ", " ", " "], }, "custom/notification": { @@ -301,7 +301,7 @@ "group/clock": { "orientation": "horizontal", - "modules": [ "clock#time", "clock#date" ], + "modules": [ "custom/clock#minutes", "clock#time", "clock#date" ], "drawer": { "transition-left-to-right": false, "transition-duration": 500 @@ -334,18 +334,18 @@ "clock#time": { "interval": 60, - "format": " {:%I:%M %p (%Z)}", - "tooltip": true, - "tooltip-format": "{tz_list}", - "timezones": [ - "Europe/Amsterdam", - ], + "format": " {:%I:%M %p}", "actions": { "on-scroll-up": "tz_up", "on-scroll-down": "tz_down" } + }, + + "custom/clock#minutes": { + "interval": 60, + "format": " {} ", + "exec": "~/.local/bin/waybar-minutes" } - } ] ''; diff --git a/modules/home/waybar/scripts.nix b/modules/home/waybar/scripts.nix index 279dbd1..e0766b9 100644 --- a/modules/home/waybar/scripts.nix +++ b/modules/home/waybar/scripts.nix @@ -144,6 +144,14 @@ # ''; # }; }; + "/home/${username}/.local/bin/waybar-minutes" = { + executable = true; + text = '' + #!/bin/sh + + echo $(( (24 - $(date +%H)) * 60 - $(date +%M) )) + ''; + }; }; home.packages = with pkgs; [ wf-recorder