8

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
  • 585

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

PRATAP
  • 22,460
  • 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
1

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
  • 38,003
  • 27
  • 156
  • 232
ankostis
  • 235
  • 2
  • 11