switch from mpvpaper to awww, refactor wallpaper
This commit is contained in:
parent
f1abbd7e0b
commit
8ca6241077
5 changed files with 142 additions and 59 deletions
62
flake.lock
generated
62
flake.lock
generated
|
|
@ -40,6 +40,28 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"awww": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat_2",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770895252,
|
||||||
|
"narHash": "sha256-TUGZVDcC5xsrWVnpBNosAG1cTy+aWchCWXPyeLZdnGM=",
|
||||||
|
"ref": "refs/heads/main",
|
||||||
|
"rev": "2c86d41d07471f518e24f5cd1f586e4d2a32d12c",
|
||||||
|
"revCount": 1331,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://codeberg.org/LGFae/awww.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://codeberg.org/LGFae/awww.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
"base16": {
|
"base16": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"fromYaml": "fromYaml"
|
"fromYaml": "fromYaml"
|
||||||
|
|
@ -138,6 +160,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat_2": {
|
"flake-compat_2": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1761588595,
|
||||||
|
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_3": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767039857,
|
"lastModified": 1767039857,
|
||||||
|
|
@ -331,7 +369,7 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"cachyos-kernel": "cachyos-kernel",
|
"cachyos-kernel": "cachyos-kernel",
|
||||||
"cachyos-kernel-patches": "cachyos-kernel-patches",
|
"cachyos-kernel-patches": "cachyos-kernel-patches",
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_3",
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
|
|
@ -551,6 +589,7 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"aerothemeplasma-nix": "aerothemeplasma-nix",
|
"aerothemeplasma-nix": "aerothemeplasma-nix",
|
||||||
"apple-silicon": "apple-silicon",
|
"apple-silicon": "apple-silicon",
|
||||||
|
"awww": "awww",
|
||||||
"base16": "base16",
|
"base16": "base16",
|
||||||
"base16-discord": "base16-discord",
|
"base16-discord": "base16-discord",
|
||||||
"catppuccin-discord": "catppuccin-discord",
|
"catppuccin-discord": "catppuccin-discord",
|
||||||
|
|
@ -571,6 +610,27 @@
|
||||||
"tt-schemes": "tt-schemes"
|
"tt-schemes": "tt-schemes"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"awww",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1764038373,
|
||||||
|
"narHash": "sha256-M6w2wNBRelcavoDAyFL2iO4NeWknD40ASkH1S3C0YGM=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "ab3536fe850211a96673c6ffb2cb88aab8071cc9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"spicetify-nix": {
|
"spicetify-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,11 @@
|
||||||
# inputs.nixpkgs.follows = "nixpkgs";
|
# inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
awww = {
|
||||||
|
url = "git+https://codeberg.org/LGFae/awww.git";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
openmw = {
|
openmw = {
|
||||||
url = "gitlab:OpenMW/openmw/01bcd6a6369fe461caaf900354967b4751aede7a";
|
url = "gitlab:OpenMW/openmw/01bcd6a6369fe461caaf900354967b4751aede7a";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
@ -109,6 +114,7 @@
|
||||||
nur,
|
nur,
|
||||||
nixvim,
|
nixvim,
|
||||||
apple-silicon,
|
apple-silicon,
|
||||||
|
awww,
|
||||||
openmw,
|
openmw,
|
||||||
catppuccin-discord,
|
catppuccin-discord,
|
||||||
...
|
...
|
||||||
|
|
@ -152,6 +158,7 @@
|
||||||
niri.overlays.niri
|
niri.overlays.niri
|
||||||
noctalia.overlays.default
|
noctalia.overlays.default
|
||||||
nur.overlays.default
|
nur.overlays.default
|
||||||
|
awww.overlays.default
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
openmw-git = openmw;
|
openmw-git = openmw;
|
||||||
catppuccin-discord-git = catppuccin-discord;
|
catppuccin-discord-git = catppuccin-discord;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@
|
||||||
input = {
|
input = {
|
||||||
focus-follows-mouse.enable = true;
|
focus-follows-mouse.enable = true;
|
||||||
focus-follows-mouse.max-scroll-amount = "0%";
|
focus-follows-mouse.max-scroll-amount = "0%";
|
||||||
warp-mouse-to-focus.enable = true;
|
|
||||||
mod-key = "Super";
|
mod-key = "Super";
|
||||||
keyboard = {
|
keyboard = {
|
||||||
numlock = false;
|
numlock = false;
|
||||||
|
|
@ -187,6 +186,14 @@
|
||||||
open-maximized = true;
|
open-maximized = true;
|
||||||
open-focused = true;
|
open-focused = true;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{
|
||||||
|
app-id = "mpv";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
opacity = 1.0;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
layer-rules = [
|
layer-rules = [
|
||||||
{
|
{
|
||||||
|
|
@ -195,7 +202,7 @@
|
||||||
namespace = "^wpaperd.*";
|
namespace = "^wpaperd.*";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
namespace = "^mpvpaper";
|
namespace = "^awww-daemon";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
place-within-backdrop = true;
|
place-within-backdrop = true;
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
bar = {
|
bar = {
|
||||||
autoHideDelay = 500;
|
autoHideDelay = 500;
|
||||||
autoShowDelay = 150;
|
autoShowDelay = 150;
|
||||||
backgroundOpacity = 1;
|
backgroundOpacity = 0.975;
|
||||||
monitors = [ ];
|
monitors = [ ];
|
||||||
showCapsule = true;
|
showCapsule = true;
|
||||||
barType = "simple";
|
barType = "simple";
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
outerCorners = false;
|
outerCorners = false;
|
||||||
screenOverrides = [ ];
|
screenOverrides = [ ];
|
||||||
showOutline = false;
|
showOutline = false;
|
||||||
useSeparateOpacity = false;
|
useSeparateOpacity = true;
|
||||||
widgets = {
|
widgets = {
|
||||||
center = [ ];
|
center = [ ];
|
||||||
left = [
|
left = [
|
||||||
|
|
@ -206,7 +206,7 @@
|
||||||
deviceNativePath = "__default__";
|
deviceNativePath = "__default__";
|
||||||
displayMode = "icon-hover";
|
displayMode = "icon-hover";
|
||||||
hideIfIdle = false;
|
hideIfIdle = false;
|
||||||
hideIfNotDetected = false;
|
hideIfNotDetected = true;
|
||||||
id = "Battery";
|
id = "Battery";
|
||||||
showNoctaliaPerformance = false;
|
showNoctaliaPerformance = false;
|
||||||
showPowerProfiles = true;
|
showPowerProfiles = true;
|
||||||
|
|
|
||||||
|
|
@ -3,68 +3,77 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
systemd.user.services.mpvpaper = {
|
systemd.user.services.awww-daemon = {
|
||||||
Unit = {
|
Unit.Description = "Wallpaper service using awww (daemon)";
|
||||||
Description = "Modern wallpaper daemon for Wayland";
|
Service.ExecStart = "${pkgs.awww}/bin/awww-daemon";
|
||||||
PartOf = [ "niri.service" ];
|
Unit.After = [ "graphical-session.target" ];
|
||||||
Requires = [ "niri.service" ];
|
Unit.PartOf = [ "graphical-session.target" ];
|
||||||
After = [ "niri.service" ];
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
Service = {
|
|
||||||
ExecStart = ''
|
systemd.user.services.awww-setter = {
|
||||||
${pkgs.mpvpaper}/bin/mpvpaper '*' \
|
Unit.Description = "Wallpaper service using awww (setter)";
|
||||||
'/home/sckova/.local/share/wallpaper/daily.jpg' -o \
|
Unit.Requires = [ "awww-daemon.service" ];
|
||||||
'--keep-open=always --save-position-on-quit --panscan=1.0' \
|
Unit.After = [ "awww-daemon.service" ];
|
||||||
'';
|
Service.Type = "oneshot";
|
||||||
};
|
Service.ExecStart = ''
|
||||||
Install = {
|
${pkgs.awww}/bin/awww img \
|
||||||
WantedBy = [ "niri.service" ];
|
%h/.local/share/wallpaper/daily.jpg \
|
||||||
};
|
--transition-step 2 \
|
||||||
|
--transition-fps 60
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.bing-wallpaper = {
|
systemd.user.services.bing-wallpaper = {
|
||||||
Unit = {
|
Unit.Description = "Download and set Bing wallpaper of the day";
|
||||||
Description = "Download and set Bing wallpaper of the day";
|
Unit.StartLimitBurst = 5;
|
||||||
After = [ "network-online.target" ];
|
Unit.StartLimitIntervalSec = "10m";
|
||||||
Wants = [ "network-online.target" ];
|
Service.Restart = "on-failure";
|
||||||
};
|
Service.RestartSec = "1m";
|
||||||
Service = {
|
Service.Type = "oneshot";
|
||||||
Type = "oneshot";
|
Service.ExecStart = pkgs.lib.getExe (
|
||||||
ExecStart = pkgs.writeShellScript "bing-wallpaper" ''
|
pkgs.writeShellApplication {
|
||||||
OUT="''${XDG_DATA_HOME:-$HOME/.local/share}/wallpaper/daily.jpg"
|
name = "bing-wallpaper";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
wget
|
||||||
|
jq
|
||||||
|
coreutils
|
||||||
|
libnotify
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
API_RESP=$(${pkgs.wget}/bin/wget -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&mkt=en-US&n=1") || exit 1
|
OUT_DIR="''${XDG_DATA_HOME:-$HOME/.local/share}/wallpaper"
|
||||||
|
OUT_FILE="$OUT_DIR/daily.jpg"
|
||||||
|
|
||||||
URL_BASE=$(echo "$API_RESP" | ${pkgs.gnugrep}/bin/grep -oP 'urlbase":"[^"]*' | cut -d '"' -f 3)
|
API_URL="https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&mkt=en-US&n=1"
|
||||||
TITLE=$(echo "$API_RESP" | ${pkgs.gnugrep}/bin/grep -oP 'title":"[^"]*' | cut -d '"' -f 3)
|
API_RESP=$(wget -qO- "$API_URL")
|
||||||
|
|
||||||
${pkgs.coreutils}/bin/mkdir -p "$(dirname "$OUT")"
|
URL_BASE=$(echo "$API_RESP" | jq -r '.images[0].urlbase')
|
||||||
${pkgs.wget}/bin/wget -qO "$OUT" "https://www.bing.com$URL_BASE\_UHD.jpg" || \
|
URL_FALLBACK=$(echo "$API_RESP" | jq -r '.images[0].url')
|
||||||
${pkgs.wget}/bin/wget -qO "$OUT" "https://www.bing.com$(echo "$API_RESP" | ${pkgs.gnugrep}/bin/grep -oP 'url":"[^"]*' | cut -d '"' -f 3)"
|
TITLE=$(echo "$API_RESP" | jq -r '.images[0].title')
|
||||||
|
|
||||||
${pkgs.libnotify}/bin/notify-send \
|
mkdir -p "$OUT_DIR"
|
||||||
-a "Bing Wallpaper Service" \
|
|
||||||
-u low \
|
if ! wget -qO "$OUT_FILE" "https://www.bing.com''${URL_BASE}_UHD.jpg"; then
|
||||||
-i preferences-desktop-wallpaper \
|
wget -qO "$OUT_FILE" "https://www.bing.com$URL_FALLBACK"
|
||||||
"$TITLE"
|
fi
|
||||||
'';
|
|
||||||
ExecStartPost = "${pkgs.systemd}/bin/systemctl --user restart mpvpaper.service";
|
notify-send \
|
||||||
};
|
-a "wallpaper of the day" \
|
||||||
Install = {
|
-u low \
|
||||||
WantedBy = [ "niri.service" ];
|
-i preferences-desktop-wallpaper \
|
||||||
};
|
"$TITLE"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
Service.ExecStartPost = "${pkgs.systemd}/bin/systemctl --user restart awww-setter.service";
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.timers.bing-wallpaper = {
|
systemd.user.timers.bing-wallpaper = {
|
||||||
Unit = {
|
Unit.Description = "Run bing wallpaper retrieval daily";
|
||||||
Description = "Run bing wallpaper retrieval daily";
|
Timer.OnCalendar = "*-*-* 10:00:00 GMT";
|
||||||
};
|
Timer.Persistent = true;
|
||||||
Timer = {
|
Install.WantedBy = [ "timers.target" ];
|
||||||
OnCalendar = "*-*-* 10:00:00 GMT";
|
|
||||||
Persistent = true;
|
|
||||||
};
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "timers.target" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue