Skip to content

Instantly share code, notes, and snippets.

@waydabber
waydabber / MacParams.swift
Created March 28, 2023 17:02
Some basic display data of Macs released between 2012-2022
struct MacParams {
var type: String
var isArm: Bool
var hasBuiltIn: Bool
var builtInSizeInch: Float
var pixelsWide: Int
var pixelsHigh: Int
var hiDPI: Bool
var clamshell: Bool
@waydabber
waydabber / ddcavcontrol.init.lua
Last active March 12, 2023 20:17
Hammerspoon script to control a Display via DDC (brighness, volume) and a Yamaha AV (network) using standard Mac keyboard with MacOS OSD
-- ddcavcontrol
-- v1.2.1
-- This Hammerspoon script is intended to do the following:
-- 1) Control External Display Brightness via DDC (utilizing a proper brightness+contrast curve)
-- 2) Control External Display Volume via DDC
-- 3) Control Digital AV Volume via Network (currently works with Yamaha AVs)
-- 4) Use the standard brightness and volume keys of an Apple keyboards
-- 5) Display the standard MacOS OSD as expected
@waydabber
waydabber / chbrt.m
Last active October 7, 2022 09:22
This should change the brightness level of a single external display connected to an M1 MBP or MBA relative to the current setting using DDC/CI. Reportedly does not work on M1 Mini.
@import Darwin;
@import Foundation;
@import IOKit;
/*******
This should change the brightness level of a single external display connected to an M1 MBP or MBA relative to the current setting using DDC/CI. Reportedly does not work on M1 Mini.
Credits to @tao-j and @alin23
Compile: