justjokiing / kshift

Theme/Wallpaper shift for KDE
GNU General Public License v3.0
11 stars 3 forks source link

Type error #13

Closed sleeplessKomodo closed 6 days ago

sleeplessKomodo commented 2 months ago

What I did:

  1. cloned the repo
  2. edited the defaults.yml with values matching my location and preferences
  3. ran ./kshift --install, without issue.
  4. ran ./kshift --status to see this error:
Traceback (most recent call last):
  File "/home/jimbo/git/kshift/src/./kshift", line 7, in <module>
    import theme
  File "/home/jimbo/git/kshift/src/theme.py", line 9, in <module>
    c = conf.config()
        ^^^^^^^^^^^^^
  File "/home/jimbo/git/kshift/src/conf.py", line 92, in __init__
    raise TypeError("'sunset' variable not set correctly. Use the format HH:MM")
TypeError: 'sunset' variable not set correctly. Use the format HH:MM

I'm not sure if this is a problem on my end, or the program. I set my sunset time to '21:00', which I believe is the correct formatting.

Attached are the contents of the defaults.yml configured before installing.

defaults.txt

[System Details] Operating System: Nobara Linux 40 KDE Plasma Version: 6.1.1 KDE Frameworks Version: 6.3.0 Qt Version: 6.7.1 Kernel Version: 6.8.12-201.fsync.fc40.x86_64 (64-bit) Graphics Platform: Wayland

justjokiing commented 1 month ago

Can you link the configuration file at .config/kshift/kshift.yml as well?

sleeplessKomodo commented 1 week ago

Can you link the configuration file at .config/kshift/kshift.yml as well?

location: CAXX0504 # Location Code from https://weather.codes/search
sunrise: '08:00'   # Default sunrise time, when time data cannot be accessed. These must be in quotes.
sunset: '21:00'    # Default sunset  time
rise_delay: 0      # Hour delay for sunrise, can be negative
set_delay: 0       # Hour delay for sunset
webdata: true      # Boolean for accessing web for time data
net_timeout: 10    # How long to wait for network timeout
themes:
  day:
    colorscheme: BreezeLight  # Check 'plasma-apply-colorscheme -l' for options
    icontheme: dracula-icons-main
    wallpaper: /home/jimbo/Pictures/Wallpapers/dracula-waves-44475a.png
    command: ''               # Runs command at theme activation
    time: sunrise             # Keywords 'sunrise', 'sunset', or ANY correct systemd 'OnCalendar' time
  night:
    colorscheme: DraculaPurple
    icontheme: dracula-icons-main
    wallpaper: /home/jimbo/Pictures/Wallpapers/dracula-waves-44475a.png
    command: ''
    time:
      - sunset
 # october:
 #   wallpaper: /usr/share/wallpapers/FallenLeaf/contents/images/2560x1600.jpg
 #   time: '*-10-* *:*:*'
 #   enable: false             # Disables theme, it will not run on time
justjokiing commented 1 week ago

Thank you, the issue was in a sanity check which only allowed a 12hr time format. It should allow you to use '21:00' now.

When you pull again, that time should work. I also just committed a breaking change for the sunset/sunrise API -- please read over the README to see how to move to this version.

LMK if you need any help with that.

sleeplessKomodo commented 6 days ago

Thank you! Pulling again and getting the API key as mentioned worked great!

(Prior to this app I was manually toggling the theme via a script triggered by a timer that activated a service, so this is much cleaner!)

##################################
Kshift ENABLED:
  night    @ *-*-* 19:44:00
   day     @ *-*-* 06:49:00
 october   @ *-10-* 00:00:00

##################################