Wie konfiguriere ich KDE für bequemes Umschalten zwischen drei Tastaturlayouts?

Wie konfiguriere ich KDE für bequemes Umschalten zwischen drei Tastaturlayouts?

Ich schreibe in drei Sprachen und muss beim Übersetzen einiger Texte häufig zwischen zwei Sprachen gleichzeitig wechseln.

Beispielsweise muss ich 15 Minuten lang alle 30 Sekunden zwischen 1 und 2 wechseln. Die nächsten 15 Minuten muss ich zwischen 1 und 3 wechseln. Und schließlich zwischen 2 und 3.

Die aktuelle „Zyklus“-Logik ist nicht praktisch, da ich über das aktuelle und das benötigte Layout nachdenken muss.

Vielleicht wäre etwas wie Caps+1, Caps+2, Caps+3 ok, aber ich kann KDE nicht auf diese Weise konfigurieren.

Übersehe ich etwas?

Antwort1

Ihr Anwendungsfall ist so seltsam, dass sich niemand die Mühe gemacht hat, eine Schnittstelle oder Konfiguration zu erstellen, die Ihnen entgegenkommt. Sie können jedoch etwas MacGyver-mäßig machen, indem Sie drei verschiedene globale Tastenkombinationen für das folgende Programm einrichten:

#!/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.

Antwort2

KDE hat Einstellungen für ALLES. Und ja, es gibt sogar spezielle Einstellungen für Ihren Fall.

TastaturKDE-Kontrollmodul ⇨ Layouts. Überprüfen SieErsatzlayouts. Machen Sie eine Ihrer SprachenErsatzteil, und die anderen beiden ... nicht frei. Jetzt haben Sie diese beiden Sprachen mit Alt+Umschalt, und wenn Sie auf die andere zugreifen müssen, klicken Sie mit der rechten Maustaste auf das Tastaturlayout-Symbol in der Taskleiste, wählen Sie diese Sprache aus und sie ersetzt eine dieser beiden. Jetzt haben Sie also Sprache 1 und 3 mit Alt+Umschalt.

verwandte Informationen