diff --git a/.config/emacs/init.el b/.config/emacs/init.el index de9791c..0be5a4f 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -92,6 +92,8 @@ (use-package transient) +(use-package cond-let + :ensure (:repo "https://github.com/tarsius/cond-let")) (use-package magit :bind (("C-x g" . magit-status) ("C-x M-g" . magit-list-repositories)) @@ -139,7 +141,6 @@ ("C-" . ivy-immediate-done)) :init (ivy-add-actions 'project-find-file '(("x" counsel-locate-action-extern "open externally"))) - :config (setq ivy-re-builders-alist '((t . ivy--regex-ignore-order))) :custom diff --git a/.config/systemd/user/get-nasa-apod.timer b/.config/systemd/user/get-nasa-apod.timer index 2585e34..e40cf59 100644 --- a/.config/systemd/user/get-nasa-apod.timer +++ b/.config/systemd/user/get-nasa-apod.timer @@ -5,7 +5,7 @@ Requires=get-nasa-apod.service [Timer] Unit=get-nasa-apod.service -OnCalendar=daily +OnCalendar=hourly [Install] WantedBy=timers.target diff --git a/.local/bin/get-nasa-apod b/.local/bin/get-nasa-apod index c873456..e2ff7d8 100755 --- a/.local/bin/get-nasa-apod +++ b/.local/bin/get-nasa-apod @@ -19,11 +19,17 @@ echo "Received response from API" # shellcheck disable=SC2005 echo "$(printf '%s' "${response}" | jq '.')" echo "Parsing data" -picture_date="$(printf '%s' "${response}" | jq --raw-output .date)" -picture_url="$(printf '%s' "${response}" | jq --raw-output .hdurl)" rate_remaining="$(printf '%s' "${response}" | jq '."rate-limit"')" echo "Remaining requests until rate limit: ${rate_remaining}" +if [ "$(printf '%s' "${response}" | jq 'has("hdurl")')" == "false" ]; then + echo "Response contains no download URL" + exit 1 +fi + +picture_date="$(printf '%s' "${response}" | jq --raw-output .date)" +picture_url="$(printf '%s' "${response}" | jq --raw-output .hdurl)" + echo "Generating output filename" extension="${picture_url##*.}" filename="${picture_date}.${extension}" @@ -51,4 +57,4 @@ ln \ "${outfile}" \ "${WALLPAPERS}/today" echo "Refreshing the desktop background" -swaymsg output "*" bg "${SWAY_WALLPAPER}" fill +swaymsg output "*" bg "${outfile}" fill diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2fbbd49..2b3d9e4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,6 @@ repos: rev: v0.0.18 hooks: - id: forbid-binary - exclude: ^\.local/share/jupyter/kernels/python3\.12/logo- - id: shellcheck - repo: https://github.com/Yelp/detect-secrets rev: v1.5.0 diff --git a/.profile b/.profile index 0fb6ca3..faf5244 100644 --- a/.profile +++ b/.profile @@ -43,4 +43,5 @@ done < <(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-g # Autolaunch sway for tty1 logins [ "$(tty)" = "/dev/tty1" ] && + zellij delete-all-sessions --yes exec systemd-cat --identifier sway sway