Can I use osquery (v4.6.0) to determine the keyboa...
# macos
s
Can I use osquery (v4.6.0) to determine the keyboard type installed? If so, what would that query look like?
t
Are you talking external keyboard or the built-in keyboard of the laptop? And by “type” do you mean layout? Or type of internal switching mechanism?
s
@terracatta The built-in keyboard. Yes, I want to identify the different layouts we're supporting (e.g. en, jp, uk, sk).
a
I looked this up in ioreg forever ago... let me find the code
all I cared about was Japan because I couldn't get techs in EMEA to verify/QA/extend as needed... let me throw it in a gist
s
There's a luncher table wrapped over ioreg, but I'm not sure there's anything quite the same in osquery directly.
👍 1
a
one of the practical concerns was sending a computer localized in the wrong OS and expecting people to log in when the keyboard input method didn't match. With current DEP and locally-sourced hdwe this should be LESS of a concern, since setup assistant should help vs. the old days when we were imaging
s
@allister ty. 🤔 I was hoping there was a way to pull the usb/bluetooth device info. In my world, we're supporting employees in Japan and EMEA with the variety of keyboard options. Sometimes when ordering a new laptop, we'll pull the info from Jamf which doesn't give the ability to show keyboard layout. Where Jamf could not provide the info, I'd create a EA using output from osquery.
a
definitely been there https://github.com/arubdesu/eas
s
ty 🙂
a
USB/bluetooth stuff can definitely be tricky, as a shortterm using the launcher @seph mentioned means you can look at HID's from system_profiler output
s
Launcher is kolides open source agent. It's runs osquery, adds custom tables, and manages updates. You can use it, or extract the tables.
s
@allister @seph I think I may have found something that could give me what I need with osquery:
select key,value from plist where path = '/Library/Preferences/com.apple.HIToolbox.plist' and value like '%keylayout%';
With your input and seeing a jamf post, I thought I might be close. I could create an EA with this and related smart groups in Jamf.
👍 1