This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Tool to convert Ergodox-EZ Configurator generated keymaps | |
# to something a little easier to read/work with. | |
# | |
# runs like: | |
# cleanup.rb [downloaded keymap.c] > [destination keymap.c] | |
def fix_keymap(km_str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Tool to convert Ergodox-EZ Configurator generated keymaps | |
# to something a little easier to read/work with. | |
# | |
# runs like: | |
# cleanup.rb [downloaded keymap.c] > [destination keymap.c] | |
open(FILE,$ARGV[0]) || die "Can't open the file [$!]\n"; | |
local $/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Tool to convert Ergodox-EZ Configurator generated keymaps | |
# to somthing a little easier to read/work with. | |
# | |
# runs like: | |
# cleanup.rb [downloaded keymap.c] > [destination keymap.c] | |
open(FILE,$ARGV[0]) || die "Can't open the file [$!]\n"; | |
local $/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Tool to convert Ergodox-EZ Configurator generated keymaps | |
# to somthing a little easier to read/work with. | |
# | |
# runs like: | |
# cleanup.rb [downloaded keymap.c] > [destination keymap.c] | |
def fix_keymap(km_str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def fix_keymap(km_str) | |
km_str.gsub!(/LALT\(LCTL\(LGUI\(LSFT\((.*?)\)\)\)\)/,'HYPR(\1)') | |
km_str.gsub!(/LGUI\(LSFT\((.*?)\)\)/,'SGUI(\1)') | |
km_str.gsub!(/LALT\(LCTL\((.*?)\)\)/,'LCA(\1)') | |
km_str.gsub!(/LCTL\(LGUI\(LSFT\((.*?)\)\)\)/,'LCGS(\1)') | |
km_str.gsub!(/LCTL\(LSFT\((.*?)\)\)/,'LCS(\1)') | |
km_str.gsub!(/MT\(MOD_HYPR, (.*?)\)/,'HYPR_T(\1)') | |
km_str.gsub!(/MT\(MOD_MEH, (.*?)\)/,'MEH_T(\1)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Tool to convert Ergodox-EZ Configurator generated keymaps | |
# to somthing a little easier to read/work with. | |
# | |
# runs like: | |
# cleanup.rb [downloaded keymap.c] > [destination keymap.c] | |
open(FILE,$ARGV[0]) || die "Can't open the file [$!]\n"; | |
local $/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def fix_keymap(km_str) | |
km_str.gsub!(/LALT\(LCTL\(LGUI\(LSFT\((.*?)\)\)\)\)/,'HYPR(\1)') | |
km_str.gsub!(/LGUI\(LSFT\((.*?)\)\)/,'SGUI(\1)') | |
km_str.gsub!(/LALT\(LCTL\((.*?)\)\)/,'LCA(\1)') | |
km_str.gsub!(/LCTL\(LGUI\(LSFT\((.*?)\)\)\)/,'LCGS(\1)') | |
km_str.gsub!(/LCTL\(LSFT\((.*?)\)\)/,'LCS(\1)') | |
km_str.gsub!(/MT\(MOD_HYPR, (.*?)\)/,'HYPR_T(\1)') | |
km_str.gsub!(/MT\(MOD_MEH, (.*?)\)/,'MEH_T(\1)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
open(FILE,$ARGV[0]) || die "Can't open the file [$!]\n"; | |
local $/; | |
$keymap = <FILE>; | |
close(FILE); | |
$keymap =~ s/LALT\(LCTL\(LGUI\(LSFT\((.*?)\)\)\)\)/HYPR($1)/g; | |
$keymap =~ s/LGUI\(LSFT\((.*?)\)\)/SGUI($1)/g; | |
$keymap =~ s/LALT\(LCTL\((.*?)\)\)/LCA($1)/g; | |
$keymap =~ s/LCTL\(LGUI\(LSFT\((.*?)\)\)\)/LCGS($1)/g; | |
$keymap =~ s/LCTL\(LSFT\((.*?)\)\)/LCS($1)/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
open(FILE,$ARGV[0]) || die "Can't open the file [$!]\n"; | |
local $/; | |
$keymap = <FILE>; | |
close(FILE); | |
$keymap =~ s/LALT\(LCTL\(LGUI\(LSFT\((.*?)\)\)\)\)/HYPR($1)/g; | |
$keymap =~ s/LGUI\(LSFT\((.*?)\)\)/SGUI($1)/g; | |
$keymap =~ s/LALT\(LCTL\((.*?)\)\)/LCA($1)/g; | |
$keymap =~ s/LCTL\(LGUI\(LSFT\((.*?)\)\)\)/LCGS($1)/g; | |
$keymap =~ s/LCTL\(LSFT\((.*?)\)\)/LCS($1)/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def fix_keymap(km_str) | |
km_str.gsub!(/LALT\(LCTL\(LGUI\(LSFT\((.*?)\)\)\)\)/,'HYPR(\1)') | |
km_str.gsub!(/LGUI\(LSFT\((.*?)\)\)/,'SGUI(\1)') | |
km_str.gsub!(/LALT\(LCTL\((.*?)\)\)/,'LCA(\1)') | |
km_str.gsub!(/LCTL\(LGUI\(LSFT\((.*?)\)\)\)/,'LCGS(\1)') | |
km_str.gsub!(/LCTL\(LSFT\((.*?)\)\)/,'LCS(\1)') | |
km_str.gsub!(/MT\(MOD_HYPR, (.*?)\)/,'HYPR_T(\1)') | |
km_str.gsub!(/MT\(MOD_MEH, (.*?)\)/,'MEH_T(\1)') |
NewerOlder