If anyone is looking for an alternative, I have been using my script below for two years without any issue.
--edit--
I do not know how to format code here.
--edit--
Another attempt to format code here.
# Step 1
Save script below to your local drive. For example, `/Users/xxxx/Documents/Scripts/DarkMode/darkModeWatcher.sh`
#!/bin/zsh
# ref: https://unix.stackexchange.com/a/526097
# start time is 18:33 -> 18 * 60 * 60 + 33 * 60 = 66780
# end time is 07:33 -> 07 * 60 * 60 + 33 * 60 = 27180
# install gdate via `brew install gdate`
if [[ $(uname -m) == 'arm64' ]]; then
secsSinceMidnight=$(( $(/opt/homebrew/bin/gdate +%s) - $(/opt/homebrew/bin/gdate -d '00:00:00' +%s) ))
else
secsSinceMidnight=$(( $(/usr/local/bin/gdate +%s) - $(/usr/local/bin/gdate -d '00:00:00' +%s) ))
fi
if [[ $secsSinceMidnight -lt 27180 || $secsSinceMidnight -gt 66780 ]]; then
# turn on dark mode
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to true'
else
# turn off dark mode
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to false'
fi
# Step 2
run `crontab -e` and add script below
# cron job for enabling macOS dark mode periodically
# darkModeWatcher script is executed 60s after reboot. After that, it is executed at 35 mins of each hour if the display is not asleep.
# replace xxxx with your username
@reboot sleep 60 && /bin/zsh /Users/xxxx/Documents/Scripts/DarkMode/darkModeWatcher.sh >> /Users/xxxx/Library/Logs/systemDarkModeWatcher.log 2>&1
35 */1 * * * if [[ -n "$(/usr/sbin/system_profiler SPDisplaysDataType | /usr/bin/grep 'Asleep')" ]]; then newDisplayStatus=0; else newDisplayStatus=1; fi && if [[ $newDisplayStatus == 1 ]]; then /bin/zsh /Users/xxxx/Documents/Scripts/DarkMode/darkModeWatcher.sh >> /Users/xxxx/Library/Logs/systemDarkModeWatcher.log 2>&1 ; fi
FYI... last time I tried, I could get the equivalent of a HTML <PRE> block by putting two spaces at the beginning of every line. Here's an example. Each line was indented two spaces:
#include <stdio.h>
int main() {
printf( "Bonjour, totes le monde!\n" );
return( 0 );
}
Looks like it worked. It looks like it's rendering with a mono font.
It appears to me that this solution is only designed for macOS. Anyone knows any cross-platform solution? It would be very interesting to see how the same keybindings are implemented in Windows/Ubuntu/macOS.
Another quick off topic question related to 2FA. If students are required to complete the 2FA to access to university's learning resources, is the university responsible to provide a hardware token if some students cannot afford/use the mobile phone to complete the 2FA?
A quick off topic question related to 2FA. If an employee is required to complete the 2FA to access to the company's system, is the company responsible to provide the employee a necessary device (either phone or hardware token) to complete the 2FA?
In what way? Morally and ethically, I think you're going to get a resounding yes from people here. Legally, I very much doubt it, but I am not a lawyer.
Legally. In my opinion, if something is required for a worker to finish the job, the employer is obligated to provide it for free. I could be wrong. Curious to know other people's thought.
I’m not sure what the laws are, but it would seem pretty silly to fire an engineer over the cost of a device like this. Of course it is important that you don’t have a cellphone, from your employer’s point of view.
Or “I don’t bring it to work, I want to focus on your issues 100% no distractions, boss :)”
There are much better alternatives than buying a smartphone if all you want to provide is a 2FA device. Yubikey is one alternative, as a consumer you can buy it for ~50 EUR but I'm sure if you buy 100+ for employees, you can get some sort of deal with them.
If the company provides employees with a key to access the office, are they obliged to provide the employee with a keyring on which to put it? A pocket to keep it in? Or are they able to assume that the employee probably would prefer to keep the key on their own keyring, in their own pocket?
I feel the same about 2FA tokens. As a matter of convenience I install the tokens my employer gives me on my personal phone because it makes it easy for me to keep them available at all times.
If for some reason I was unable or unwilling to do so, though, I might expect to be allowed to expense a yubikey.
We actually wanted to give company phones to the staff for this purpose among others but there was a rather big pushback, people didn't wanted another devices to carry.
I can use Teams on the stable version without any issues. You might have cross-origin cookies disabled, which will stop Teams from working. PS. FF:v110.0.1 (64-bit), macOS: 13.2.1.
Oops, sorry. I was using the Office 365 Teams (teams.microsoft.com), which runs ok on FF. I can confirm the Teams for the personal account (https://teams.live.com/_#/unsupportedBrowser) is not supported in FF.
Those cookies are disabled by default in Firefox. Are you saying that to successfully use Teams one has to alter their browser configuration to make it _less secure_?