Swiftpack.co - Package - ehamberg/karabiner-profile-switcher

Karabiner Profile Switcher

!!! This is no longer needed since karabiner elements allow you to target modifictions to specific devices !!!

Switch to a given karabiner-elements profile when a specific USB keyboard is attached (and switch back to a default profile when it is removed).


kps \
  --default-profile 'Built-in keyboard' \
  --device-profile 'Kinesis Advantage' \
  --vendor-id 0x05f3 \
  --product-id 0x0081

To find the vendor and product id for your keyboard, attach it and go to Apple Menu → About This Mac → System Report and look under USB.


To build:

swift build -c release

The binary will end up in .build/release/kps.


You probably want to run this as a launchd agent. To do this, first make sure that it works when you run it from the shell. Then, when you know exactly which arguments it should take, create a launchd agent config in ~/Library/LaunchAgents/no.hamberg.karabiner-profile-switcher.plist with the following contents (replace the arguments and make sure the path to kps is correct):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
      <string>Built-in keyboard</string>
      <string>Kinesis Advantage</string>

The agent should then be launched on the next boot and run in the background. To launch it this time, without rebooting, run the following command:

launchctl load ~/Library/LaunchAgents/no.hamberg.karabiner-profile-switcher.plist


To generate an Xcode project:

swift package generate-xcodeproj

To run the linter:



Stars: 0
Help us keep the lights on

Used By

Total: 0