refactored directory structure to be more shareable
This commit is contained in:
+13
-11
@@ -1,11 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
WORK_DIR="$HOME/.config/scripts/live-earth-wallpaper"
|
||||
OUTPUT_IMG_DIR="$WORK_DIR/images"
|
||||
CLOUD_SRC_IMG="$OUTPUT_IMG_DIR/clouds-alpha.jpg"
|
||||
OUTPUT_IMG_ULTRAWIDE="$OUTPUT_IMG_DIR/DP-2-render.png"
|
||||
OUTPUT_IMG_EDP="$OUTPUT_IMG_DIR/eDP-1-render.png"
|
||||
OUTPUT_IMG_ULTRAWIDE_NATIVE="$OUTPUT_IMG_DIR/blue-ULTRAWIDE-native.png"
|
||||
OUTPUT_IMG_DIR="$WORK_DIR"
|
||||
IMG_DIR="$WORK_DIR/images"
|
||||
MAP_DIR="$IMG_DIR/maps"
|
||||
OUTPUT_RENDER_DIR="$IMG_DIR/renders"
|
||||
CLOUD_SRC_IMG="$MAP_DIR/clouds-alpha.jpg"
|
||||
OUTPUT_IMG_ULTRAWIDE="$OUTPUT_RENDER_DIR/DP-2-render.png"
|
||||
OUTPUT_IMG_EDP="$OUTPUT_RENDER_DIR/eDP-1-render.png"
|
||||
OUTPUT_IMG_ULTRAWIDE_NATIVE="$OUTPUT_RENDER_DIR/blue-ULTRAWIDE-native.png"
|
||||
# OUTPUT_IMG_STARFNATIVE="$OUTPUT_IMG_DIR/stars-native.png"
|
||||
STARS_FILE="/usr/share/xplanet/stars/BSC"
|
||||
STATIONS_TLE="$WORK_DIR/stations.tle"
|
||||
@@ -21,8 +24,8 @@ downloadClouds "$CLOUD_SRC_IMG" || exit # Download latest clouds image or exit w
|
||||
|
||||
# downloadStations # Download latest stations data
|
||||
|
||||
cacheImages "eDP-1" "$OUTPUT_IMG_DIR" # Check for existing images and cache them if they exist
|
||||
cacheImages "DP-2" "$OUTPUT_IMG_DIR" # Check for existing images and cache them if they exist
|
||||
cacheImages "eDP-1" "$OUTPUT_RENDER_DIR" # Check for existing images and cache them if they exist
|
||||
cacheImages "DP-2" "$OUTPUT_RENDER_DIR" # Check for existing images and cache them if they exist
|
||||
# TODO handle errors here
|
||||
|
||||
|
||||
@@ -73,6 +76,8 @@ if [[ "$monitors" == *"DP-2"* ]]; then
|
||||
&& echo render ultrawide wallpaper superize successful || exit 1 # echo Error: failed to render ultrawide wallpaper at super resolution
|
||||
|
||||
noctalia msg wallpaper-set DP-2 "$OUTPUT_IMG_ULTRAWIDE" 1>/dev/null && echo ultrawide wallpaper set successfully || echo Warning: not connected to monitor DP-2, wallpaper will not be set.
|
||||
rm "$OUTPUT_IMG_ULTRAWIDE_NATIVE" # Remove the native resolution image after the supersampled image is created
|
||||
rm "$OUTPUT_IMG_ULTRAWIDE.tmp" # Remove the cached image after the new image is created
|
||||
fi
|
||||
if [[ "$monitors" == *"eDP-1"* ]]; then # TODO: technicall no if statement needed here, should be functional tho
|
||||
echo "Builtin monitor detected"
|
||||
@@ -83,8 +88,5 @@ if [[ "$monitors" == *"eDP-1"* ]]; then # TODO: technicall no if statement neede
|
||||
&& echo render builtin wallpaper successful || exit 1 # echo Error: failed to render builtin wallpaper
|
||||
|
||||
noctalia msg wallpaper-set eDP-1 "$OUTPUT_IMG_EDP" 1>/dev/null && echo builtin wallpaper set successfully || echo Warning: not connected to monitor eDP-1, wallpaper will not be set.
|
||||
rm "$OUTPUT_IMG_EDP.tmp" # Remove the cached image after the new image is created
|
||||
fi
|
||||
|
||||
# Remove tmp cached files if noctalia was able to set the new wallpapers successfully, otherwise keep the tmp files
|
||||
# errorCheck=$?
|
||||
# [[ "$errorCheck" -eq 0 ]] && cleanup
|
||||
|
||||
Reference in New Issue
Block a user