惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Schneier on Security
T
Tenable Blog
I
Intezer
S
Securelist
Scott Helme
Scott Helme
V
Visual Studio Blog
Simon Willison's Weblog
Simon Willison's Weblog
Google DeepMind News
Google DeepMind News
T
The Blog of Author Tim Ferriss
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AWS News Blog
AWS News Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
F
Fortinet All Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
L
Lohrmann on Cybersecurity
M
MIT News - Artificial intelligence
G
GRAHAM CLULEY
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
雷峰网
雷峰网
MyScale Blog
MyScale Blog
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
C
CXSECURITY Database RSS Feed - CXSecurity.com
量子位
博客园 - 三生石上(FineUI控件)
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
Cisco Talos Blog
Cisco Talos Blog
Security Latest
Security Latest
Project Zero
Project Zero
K
Kaspersky official blog
罗磊的独立博客
Know Your Adversary
Know Your Adversary
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Apple Machine Learning Research
Apple Machine Learning Research

endtimes.dev

Happy new year | endtimes.dev why lowercase letters save data Practical betterments | endtimes.dev Short posts and some site updates Input Output | endtimes.dev Actually, dark mode can save the planet Why your website should be under 14kB in size HTML and CSS only multiple color scheme picker Why your website should work without Javascript. An HTML and CSS only dark-mode toggle button. you can use css to remove the double-tap zoom feature on iOs Missing Dice | endtimes.dev Can Dark Mode Save Battery Life and Human Civilzation? Your DNS has a significant impact on site speed. Add spaces to the dock on MacOS You can leave out <html>, <head>, and <body> tags. Listen for changes between dark and light mode with javascript Why Your Website Should Use Dithered Images You can restore the startup chimes on MacOS Emoji Clipboard | endtimes.dev You can use Emojis as Favicons .dev and HSTS preload | endtimes.dev Prod — Block Distractions. Achieve your goals. Pattern generator | endtimes.dev Green Quarantine | endtimes.dev Qwitter Bot | endtimes.dev
Use a keyboard shortcut to quickly toggle light and dark mode on MacOs.
2020-12-24 · via endtimes.dev

When developing a site with a light and dark modes, it gets bothersome to change your settings to see results.

Especially if you're testing javascript that listens for the change in user preferences — or if you've animated the change between modes.

I work on a MacBook and would open settings to do this, i'd miss the css transitions. It was annoying.

But there's a fix for this. You can set up a keyboard shortcut to toggle between light and dark mode with automator, here's how:

Add workflow to Automator #

  1. Open automator
  2. Click filenew
  3. Select quick actionchoose
  4. Select "workflow receives current no input in any application" from the dropdown options.
  5. In the long list of actions on the left find Run AppleScript. Then Double-Click to add it to your workflow.
  6. Paste the following commands in your workflow:
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
end tell
end tell
  1. Save the Workflow, call it something sensible like "toggle dark mode"

Click the the play button ▶️ to see the script in action.

Add the shortcut #

  1. Open System Preferences
  2. Click keyboardShortcuts
  3. Click services on the left.
  4. Scroll down and find general, your workflow is there.
  5. Double Click on the right hand side of your workflow, where it says none
  6. Type the shortcut you want to use. I use shift-command-7.

I have my appearance preferences set to auto and this shortcut doesn't interfere with it. When the time comes, it sets itself to the correct setting.

Source: I found this tip by googling it then finding this post on lifehacker

published
24 Dec 2020
modified
24 Dec 2020
author
Nathaniel
tags
posts productivity MacOs Apple