realwallpaper get_constellations: make importable

This commit is contained in:
lassulus 2023-09-04 13:44:51 +02:00
parent 236856503c
commit de37ad9599
2 changed files with 19 additions and 13 deletions

View file

@ -18,19 +18,24 @@ def points_to_lines(points):
return lines return lines
with open(sys.argv[1]) as f: def main():
constellations = json.load(f)['features'] with open(sys.argv[1]) as f:
constellations = json.load(f)['features']
output = [] output = []
for const in constellations: for const in constellations:
for line in const['geometry']['coordinates']: for line in const['geometry']['coordinates']:
transformed_line = [] transformed_line = []
for point in line: for point in line:
transformed_line.append(convert_to_itrs(point)) transformed_line.append(convert_to_itrs(point))
line_combined = points_to_lines(transformed_line) line_combined = points_to_lines(transformed_line)
for l in line_combined: # noqa for l in line_combined: # noqa
output.append(f'{l[0][0]} {l[0][1]} {l[1][0]} {l[1][1]} # {const["id"]}') # noqa output.append(f'{l[0][0]} {l[0][1]} {l[1][0]} {l[1][1]} # {const["id"]}') # noqa
print('\n'.join(output)) print('\n'.join(output))
if __name__ == "__main__":
main()

View file

@ -10,7 +10,7 @@ let
SPEAKER=$[ $RANDOM % 900 ] SPEAKER=$[ $RANDOM % 900 ]
while read line; do while read line; do
echo "$line" | echo "$line" |
${pkgs.larynx}/bin/larynx \ ${pkgs.piper-tts}/bin/piper \
--model ${pkgs.fetchzip { --model ${pkgs.fetchzip {
url = "https://github.com/rhasspy/piper/releases/download/v0.0.2/voice-en-us-libritts-high.tar.gz"; url = "https://github.com/rhasspy/piper/releases/download/v0.0.2/voice-en-us-libritts-high.tar.gz";
hash = "sha256-jCoK4p0O7BuF0nr6Sfj40tpivCvU5M3GHKQRg1tfIO8="; hash = "sha256-jCoK4p0O7BuF0nr6Sfj40tpivCvU5M3GHKQRg1tfIO8=";
@ -126,5 +126,6 @@ in
environment.systemPackages = [ environment.systemPackages = [
send_to_radio send_to_radio
newsshow newsshow
tts
]; ];
} }