Add a default case for ibus-next-engine
This commit is contained in:
parent
4d90b684d4
commit
53ceae2137
|
@ -17,16 +17,18 @@ let
|
||||||
else nextRec (tail l);
|
else nextRec (tail l);
|
||||||
in
|
in
|
||||||
nextRec input-methods;
|
nextRec input-methods;
|
||||||
|
changeTo = m: ''
|
||||||
|
${pkgs.libnotify}/bin/notify-send \
|
||||||
|
-a ibus \
|
||||||
|
-u low \
|
||||||
|
-t 3000 \
|
||||||
|
"${m}" \
|
||||||
|
"Input engine changed"
|
||||||
|
${pkgs.ibus}/bin/ibus engine ${m}
|
||||||
|
'';
|
||||||
inputCase = m: ''
|
inputCase = m: ''
|
||||||
if test $current = "${m}"
|
case "${m}"
|
||||||
${pkgs.libnotify}/bin/notify-send \
|
${changeTo (next m)}
|
||||||
-a ibus \
|
|
||||||
-u low \
|
|
||||||
-t 3000 \
|
|
||||||
"${next m}" \
|
|
||||||
"Input engine changed"
|
|
||||||
${pkgs.ibus}/bin/ibus engine ${next m}
|
|
||||||
end
|
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
pkgs.writeScriptBin "ibus-next-engine" ''
|
pkgs.writeScriptBin "ibus-next-engine" ''
|
||||||
|
@ -34,7 +36,11 @@ let
|
||||||
|
|
||||||
set current (${pkgs.ibus}/bin/ibus engine)
|
set current (${pkgs.ibus}/bin/ibus engine)
|
||||||
|
|
||||||
${strings.concatMapStrings inputCase input-methods}
|
switch $current
|
||||||
|
${strings.concatMapStrings inputCase input-methods}
|
||||||
|
case '*'
|
||||||
|
${changeTo (head input-methods)}
|
||||||
|
end
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue