A #project from 2 years ago that I use every single day:

zsh-lux, a #zsh plugin to toggle the light & dark modes of #macOS and other items and applications on the command line. It can be configured by setting variables and expanded by defining functions.

Out of the box, it supports macOS, the macOS desktop picture, iTerm2, VSCode and all at once.

Today I added support for toggling the light/dark/automatic/dynamic mode of Apple's Dynamic Desktop pictures, all via #cli.

https://github.com/pndurette/zsh-lux

GitHub - pndurette/zsh-lux: zsh plugin to toggle light/dark modes of macOS but also of iTerm, Visual Studio Code and anything you can script/theme

zsh plugin to toggle light/dark modes of macOS but also of iTerm, Visual Studio Code and anything you can script/theme - GitHub - pndurette/zsh-lux: zsh plugin to toggle light/dark modes of macOS b...

GitHub

A powerful yet hidden #macOS feature is the ability to script the system and apps via JavaScript, officially called macOS JavaScript for Automation (#JXA). Essentially it's #AppleScript written in #JavaScript.

Lots of info here: https://github.com/JXA-Cookbook/JXA-Cookbook/wiki

e.g. to get the current track name in the Music app via the CLI:

osascript -l JavaScript -e 'Application("Music").currentTrack.name()'

GitHub - JXA-Cookbook/JXA-Cookbook: Cookbook for JavaScript for Automation in Mac OS X Yosemite

Cookbook for JavaScript for Automation in Mac OS X Yosemite - JXA-Cookbook/JXA-Cookbook

GitHub

@pierrenick I had no idea you could do this with #JavaScript.

I currently only have one user script, written in #AppleScript, that I use regularly. All it does is create a shortcut to toggle the OS scroll direction. It’s really helpful for when I un/dock my #MacBook and have to switch between using a mouse and the trackpad.

I wasn’t really sold in AppleScript. It was way too verbose for my liking, but this I will definitely have to try.

 â˜• 

@asteroidrainfall I used to do lots of AppleScript in System 7/8! I grew up with Macs so that’s how I ‘programmed’ I guess haha.