7

Recently i installed Ubuntu 18.04. I added a Bengali keyboard layout and set the shortcut to switch between languages. The problem is when i press the shortcut key a popup notification appears and the keyboard fridges for about 3 seconds.

How can i disable this notification popup and get relief from the keyboard fridge issue.

I installed gnome-tweak-tool application and there is a way out of this. There is a list of preset shortcut keys to switch languages and can be enabled any or multiple of them.

For a long time i use F12 as the shortcut key. I want to use F12 and the popup disabled too.

enter image description here

nasirkhan
  • 565
  • 2
  • 5
  • 12
  • 3
    Possible duplicate of [How to NOT show this window when changing language](https://askubuntu.com/questions/972926/how-to-not-show-this-window-when-changing-language) – pomsky Jun 02 '18 at 07:08
  • thanks for the comment. I do not think it is a duplicate. As i mentioned in the question that, shortcuts from `gnome-tweak-tool` can be a solution to the popup issue. But i want to set my preferred key with disabled popup. – nasirkhan Jun 02 '18 at 07:43
  • Agree, very annoying popup notification, it's strange there's no solution yet – megas Feb 06 '20 at 09:46
  • @Dims inshort, when you press F12.. you would like to switch to next input source without the popup? – PRATAP May 08 '20 at 10:19
  • @pomsky I agree it is a duplicate. The invoked reason for escaping the duplicity flagging, the tweak-tool providing shortcuts for direct layout selections, it is irrelevant because the Original Poster asks explicitly for a "cycling" shortcut, which is what the [dupe target](https://askubuntu.com/questions/972926/how-to-not-show-this-window-when-changing-language) solves, – ankostis Jul 31 '23 at 07:47

2 Answers2

4

Assuming you only have two languages set..

create a script with below content..

#!/bin/bash

CURRENT=`gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().currentSource.index"`

if [ "$CURRENT" == "(true, '1')" ]; then
  gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources[0].activate()"
else
  gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources[1].activate()"
fi

Create a keyboard shortcut with F12 like below..

enter image description here

enter image description here

You can see the language changing with F12 button pressed in the above gif.

Further Reading

Ashkan Laei
  • 113
  • 5
PRATAP
  • 21,989
  • 8
  • 59
  • 121
  • I have more than two languages. Also I want them to reorder automatically on switching. If the only way is to write own script, then may be it is possible to wipe it out from Gnome code? – Dims May 08 '20 at 11:36
  • 2
    Also I need to switch languages with Ctrl-Shift. – Dims May 08 '20 at 11:41
  • Ctrl Shift same thing can be achieved.. – PRATAP May 08 '20 at 11:59
  • "reorder automatically on switching?? " is something like this link?? https://askubuntu.com/q/1197856/739431 – PRATAP May 08 '20 at 12:00
  • Ctrl Shift will do the same thing if you select it from gnome-tweaks or command line.. I think you need to raise a new Question with full clarity of what you want to achieve.. some ones question is to change two given languages with F12 without popup and its achieved in the above way in the Answer.. – PRATAP May 09 '20 at 09:29
0

I developed Quick Lang Switch Gnome-shell extension to do exactly that, no popup appears and switching languages happens instantly. Plus, it does not require a custom-shortcut (the regular one changes behavior), so gnome-tweak-tool works just fine.

Disclaimer: I am the developer of the Quick Lang Switch...

andrew.46
  • 37,085
  • 25
  • 149
  • 228
ankostis
  • 181
  • 11