Compare commits

...

2 Commits

4 changed files with 25 additions and 16 deletions

View File

@ -12,6 +12,7 @@ top@{ inputs, ... }: {
bingwp = config.packages.bingwp;
screenshot = config.packages.screenshot;
cursors = config.packages.cursors;
wpd = config.packages.wpd;
})
inputs.sal.overlays.default
];

View File

@ -442,20 +442,10 @@ toplevel@{ moduleWithSystem, ... }: {
timers = { rbingwp = { Timer = { OnCalendar = "*-*-* 10:00:00"; Persistent = true; }; Install = { WantedBy = [ "timers.target" ]; }; }; };
services = {
wpd = {
Service = {
Environment = [ "PATH=${pkgs.xdg-user-dirs}/bin:${pkgs.swaybg}/bin" ];
ExecStart = [ "${pkgs.nushell}/bin/nu -c 'swaybg -i ((xdg-user-dir PICTURES) | path split | path join bg.png)'" ];
};
};
bingwp = {
Service = { Type = "oneshot"; Environment = [ "PATH=${pkgs.xdg-user-dirs}/bin:${pkgs.nushell}/bin" ]; ExecStart = [ "${pkgs.bingwp}/bin/bingwp" ]; };
};
rbingwp = {
Install = { WantedBy = [ "sway-session.target" ]; };
Unit = { Description = "Restart bingwp and wpd services"; After = "graphical-session-pre.target"; PartOf = "graphical-session.target"; };
Unit = { Description = "Switch background every x minutes"; After = "graphical-session-pre.target"; PartOf = "graphical-session.target"; };
Service = {
Type = "oneshot";
ExecStart = [ "${pkgs.nushell}/bin/nu -c '${pkgs.systemd}/bin/systemctl --user restart bingwp.service; ${pkgs.systemd}/bin/systemctl --user restart wpd.service'" ];
ExecStart = [ "${pkgs.wpd}/bin/wpd" ];
};
};
};

View File

@ -19,7 +19,7 @@ top@{ moduleWithSystem, ... }: {
time.timeZone = "Europe/Prague";
fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ];
environment = {
systemPackages = with pkgs; [ cmatrix uutils-coreutils cryptsetup fd file git glibc gnumake mlocate moreutils openssh openssl procs ripgrep srm unzip vim zip just ];
systemPackages = with pkgs; [ cmatrix uutils-coreutils-noprefix cryptsetup fd file git glibc gnumake mlocate openssh openssl procs ripgrep srm unzip vim zip just ];
shells = with pkgs; [ zsh nushell ];
};
programs = { zsh.enable = true; nix-ld.enable = true; dconf.enable = true; };

View File

@ -8,9 +8,27 @@ top@{ inputs, ... }: {
lua-ls.enable = true;
};
};
bingwp = pkgs.writers.writeNuBin "bingwp" ''
http get "https://pic.idimitrov.dev/latest.png" | save -f ([(xdg-user-dir PICTURES), "bg.png"] | str join "/")
'';
wpd = pkgs.writeShellApplication {
name = "wpd";
runtimeInputs = with pkgs; [ swaybg xdg-user-dirs fd uutils-coreutils-noprefix ];
runtimeEnv = { WAYLAND_DISPLAY = "wayland-1"; };
text = ''
random_pic () {
bg_dir="$(xdg-user-dir PICTURES)/bg"
fd . --extension png "$bg_dir" | shuf -n1
}
swaybg -i "$(random_pic)" -m fill &
OLD_PID=$!
while true; do
sleep 60
swaybg -i "$(random_pic)" -m fill &
NEXT_PID=$!
sleep 5
kill -9 $OLD_PID
OLD_PID=$NEXT_PID
done
'';
};
screenshot = pkgs.writeShellApplication {
name = "screenshot";
runtimeInputs = with pkgs; [ wl-clipboard xdg-utils ];