Score:2

How to hide the prompt-like thing when changing input source?

ng flag

I am using ibus-avro on Ubuntu 20.04. I have 2 input sources: en, bn. I am using F8 to switch the sources. When switching, a large prompt-like thing (I don't know the exact term) is shown on screen. I cannot take a screenshot of it (Print Screen is not working while it is visible), but it looks something like this:

prompt-like thing looks like this

It is annoying, and it also seems to prevent typing for a moment until it goes away. How to hide this and just switch the input source instantly? Thanks.

UPDATE: This issue does not seem that annoying when using Ctrl+Space or Super+Space for switching input sources. In those cases, it only seems to be visible as long as the Ctrl or Super (respectively) key is held down.

br flag
One way is to create commands and attach them to F8. Otherway is to patch the gnome-shell code.
br flag
SuSpace.sh script in this link is one possibility to bind the script to F8 Key. https://askubuntu.com/a/1198150/739431
br flag
You can also use gnome tweaks to change the input sources without notification on screen but that don't accept single key from Fn keys
ng flag
@UnKNOWn I just tried Ctrl+Space and also Super+Space from the keyboard shortcuts settings and none of them seems to have this issue. However, I would prefer using F8. Need to try the script I guess.
br flag
Yes but is F8 Choosable as a Keybinding??
ng flag
@UnKNOWn From here, yes: Settings --> Keyboard Shortcuts --> Typing --> Switch to next input source. That also auto-changes the Switch to previous input source shortcut to Shift+F8.
br flag
If you can assign shortcut key to F8.. you can bind F8 to run the above script. Have you tried that?
ng flag
@UnKNOWn Yes, it's working! I modified the script a little bit though (mainly replaced the `math` variable with `$((currentLang+1))`), then saved it as an executable, added it as a shortcut from the Keyboard Shortcuts settings, and it works. Thanks. Please post it as an answer.
Score:0
br flag

Workaround Only

You can create an executable script with below content and bind the script to F8 Key

#!/bin/bash

totalLang=$(gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager()._mruSources.length" | grep -oP "(?<=').*?(?=')")

currentLang=$(gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().currentSource.index" | grep -oP "(?<=').*?(?=')")

math=$((currentLang+1))

if [ "$math" -lt "$totalLang" ]; then
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources["$currentLang+1"].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[0].activate()"
fi
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.