HN user

hank_z

54 karma
Posts1
Comments63
View on HN

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

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.

Can I ask how you use Sidebery and Tree Style Tab? I found that they both create a panel on the left side of screen and will stay there forever, which reduces the space for web content. The left panel also makes my small laptop screen look even smaller.

Eudic is a dictionary app that has all the features you wanted. It has clients across all platforms. I have been using it for many years and it works like a charm.

You can allow cross-site tracking and third party cookie in safari, then use teams from safari. I have been using it this way without any issues for all my Teams meetings.

Zotero 6 4 years ago

At least Zotero will not pull off its apps from App Store for no reason.

LibreOffice 7.3 4 years ago

A problem always bothers me is LO is laggy and unresponsive while GPU is used to train ml model in ubuntu.

Me too. I find subtitles are the main distraction for me to enjoy what’s going on in the screen. I understand that a lot people actually need them. That’s why I am very thankful that subtitles can be turn on/off if needed. I actually hate any videos that have subtitles embedded inside the video (part of each frame)