
저는 세 가지 언어로 글을 쓰고 있는데 일부 텍스트를 번역할 때 주어진 순간에 두 가지 언어 사이를 자주 전환해야 합니다.
예를 들어 15분 동안 30초마다 1과 2 사이를 전환해야 합니다. 다음 15분 동안 1과 3 사이를 전환해야 합니다. 그리고 마침내 2와 3 사이를 전환해야 합니다.
현재의 "사이클링" 논리는 편리하지 않습니다. 왜냐하면 현재와 필요한 레이아웃을 생각해야 하기 때문입니다.
아마도 Caps+1 , Caps+2, Caps+3 같은 것이 괜찮을 것입니다. 하지만 KDE를 이런 식으로 구성할 수는 없습니다.
뭔가 빠졌나요?
답변1
귀하의 사용 사례는 아무도 귀하를 수용할 인터페이스나 구성을 구축하려고 하지 않을 정도로 이상합니다. 그러나 다음 프로그램에 대해 세 가지 다른 전역 키 단축키를 설정하여 무언가를 맥가이버할 수 있습니다.
#!/usr/bin/env perl
use 5.010; use strict; use warnings FATAL=>'all';
use Getopt::Long qw(GetOptions); use autodie qw(:all);
use Pod::Usage qw(pod2usage);
GetOptions(
'layout=s@' => \my @layouts,
'help|?' => \my $help,
'man' => \my $man,
) or pod2usage(2);
pod2usage(1) if $help;
pod2usage(-verbose => 2) if $man;
pod2usage unless 2 == @layouts;
my $xkb_identifier = qr'[\w_:()]+';
my ($current_layout)
= qx'setxkbmap -print'
=~ /xkb_symbols { include "$xkb_identifier[+]($xkb_identifier)/ms;
die "Layout '$current_layout' is active, but can only switch from: @layouts\n"
unless $current_layout ~~ @layouts;
system 'setxkbmap', grep $current_layout ne $_, @layouts;
__END__
=head1 NAME
switchxkbmap - switch between two layouts
=head1 SYNOPSIS
switchxkbmap -l xkb_identifier -l xkb_identifier
switchxkbmap -l hr -l fr
switchxkbmap -l 'de(nodeadkeys)' -l 'ru(phonetic)'
=head2 Options
--layout, -l (mandatory, twice) xkb identifier of a layout
--help brief help message
--man full documentation
=head1 OPTIONS
All options can be abbreviated, see L<Getopt::Long/Case and abbreviations>.
=over
=item --layout
Mandatory, option must be given twice. The value is an xkb identifier such as
C<hr> or C<de(nodeadkeys)>.
=item --help
Print a brief help message and exits.
=item --man
Prints the manual page and exits.
=back
=head1 DESCRIPTION
C<switchxkbmap> switches between exactly two layouts given as command-line
arguments. For example, to switch between Croatian and French, run
switchxkbmap -l hr -l fr
If Croatian is currently active, French will be activated and vice versa.
Or to switch between German and Russian with specific variants:
switchxkbmap --layout='de(nodeadkeys)' --layout='ru(phonetic)'
The program will abort if the current active layout does not match one
of the given layouts because it would not know to which one to switch to.
The exact names of layouts and variants can be found out by running the KDE3
Control Centre module C<kcmshell keyboard_layout> or by inspecting the files
under F</usr/share/X11/xkb/symbols>.
=head1 AUTHOR
C<[email protected]>
=head1 LICENCE
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, sublicence, 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:
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.
답변2
KDE에는 모든 것에 대한 설정이 있습니다. 그리고 그렇습니다. 귀하의 경우에 맞는 특별한 설정도 있습니다.
건반KDE 제어 모듈 ⇒ 레이아웃. 확인하다예비 레이아웃. 당신의 언어 중 하나를 만드십시오여분의, 나머지 2개는 ... 여유가 없습니다. 이제 Alt+Shift를 누르면 해당 2개 언어가 있고, 다른 언어에 액세스해야 하는 경우 시스템 트레이에서 키보드 레이아웃 아이콘을 마우스 오른쪽 버튼으로 클릭하고 해당 언어를 선택하면 2개 언어 중 하나가 대체됩니다. 이제 언어 1이 생겼습니다. Alt+Shift를 누르면 3이 됩니다.