Compare commits

...

10 commits

7 changed files with 94 additions and 6 deletions

View file

@ -183,7 +183,11 @@
;; EPUB reader ;; EPUB reader
(use-package nov (use-package nov
:init :init
(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))) (setq auto-mode-alist
(map-merge 'list
'(("\\.epub\\'" . nov-mode))
auto-mode-alist))
)
(use-package company (use-package company
:init (global-company-mode) :init (global-company-mode)
@ -243,18 +247,21 @@
(defun load-python-env () (defun load-python-env ()
"Set up the Python IDE in the current project." "Set up the Python IDE in the current project."
(interactive) (interactive)
(when (derived-mode-p 'python-mode)
(progn (progn
(ignore-errors (poetry-venv-workon)) (poetry-venv-workon)
(eglot-ensure))) (eglot-ensure))))
(use-package python (use-package python
:bind (:map python-mode-map :bind (:map python-mode-map
("C-c C-p" . nil) ("C-c C-p" . nil)
("C-c C-l" . nil) ("C-c C-l" . nil)
("C-c t" . elpy-test)) ("C-c t" . elpy-test))
:hook (python-mode . load-python-env) :hook (hack-local-variables . load-python-env)
:config :config
(load "python-tests.el") (load "python-tests.el")
:custom
(elpy-test-runner 'elpy-test-pytest-runner)
) )
;; Jupyter notebook integration ;; Jupyter notebook integration
@ -280,6 +287,19 @@
(rustic-lsp-client 'eglot) (rustic-lsp-client 'eglot)
) )
(use-package go-config
:ensure nil
:hook
(go-ts-mode . eglot-ensure)
:init
(setq auto-mode-alist
(map-merge 'list
'(("\\.go\\'" . go-ts-mode)
("/go\\.mod\\'" . go-mod-ts-mode)
("/go\\.work\\'" . go-work-ts-mode))
auto-mode-alist))
)
(use-package gptel (use-package gptel
:custom :custom
; keep-sorted start ; keep-sorted start

View file

@ -27,6 +27,7 @@ DEB_PKGS=(
fuzzel fuzzel
gdb gdb
gnumeric gnumeric
gopls
graphviz graphviz
grim grim
guile-3.0 guile-3.0
@ -86,12 +87,14 @@ DEB_PKGS=(
xdg-desktop-portal-wlr xdg-desktop-portal-wlr
xournalpp xournalpp
yt-dlp yt-dlp
awscli
zip zip
# keep-sorted end # keep-sorted end
) )
META_PKGS=( META_PKGS=(
# keep-sorted start # keep-sorted start
fonts-noto fonts-noto
golang
podman-compose podman-compose
# keep-sorted end # keep-sorted end
) )

View file

@ -0,0 +1,10 @@
[Unit]
Description=Refresh the wallpaper using the NASA Astronomy Picture of the Day
Wants=get-nasa-apod.timer
[Service]
WorkingDirectory=%h
ExecStart=%h/.local/bin/get-nasa-apod
[Install]
WantedBy=default.target

View file

@ -0,0 +1,10 @@
[Unit]
Description=Daily NASA wallpaper fetch
Requires=get-nasa-apod.service
[Timer]
Unit=nasa-apod.service
OnCalendar=daily
[Install]
WantedBy=timers.target

View file

@ -10,6 +10,10 @@
[remote] [remote]
pushDefault = . pushDefault = .
[git-sync] [git-sync]
# keep-sorted start
syncEnabled = true
syncNewFiles = true
syncSkipHooks = true syncSkipHooks = true
# keep-sorted end
[include] [include]
path = .hostgitconfig path = .hostgitconfig

41
.local/bin/get-nasa-apod Executable file
View file

@ -0,0 +1,41 @@
#! /usr/bin/bash
set -euo pipefail
IFS=$'\n\t'
API_KEY="${NASA_API_KEY:-DEMO_KEY}"
if [ "${API_KEY}" = "DEMO_KEY" ]; then
echo "No API key set! using demo key."
fi
WALLPAPERS="$(systemd-path user)"/Wallpapers
mkdir --parents "${WALLPAPERS}"
APOD_URL="https://api.nasa.gov/planetary/apod?api_key=${API_KEY}"
response="$(curl --silent "${APOD_URL}")"
picture_date="$(printf '%s' "${response}" | jq --raw-output .date)"
picture_url="$(printf '%s' "${response}" | jq --raw-output .hdurl)"
extension="${picture_url##*.}"
filename="${picture_date}.${extension}"
outfile="${WALLPAPERS}/${filename}"
if [ -f "${outfile}" ]; then
echo "Target file already exists"
exit 0
fi
tempfile="$(mktemp)"
curl \
--location \
--output "${tempfile}" \
--silent \
"${picture_url}"
mv "${tempfile}" "${outfile}"
ln \
--force \
--symbolic \
"${outfile}" \
"${WALLPAPERS}/today.${extension}"
swaymsg reload

View file

@ -12,7 +12,7 @@ sync_repo () {
repo=$1 repo=$1
echo git-sync "${repo}" echo git-sync "${repo}"
( cd "${repo}" && "$(systemd-path user-state-private)"/git-sync/git-sync -n -s sync ) ( cd "${repo}" && "$(systemd-path user-state-private)"/git-sync/git-sync sync )
echo echo
} }