JSON::Karabiner::Manipulator::Conditions - turns baubles into trinkets
use JSON::Karabiner; # first, create the condition object my $variable_cond_obj = $manip_obj->add_condition('variable_if'); # next, add data to it $variable_cond_obj->add_variable('some_var_name' => 'some_value')
Condtions make the from and to actions conditional upon the values of other data. This gives you more control over when and under what environments your actions will occur. Below is an overview of how to set the conditions available to you via Karabiner.
from
to
Note that the condition objects must be created before you can add data to them. See the example in the Synopsis above.
$device_condition_obj->add_identifier('vendor_id' => 5, 'product_id' => 2222); $device_condition_obj->add_identifier('vendor_id' => 6, 'product_id' => 2223); $device_condition_obj->add_description('some description');
See Karabiner official documentation
$event_condition_obj->add_value( 'true' ); $event_condition_obj->add_description('some description');
$fm_app_obj->add_bundle_identifiers( 'bundle_id_one', 'bundle_id_two'); $fm_app_obj->add_file_paths( 'file_path1', 'file_path2'); $fm_app_obj->add_description('some description');
$input_source_obj->add_input_source('language' => 'languare regex', 'input_source_id' => 'input source id regex'); $input_source_obj->add_input_source('language' => 'languare regex', 'input_source_id' => 'input source id regex'); $input_source_obj->add_description('some description');
$keybd_condition_obj->add_keyboard_types('keybd_type1', 'keybd_type2') $keybd_condition_obj->add_description('some description')
$var_cond_obj->add_variable('variable_name' => 'value');
version 0.009
Steve Dondley <s@dondley.com>
This software is copyright (c) 2020 by Steve Dondley.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install JSON::Karabiner, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::Karabiner
CPAN shell
perl -MCPAN -e shell install JSON::Karabiner
For more information on module installation, please visit the detailed CPAN module installation guide.