Swayscript: Add mpvpaper reload support.
This commit is contained in:
parent
6df3fc101f
commit
4e1c6955e9
13
config/Wallpaper.nix
Normal file
13
config/Wallpaper.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
cfg = config.module.wallpaper;
|
||||
in {
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.video {
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "mpvpaper-sway" ''
|
||||
mpvpaper -o 'no-audio --loop-file --panscan=1' '*' ${cfg.videoPath}
|
||||
'')
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
|
@ -246,6 +246,6 @@ in
|
|||
include /etc/sway/config.d/*
|
||||
''
|
||||
+ builtins.readFile swayRc
|
||||
+ lib.concatStringsSep "\n" config.module.sway.extraConfig
|
||||
+ lib.optionalString config.module.wallpaper.video "\nexec mpvpaper -o 'no-audio --loop-file --panscan=1' '*' ${config.module.wallpaper.videoPath}";
|
||||
+ lib.optionalString config.module.wallpaper.video "\nexec mpvpaper-sway"
|
||||
+ lib.concatStringsSep "\n" config.module.sway.extraConfig;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ function reload() {
|
|||
re() {
|
||||
# Sway.
|
||||
swaymsg reload
|
||||
pkill mpvpaper
|
||||
mpvpaper-sway
|
||||
|
||||
# Waybar.
|
||||
pkill waybar
|
||||
|
|
Loading…
Reference in a new issue