wallpaper updates in prep to switch to wbg
This commit is contained in:
parent
46cd9eec30
commit
a112c46355
1 changed files with 9 additions and 19 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
systemd.user.services.awww-daemon = {
|
systemd.user.services.awww-daemon = {
|
||||||
Unit.Description = "Wallpaper service using awww (daemon)";
|
Unit.Description = "Wallpaper service using awww (daemon)";
|
||||||
Service.ExecStart = "${pkgs.awww}/bin/awww-daemon";
|
Service.ExecStart = "${pkgs.awww}/bin/awww-daemon";
|
||||||
Install.WantedBy = [ "graphical-session.target" ];
|
Install.WantedBy = [ "niri.service" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.awww-setter = {
|
systemd.user.services.awww-setter = {
|
||||||
|
|
@ -39,26 +39,16 @@
|
||||||
libnotify
|
libnotify
|
||||||
];
|
];
|
||||||
text = ''
|
text = ''
|
||||||
set -euo pipefail
|
OUT="$HOME/.local/share/wallpaper/daily.jpg"
|
||||||
|
API=$(wget -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&mkt=en-US&n=1")
|
||||||
|
BASE=$(echo "$API" | jq -r '.images[0].urlbase')
|
||||||
|
TITLE=$(echo "$API" | jq -r '.images[0].title')
|
||||||
|
|
||||||
OUT_DIR="''${XDG_DATA_HOME:-$HOME/.local/share}/wallpaper"
|
mkdir -p "$HOME/.local/share/wallpaper"
|
||||||
OUT_FILE="$OUT_DIR/daily.jpg"
|
wget -qO "$OUT" "https://www.bing.com''${BASE}_UHD.jpg"
|
||||||
|
|
||||||
API_URL="https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&mkt=en-US&n=1"
|
|
||||||
API_RESP=$(wget -qO- "$API_URL")
|
|
||||||
|
|
||||||
URL_BASE=$(echo "$API_RESP" | jq -r '.images[0].urlbase')
|
|
||||||
URL_FALLBACK=$(echo "$API_RESP" | jq -r '.images[0].url')
|
|
||||||
TITLE=$(echo "$API_RESP" | jq -r '.images[0].title')
|
|
||||||
|
|
||||||
mkdir -p "$OUT_DIR"
|
|
||||||
|
|
||||||
if ! wget -qO "$OUT_FILE" "https://www.bing.com''${URL_BASE}_UHD.jpg"; then
|
|
||||||
wget -qO "$OUT_FILE" "https://www.bing.com$URL_FALLBACK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
notify-send \
|
notify-send \
|
||||||
-a "wallpaper of the day" \
|
-a "Wallpaper of the day" \
|
||||||
-u low \
|
-u low \
|
||||||
-i preferences-desktop-wallpaper \
|
-i preferences-desktop-wallpaper \
|
||||||
"$TITLE"
|
"$TITLE"
|
||||||
|
|
@ -66,7 +56,7 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
Service.ExecStartPost = "${pkgs.systemd}/bin/systemctl --user restart awww-setter.service";
|
Service.ExecStartPost = "${pkgs.systemd}/bin/systemctl --user restart awww-setter.service";
|
||||||
Install.WantedBy = [ "graphical-session.target" ];
|
Install.WantedBy = [ "niri.service" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.timers.bing-wallpaper = {
|
systemd.user.timers.bing-wallpaper = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue