question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Toggle Dark Reader from command line

See original GitHub issue

Is your feature request related to a problem? Please describe.

I am working on a script for automatically switching between light/dark themes across all my applications. This script saves me tons of time since I usually switch to a light theme, then back to a dark theme, at least twice per day, in several applications.

It would be amazing if I could toggle the Dark Reader plugin (on/off) from the command line in Linux, so it could be included in my global theme switching script.

Describe the solution you’d like

With my limited knowledge of extension development, I can imagine two possible solutions:

  • Have an editable config file inside the extension directory that I could modify using (for example) sed, and make the extension poll that file regularly
  • Provide an extension URL that I could open in my browser that would enable or disable the extension. This would be a less clean solution, as a new tab would need to be opened in the browser to toggle the extension, which means the browser would be focused

Additional context

I really love this extension and have been an avid user for years. From today forward I am also a monthly contributor 🙂

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:7
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
WhyNotHugocommented, Dec 15, 2020

I’d love to see this happen too.

I’ve written darkman, which switched desktop theme to dark mode at sundown and back at sunrise.

I’d love to be able to signal darkreader somehow and tell it to switch modes.

There’s work being done to expose a D-Bus service at an OS level. I believe it is possible for a Firefox add-on to listen to host D-Bus signals using nativeMessaging. Would a PR for that be acceptable?

1reaction
Gustedcommented, Dec 15, 2020

This would allow for another extension to communicate with an external process that communicates with the system API to sync the dark-mode status, right?

Yes, because we use a passive system into the PR, that just setup a listening port and let other extension send messages to it. I didn’t add any nativeMessaging support, because we as Dark Reader need to make the first message to a nativeMessage host, this can be done by having a list in Dark Reader that users to add nativeMessage and let Dark Reader deal with sending a hello world message to let the native application know it can go send options etc. However this also require intervals to reguarly check if any inactive native applications are finally awake. It requires some good logic and I prefer to implement this in another PR after the external connections is polish so I know what the guidelines are and how the logic definitely looks like.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help – Dark Reader
Toggle site button adds the current site into the ignore list (or removes it from there). · Use Invert listed only if you...
Read more >
darkreader - npm
Dark Reader is an open-source MIT-licensed browser extension designed to analyze web pages. Dark Reader will generate a dark mode that aims to ......
Read more >
Chromium - ArchWiki
Chromium is an open-source graphical web browser based on the Blink rendering engine. It is the basis for the proprietary Google Chrome ...
Read more >
How to automatically toggle the Dark Reader Chrome plugin?
Click on 'dev tools' (as shown above). This will open a small window. Click on 'preview new design' (as shown below). Note that...
Read more >
firefox disable dark mode
How to Enable Dark Mode on Microsoft's Edge Browser on Windows 10, ... Open the terminal window from application manager or use the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found