Windows compatibility changes.

added instructions to readme, fix config values not being read, and debug magick cmd
This commit is contained in:
mir 2023-10-22 13:35:25 -08:00
parent 9b266df1d2
commit 872c438e8e
2 changed files with 28 additions and 9 deletions

View File

@ -10,3 +10,23 @@ wallpaper generator
### Dependencies
hyprchan depends on `f.el` and `dash.el`. By default the config file will bootstrap straight.el to install them. If you have these packages available system-wide (EG with debian's elisp packages), you can comment it out.
## Install - Windows
First get the Scoop package manager https://scoop.sh and follow its instructions for adding the `extras` bucket.
Then install the following:
- `emacs`
- `imagemagick`
- `file`
Put hyprchan.conf where it goes (run this in powershell while in the project root folder):
```powershell
new-item -type directory -force -path $env:APPDATA\.config\hyprchan\
copy-item hyprchan.conf $env:APPDATA\.config\hyprchan\hyprchan.conf
new-item -type directory -path $env:APPDATA\.cache\
```
Then edit it so it actually knows where your wallpapers should be.

17
hyprchan Executable file → Normal file
View File

@ -7,11 +7,6 @@
(require 'f)
(require 'dash)
(defvar waifudir "~/.local/share/waifus/")
(defvar wallpapers "~/.local/share/backgrounds/")
(defvar cachedir "~/.cache/hyprchan/")
(defvar logosrc "/usr/share/hyprland/hyprland.png")
(defvar splash (string-trim (shell-command-to-string "hyprctl splash")))
(defun get-dimensions (image)
"Return the dimensions of IMAGE as cons `(x . y)'."
@ -78,15 +73,19 @@
(setq logo.start.y (round (- (* canvas.y 0.5) (* logo.y 0.5))))
(defvar splashthickness (/ canvas.x 50.0))
(defvar final-image-location (expand-file-name "~/hyprchan.jpg"))
(defvar magickcmd (format
"convert %s -gravity South -pointsize %s -fill '#f0f0f0' -annotate 0 '%s' -page +%s+%s %s -page +%s+%s %s -flatten ~/.config/hypr/hyprchan.jpg"
"magick convert %s -gravity South -pointsize %s -fill '#f0f0f0' -annotate 0 '%s' -page +%s+%s %s -page +%s+%s %s -flatten %s"
canvas.fullname
splashthickness
splash
logo.start.x logo.start.y
logo.cachefile
waifu.position.x waifu.position.y
waifu.cachefile))
waifu.cachefile
final-image-location))
(if (eq system-type 'windows-nt)
(setq magickcmd (string-replace "/" "\\" magickcmd)))
(message magickcmd)
(shell-command-to-string magickcmd)
;; TODO: fix filepaths