Detect system color scheme and set night_mode cookie on X.com
A simple Tampermonkey userscript that automatically detects your system's color scheme (light or dark mode) and sets the night_mode cookie on X.com accordingly. This ensures that X.com's theme aligns with your system preferences without manual intervention.
matchMedia to detect whether your system is in light or dark mode.night_mode cookie to 0 for light mode or 2 for dark mode.max-age=31536000).http://tampermonkey.net/0.1https://x.com/*window.matchMedia('(prefers-color-scheme: dark)').night_mode cookie to:
0 if the system is in light mode.2 if the system is in dark mode.x.com domain with a 1-year expiration.System is in dark mode. Set night_mode cookie to 2