How to use wlsunset/light.sh?

I’m not sure what you mean by 4000k, but there is no need to add your coordinates to the script because the whole point of the script is to determine your latitude and longitude for you, based on the output of curl -s http://ip-api.com/json.

#!/bin/sh
CONTENT=$(curl -s http://ip-api.com/json/)
longitude=$(echo $CONTENT | jq .lon)
latitude=$(echo $CONTENT | jq .lat)
wlsunset -l $latitude -L $longitude

I tested this script just now and it definitely works.

If you want to manually enter your latitude and longitude instead of using the script, then you should edit the line in ~/.config/sway/config.d/autostart_applications that calls the script, to instead use your custom wlsunset command. Putting it in ~/.config/sway/config.d/autostart_applications is what gets it running automatically.

Change this line:

exec ~/.config/sway/scripts/light.sh

To something like this:

exec wlsunset -l 39.9 -L 116.3

Substitute 39.9 for your latitude, and 116.3 for your longitude.

You can see other supported options with wlsunset -h:

❯ wlsunset -h
usage: wlsunset [options]
  -h             show this help message
  -v             show the version number
  -o <output>    name of output (display) to use,
                 by default all outputs are used
                 can be specified multiple times
  -t <temp>      set low temperature (default: 4000)
  -T <temp>      set high temperature (default: 6500)
  -l <lat>       set latitude (e.g. 39.9)
  -L <long>      set longitude (e.g. 116.3)
  -S <sunrise>   set manual sunrise (e.g. 06:30)
  -s <sunset>    set manual sunset (e.g. 18:30)
  -d <duration>  set manual duration in seconds (e.g. 1800)
  -g <gamma>     set gamma (default: 1.0)
2 Likes