TobiZog / cinnamon-dynamic-wallpaper

Cinnamon extension for dynamic desktop backgrounds based on time and location
GNU General Public License v3.0
23 stars 0 forks source link

Background will not apply when using network or custom location #13

Closed Idowza closed 5 months ago

Idowza commented 5 months ago

Linux Mint 21.3 fresh install Cinnamon 6.0

Clicking apply will only set the backgorund when using Custom Time Periods. Network and Custom location will not apply the background or background changes.

TobiZog commented 5 months ago

Can you run the preferences.py with Python in the terminal and show me the errors from bash?

The file is located at ~/.local/share/cinnamon/extensions/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences.py.

Idowza commented 5 months ago

Traceback (most recent call last): File "/home/steven/.local/share/cinnamon/extensions/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences.py", line 565, in on_toggle_button_network_location_clicked self.refresh_chart() File "/home/steven/.local/share/cinnamon/extensions/cinnamon-dynamic-wallpaper@TobiZog/5.4/preferences.py", line 208, in refresh_chart self.suntimes.calc_suntimes(float(self.prefs.latitude_auto), float(self.prefs.longitude_auto)) File "/home/steven/.local/share/cinnamon/extensions/cinnamon-dynamic-wallpaper@TobiZog/5.4/scripts/suntimes.py", line 30, in calc_suntimes self.calc_sun_events() File "/home/steven/.local/share/cinnamon/extensions/cinnamon-dynamic-wallpaper@TobiZog/5.4/scripts/suntimes.py", line 60, in calc_sun_events night_start = self.calc_sunrise_sunset_time(False, 96) File "/home/steven/.local/share/cinnamon/extensions/cinnamon-dynamic-wallpaper@TobiZog/5.4/scripts/suntimes.py", line 145, in calc_sunrise_sunset_time res = datetime(self.today.year, self.today.month, self.today.day, hr, int(min)) ValueError: hour must be in 0..23

Idowza commented 5 months ago

When using Custom Location it will work if only using up to one decimal place. 46.8 instead of 46.86 in both lattitude and longitude.

TobiZog commented 5 months ago

I've tried it, but can't reproduce the bug.

Can you insert a line of code in the Python script? The file is located at .local/share/cinnamon/extensions/cinnamon-dynamic-wallpaper@TobiZog/5.4/scripts/suntimes.py. After line 138, please insert print(hr) so I can get the output from the variable.

This will look like this:

    # 10
    hr = self.to_range(int(UT), 24)
    print(hr)                             # <--- Add this line of code
    min = round((UT - int(UT))*60, 0)
    if min == 60:
      hr += 1
      min = 0

Thank you very much!

Idowza commented 5 months ago

I will test, but it seems to be working now.

TobiZog commented 5 months ago

I've fixed it with the last release (v.2.2) of the extension. If the issue still be there, please reopen the Issue.