summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/realwallpaper
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-01-23 14:11:48 +0100
committerlassulus <lassulus@lassul.us>2021-01-23 14:11:48 +0100
commit034185780670fc7466cce8a839b59abd849e3f89 (patch)
tree58c7d11f009219eb2ae25e911b089b47f783ec95 /krebs/5pkgs/simple/realwallpaper
parent5c669397dac74d4c63281a7c785465569e93643e (diff)
realwallpaper: add wallpaper with markers but without krebs
Diffstat (limited to 'krebs/5pkgs/simple/realwallpaper')
-rw-r--r--krebs/5pkgs/simple/realwallpaper/default.nix46
1 files changed, 34 insertions, 12 deletions
diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix
index 56a7dfb98..e55454a08 100644
--- a/krebs/5pkgs/simple/realwallpaper/default.nix
+++ b/krebs/5pkgs/simple/realwallpaper/default.nix
@@ -192,18 +192,15 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
fi
# create marker file from json
- if [ -s marker.json ]; then
- jq -r 'to_entries[] | @json "\(.value.latitude) \(.value.longitude) image=krebs.png"' marker.json > marker_file
- echo 'position=sun image=sun.png' >> marker_file
- echo 'position=moon image=moon.png' >> marker_file
- echo 'position=mercury image=mercury.png' >> marker_file
- echo 'position=venus image=venus.png' >> marker_file
- echo 'position=mars image=mars.png' >> marker_file
- echo 'position=jupiter image=jupiter.png' >> marker_file
- echo 'position=saturn image=saturn.png' >> marker_file
- echo 'position=uranus image=uranus.png' >> marker_file
- echo 'position=neptune image=neptune.png' >> marker_file
- fi
+ echo 'position=sun image=sun.png' > marker_file
+ echo 'position=moon image=moon.png' >> marker_file
+ echo 'position=mercury image=mercury.png' >> marker_file
+ echo 'position=venus image=venus.png' >> marker_file
+ echo 'position=mars image=mars.png' >> marker_file
+ echo 'position=jupiter image=jupiter.png' >> marker_file
+ echo 'position=saturn image=saturn.png' >> marker_file
+ echo 'position=uranus image=uranus.png' >> marker_file
+ echo 'position=neptune image=neptune.png' >> marker_file
# generate moon
xplanet -body moon --num_times 1 -origin earth \
@@ -228,6 +225,24 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
''}
xplanet --num_times 1 --geometry $xplanet_out_size \
+ --output xplanet-marker-output.png --projection merc \
+ -config ${pkgs.writeText "xplanet-marker.config" ''
+ [earth]
+ "Earth"
+ map=daymap-final.png
+ night_map=nightmap-final.png
+ cloud_map=clouds.png
+ cloud_threshold=1
+ cloud_gamma=10
+ marker_file=marker_file
+ shade=15
+ ''}
+
+ if [ -s marker.json ]; then
+ jq -r 'to_entries[] | @json "\(.value.latitude) \(.value.longitude) image=krebs.png"' marker.json >> marker_file
+ fi
+
+ xplanet --num_times 1 --geometry $xplanet_out_size \
--output xplanet-krebs-output.png --projection merc \
-config ${pkgs.writeText "xplanet-krebs.config" ''
[earth]
@@ -248,6 +263,13 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
mv realwallpaper-tmp.png realwallpaper.png
fi
+ # trim xplanet output
+ if needs_rebuild realwallpaper-marker.png xplanet-marker-output.png; then
+ convert xplanet-marker-output.png -crop $out_geometry \
+ realwallpaper-marker-tmp.png
+ mv realwallpaper-marker-tmp.png realwallpaper-marker.png
+ fi
+
if needs_rebuild realwallpaper-krebs.png xplanet-krebs-output.png; then
convert xplanet-krebs-output.png -crop $out_geometry \
realwallpaper-krebs-tmp.png