From 69283dfea5a4aee58ee2cf14153c9eaf38b91de1 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 6 Feb 2026 09:35:14 +0100 Subject: [PATCH 1/2] nixos/flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/0999ed8f965bbbd991437ad9c5ed3434cecbc30e?narHash=sha256-ZbnG01yA3O8Yr1vUm3%2BNQ2qk9iRhS5bloAnuXHHy7%2Bc%3D' (2025-12-24) → 'github:nix-community/home-manager/0d782ee42c86b196acff08acfbf41bb7d13eed5b?narHash=sha256-3iVX1%2B7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8%3D' (2026-02-05) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/76701a179d3a98b07653e2b0409847499b2a07d3?narHash=sha256-5G1NDO2PulBx1RoaA6U1YoUDX0qZslpPxv%2Bn5GX6Qto%3D' (2025-12-23) → 'github:NixOS/nixpkgs/e576e3c9cf9bad747afcddd9e34f51d18c855b4e?narHash=sha256-tlFqNG/uzz2%2B%2BaAmn4v8J0vAkV3z7XngeIIB3rM3650%3D' (2026-02-03) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/3e2499d5539c16d0d173ba53552a4ff8547f4539?narHash=sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU%3D' (2025-12-25) → 'github:NixOS/nixpkgs/00c21e4c93d963c50d4c0c89bfa84ed6e0694df2?narHash=sha256-AYqlWrX09%2BHvGs8zM6ebZ1pwUqjkfpnv8mewYwAo%2BiM%3D' (2026-02-04) • Updated input 'sops-nix': 'github:Mic92/sops-nix/9836912e37aef546029e48c8749834735a6b9dad?narHash=sha256-BOKCwOQQIP4p9z8DasT5r%2Bqjri3x7sPCOq%2BFTjY8Z%2Bo%3D' (2025-12-21) → 'github:Mic92/sops-nix/17eea6f3816ba6568b8c81db8a4e6ca438b30b7c?narHash=sha256-ktjWTq%2BD5MTXQcL9N6cDZXUf9kX8JBLLBLT0ZyOTSYY%3D' (2026-02-03) --- nixos/flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 8c3214d..227c29a 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1766553861, - "narHash": "sha256-ZbnG01yA3O8Yr1vUm3+NQ2qk9iRhS5bloAnuXHHy7+c=", + "lastModified": 1770260404, + "narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", "owner": "nix-community", "repo": "home-manager", - "rev": "0999ed8f965bbbd991437ad9c5ed3434cecbc30e", + "rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1766473571, - "narHash": "sha256-5G1NDO2PulBx1RoaA6U1YoUDX0qZslpPxv+n5GX6Qto=", + "lastModified": 1770136044, + "narHash": "sha256-tlFqNG/uzz2++aAmn4v8J0vAkV3z7XngeIIB3rM3650=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "76701a179d3a98b07653e2b0409847499b2a07d3", + "rev": "e576e3c9cf9bad747afcddd9e34f51d18c855b4e", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1766651565, - "narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=", + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "type": "github" }, "original": { @@ -173,11 +173,11 @@ ] }, "locked": { - "lastModified": 1766289575, - "narHash": "sha256-BOKCwOQQIP4p9z8DasT5r+qjri3x7sPCOq+FTjY8Z+o=", + "lastModified": 1770145881, + "narHash": "sha256-ktjWTq+D5MTXQcL9N6cDZXUf9kX8JBLLBLT0ZyOTSYY=", "owner": "Mic92", "repo": "sops-nix", - "rev": "9836912e37aef546029e48c8749834735a6b9dad", + "rev": "17eea6f3816ba6568b8c81db8a4e6ca438b30b7c", "type": "github" }, "original": { From 747f5d3e692a0b1745584e6a7581e228f6eeeb20 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 14 Feb 2026 22:04:23 +0100 Subject: [PATCH 2/2] feat(remEYEnder): Add progress bar --- nixos/modules/services/remEYEnder/default.nix | 10 +++---- .../modules/services/remEYEnder/remEYEnder.sh | 1 + scripts/remEYEnder.sh | 30 +++++++++++++++++++ 3 files changed, 35 insertions(+), 6 deletions(-) create mode 120000 nixos/modules/services/remEYEnder/remEYEnder.sh create mode 100644 scripts/remEYEnder.sh diff --git a/nixos/modules/services/remEYEnder/default.nix b/nixos/modules/services/remEYEnder/default.nix index 4d3b5cd..c4708ae 100644 --- a/nixos/modules/services/remEYEnder/default.nix +++ b/nixos/modules/services/remEYEnder/default.nix @@ -2,8 +2,6 @@ let cfg = config.sisyphus.services.remEYEnder; - - icon = ./vecteezy_eyes-line-icon-vector-isolated_13932670.jpg; in { options.sisyphus.services.remEYEnder.enable = lib.mkEnableOption "Eye reminder"; @@ -13,10 +11,10 @@ in { enable = true; description = "Send an eye reminder"; serviceConfig.Type = "oneshot"; - script = '' - # Display reminder for 20 seconds. - ${pkgs.libnotify}/bin/notify-send -t 20000 --icon=${icon} "RemEYEnder" "Look away from your screen :)" - ''; + script = builtins.readFile ./remEYEnder.sh; + path = with pkgs; [ + libnotify + ]; }; timers.remEYEnder = { enable = true; diff --git a/nixos/modules/services/remEYEnder/remEYEnder.sh b/nixos/modules/services/remEYEnder/remEYEnder.sh new file mode 120000 index 0000000..57d41ce --- /dev/null +++ b/nixos/modules/services/remEYEnder/remEYEnder.sh @@ -0,0 +1 @@ +../../../../scripts/remEYEnder.sh \ No newline at end of file diff --git a/scripts/remEYEnder.sh b/scripts/remEYEnder.sh new file mode 100644 index 0000000..c6dd482 --- /dev/null +++ b/scripts/remEYEnder.sh @@ -0,0 +1,30 @@ +DURATION=20 # How long it takes to progress the bar fully +STEPS=100 # In how many steps to progress (> 0) + +# Trick to fake decimals +EXP=3 +interval_ms="$(( "${DURATION}" * ( 10 ** "${EXP}" ) / "${STEPS}" ))" +padded_interval_ms="$(printf "%0${EXP}d" "${interval_ms}")" +interval_s="${padded_interval_ms:0:-${EXP}}.${padded_interval_ms:-${EXP}}" + +end_time="$(( "$( date '+%s' )" + "${DURATION}" + 1 ))" + +# notify-send args +replace_id="${end_time}" +expire_time="$(( "${interval_ms}" + 1 ))" # To avoid flickering + +counter=0 +while [[ "${end_time}" -gt "$( date '+%s' )" ]]; do + # Remap to [0, 100] + remaining_part="$(( ("${STEPS}" - "${counter}") * 100 / "${STEPS}" ))" + + notify-send \ + 'Look away from your screen :)' 'RemEYEnder' \ + --hint="int:value:${remaining_part}" \ + --category='sysinfo' \ + --replace-id="${replace_id}" \ + --expire-time="${expire_time}" + + counter="$(( "${counter}" + 1 ))" + sleep "${interval_s}" +done