Git Product home page Git Product logo

qonfused / asussmc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hieplpvip/asussmc

2.0 2.0 0.0 193 KB

(Fork) A VirtualSMC plugin provides native macOS support for ALS, keyboard backlight and Fn keys on Asus laptops

Home Page: https://github.com/Qonfused/AsusSMC

License: MIT License

Shell 11.74% C++ 70.70% C 5.14% Objective-C 12.42%
apple asus hackintosh kext lilu macos oce-build opencore patcher screenpad virtualsmc

asussmc's People

Contributors

ar-cade avatar hieplpvip avatar qonfused avatar ubsefor avatar

Stargazers

 avatar  avatar

Watchers

 avatar

asussmc's Issues

Refactor OSD for screenpad backlight

There is currently no OSD indicator for brightness when controlling backlight for screenpad devices. This may limit the practicality of ACPI patches that implement more than a handful of brightness steps. Refer to SSDT-SPLC.dsl#L42-L63 for an implementation example.

There is already a function for extracting and calling the same OSD method in AsusSMC (AsusSMCDaemon/OSD.h), though perhaps a clearer reference comes from ExternalDisplayBrightness for handling multiple displays:

// @fnesveda/ExternalDisplayBrightness/src/ExternalDisplayBrightness/BrightnessManager.swift#L330-L349
330 | // shows the brightness HUD with the correct brightness indicator on the correct display
331 | // unfortunately Apple doesn't provide a public API for this, so we have to manually extract the function from the OSD framework
332 | private static var showBrightnessHUD: ((CGDirectDisplayID, Int, Int) -> Void)? {
333 | 	if let osdLoaded = Bundle(path: "/System/Library/PrivateFrameworks/OSD.framework")?.load(), osdLoaded {
334 | 		if let sharedOSDManager = NSClassFromString("OSDManager")?.value(forKeyPath: "sharedManager") as AnyObject? {
335 | 			let showImageSelector = Selector(("showImage:onDisplayID:priority:msecUntilFade:filledChiclets:totalChiclets:locked:"))
336 | 			if sharedOSDManager.responds(to: showImageSelector) {
337 | 				let showImageImplementation = sharedOSDManager.method(for: showImageSelector)
338 | 				
339 | 				typealias ShowImageFunctionType = @convention(c) (AnyObject, Selector, UInt32, UInt32, UInt32, UInt32, UInt32, UInt32, Bool) -> Void
340 | 				let showImage = unsafeBitCast(showImageImplementation, to: ShowImageFunctionType.self)
341 | 				
342 | 				return {(onDisplayID: CGDirectDisplayID, filledChiclets: Int, totalChiclets: Int) -> Void in
343 | 					showImage(sharedOSDManager, showImageSelector, 1, onDisplayID, 0x1f3, 1000, UInt32(filledChiclets), UInt32(totalChiclets), false)
344 | 				}
345 | 			}
346 | 		}
347 | 	}
348 | 	return nil
349 | }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.