2023-05-31 05:06:51 +02:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
let
|
|
|
|
libnotify = lib.getExe pkgs.libnotify;
|
2023-11-14 17:49:12 +01:00
|
|
|
systemctl = "${pkgs.systemd}/bin/systemctl";
|
2023-05-31 05:06:51 +02:00
|
|
|
|
|
|
|
wlsunset-toggle = pkgs.writeShellScriptBin "wlsunset-toggle" ''
|
|
|
|
if [ "active" = "$(systemctl --user is-active wlsunset.service)" ]
|
|
|
|
then
|
2023-11-14 17:49:12 +01:00
|
|
|
${systemctl} --user stop wlsunset.service
|
2023-05-31 05:06:51 +02:00
|
|
|
${libnotify} "Stopped wlsunset"
|
|
|
|
else
|
2023-11-14 17:49:12 +01:00
|
|
|
${systemctl} --user start wlsunset.service
|
2023-05-31 05:06:51 +02:00
|
|
|
${libnotify} "Started wlsunset"
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
in
|
2023-05-31 04:53:44 +02:00
|
|
|
{
|
|
|
|
services.wlsunset = {
|
|
|
|
enable = true;
|
2023-07-17 16:50:07 +02:00
|
|
|
systemdTarget = "hyprland-session.target";
|
2023-05-31 04:53:44 +02:00
|
|
|
|
|
|
|
# Random Netherlands coordinates
|
|
|
|
latitude = "53.2";
|
|
|
|
longitude = "6.5";
|
|
|
|
};
|
2023-05-31 05:06:51 +02:00
|
|
|
|
|
|
|
home.packages = [ wlsunset-toggle ];
|
2023-05-31 04:53:44 +02:00
|
|
|
}
|