| Crates.io | ke_auto_profile_switcher |
| lib.rs | ke_auto_profile_switcher |
| version | 0.2.1 |
| created_at | 2022-05-19 11:59:16.866044+00 |
| updated_at | 2025-07-08 16:09:27.66677+00 |
| description | This CLI automatically switches Karabiner-Elements profiles with and without USB keyboard connection |
| homepage | |
| repository | https://github.com/Layzie/ke_auto_profile_switcher |
| max_upload_size | |
| id | 589669 |
| size | 51,393 |
This CLI automatically switches Karabiner-Elements profiles based on USB keyboard connection status. When an external USB keyboard is connected, it switches to your designated profile for external keyboards. When disconnected, it switches back to your default profile.
$ cargo install ke_auto_profile_switcher
# Simply run watch command - you'll be guided through setup if no config exists
$ kaps watch
# Check your USB keyboard's product ID first
$ kaps check
# Start watching with your keyboard's details
$ kaps watch --keyboard-id 1234 --product-profile "External Keyboard" --default-profile "Default"
Create ~/.config/ke_auto_profile_switcher/config.yml:
keyboard_id: 1234
product_profile: "External Keyboard"
default_profile: "Default"
Then simply run:
$ kaps watch
kaps checkLists all connected USB devices with their product IDs. Use this to identify your external keyboard's product ID.
$ kaps check
kaps watchStarts monitoring USB device connections and automatically switches Karabiner profiles.
# Interactive mode (will prompt for configuration if needed)
$ kaps watch
# With command-line arguments
$ kaps watch --keyboard-id <PRODUCT_ID> --product-profile <EXTERNAL_PROFILE>
# With all options
$ kaps watch --keyboard-id <PRODUCT_ID> --product-profile <EXTERNAL_PROFILE> --default-profile <DEFAULT_PROFILE>
--keyboard-id (-k): USB product ID of your external keyboard--product-profile (-p): Karabiner profile name to use when external keyboard is connected--default-profile (-d): Karabiner profile name to use when external keyboard is disconnected (defaults to "Default")The application uses configuration in the following priority order:
~/.config/ke_auto_profile_switcher/config.ymlFind your keyboard's product ID:
$ kaps check
Available USB devices:
ID: 1452, Product: Apple Internal Keyboard / Trackpad
ID: 1234, Product: My External Keyboard
Start monitoring (interactive setup):
$ kaps watch
Configuration file not found. Let's create one!
Available USB devices:
ID: 1452, Product: Apple Internal Keyboard / Trackpad
ID: 1234, Product: My External Keyboard
Enter the USB keyboard product ID: 1234
Enter the Karabiner-Elements profile name for external keyboard: External Keyboard
Enter the default Karabiner-Elements profile name [Default]:
Configuration saved successfully!
Connect/disconnect your external keyboard and watch the automatic profile switching!
MIT License
Copyright (c) 2022 HIRAKI Satoru
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.