Compare commits

..

No commits in common. "0f4d3087f6c3f5d1d3a919e3941d37635bea148c" and "a32a8e37777a194c39d1abb65181a07950842545" have entirely different histories.

4 changed files with 17 additions and 26 deletions

View File

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

View File

@ -442,10 +442,20 @@ toplevel@{ moduleWithSystem, ... }: {
timers = { rbingwp = { Timer = { OnCalendar = "*-*-* 10:00:00"; Persistent = true; }; Install = { WantedBy = [ "timers.target" ]; }; }; }; timers = { rbingwp = { Timer = { OnCalendar = "*-*-* 10:00:00"; Persistent = true; }; Install = { WantedBy = [ "timers.target" ]; }; }; };
services = { services = {
wpd = { wpd = {
Install = { WantedBy = [ "sway-session.target" ]; };
Unit = { Description = "Switch background every x minutes"; After = "graphical-session-pre.target"; PartOf = "graphical-session.target"; };
Service = { Service = {
ExecStart = [ "${pkgs.wpd}/bin/wpd" ]; 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"; };
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'" ];
}; };
}; };
}; };

View File

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

View File

@ -8,27 +8,9 @@ top@{ inputs, ... }: {
lua-ls.enable = true; lua-ls.enable = true;
}; };
}; };
wpd = pkgs.writeShellApplication { bingwp = pkgs.writers.writeNuBin "bingwp" ''
name = "wpd"; http get "https://pic.idimitrov.dev/latest.png" | save -f ([(xdg-user-dir PICTURES), "bg.png"] | str join "/")
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 { screenshot = pkgs.writeShellApplication {
name = "screenshot"; name = "screenshot";
runtimeInputs = with pkgs; [ wl-clipboard xdg-utils ]; runtimeInputs = with pkgs; [ wl-clipboard xdg-utils ];