Thanks to visit codestin.com
Credit goes to github.com

Skip to content

awaescher/remode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

remode

A tiny webserver that allows setting your macOS appearance to light or dark mode remotely.

Do I need this?

Controlling the appearance like this can be useful if you want to change it based on smart home automations.

If you run a MacBook with an ambient light sensor, I highly encourage you to use DarkModeBuddy instead.

How to change the appearance with a webrequest?

The webserver is accepting POST requests to the /appearance endpoint with the body being either "light" or "dark". The default port is 18471.

curl -X POST http://localhost:18471/appearance -d "light"

Installing

  1. clone this repository into a directory of your choice and cd into it
  2. change com.awaescher.remode.plist:
    • define the absolute (!) path to the python exectable
      • use where python3 to find it, it should be pre-installed with macOS
    • define the absolute (!) path of remode-server.py
  3. (optional) change the port in remode-server.py if you don't like the default 18471
  4. make the python script executable chmod +x remode-server.py
  5. place the plist in LaunchAgents: sudo cp com.awaescher.remode.plist ~/Library/LaunchAgents/com.awaescher.remode.plist
  6. run a manual test by ...
    • starting the server with python3 remode-server.py
    • checking if your webserver works with curl -X POST http://localhost:18471/appearance -d "dark" (or "light")
  7. make sure this works, then restart and check again with curl whether the server got started with macOS automatically

Uninstalling

  1. Delete the LaunchAgent with rm -f ~/Library/LaunchAgents/com.awaescher.remode.plist
  2. Restart
  3. Delete the cloned folder

About

Switch macOS to light or dark mode remotely

Topics

Resources

License

Stars

Watchers

Forks

Languages