Guest User

Untitled

a guest
Apr 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #!/usr/bin/env perl
  2.  
  3. my ($vowel) = @ARGV;
  4.  
  5. my @codes = (
  6. [38 => ['a', 'A']],
  7. [26 => ['e', 'E']],
  8. [31 => ['i', 'I']],
  9. [32 => ['o', 'O']],
  10. [30 => ['u', 'U']],
  11. );
  12.  
  13. if ($vowel) {
  14. foreach (@codes) {
  15. $_->[1][0] = lc $vowel;
  16. $_->[1][1] = uc $vowel;
  17. }
  18. }
  19.  
  20. system('xmodmap', map(keycode(@$_), @codes));
  21.  
  22. sub keycode {
  23. my ($code, $pair) = @_;
  24. return ('-e', "keycode $code = @$pair");
  25. }
Add Comment
Please, Sign In to add comment