Modeless/stateless layout language switching with Caps Lock, again (18.04 LTS Bionic Beaver)How do I programmatically change the current input method?How to use Alt+Shift to switch keyboard layouts?Fast switch input source via CapsLock button in Ubuntu 17.10Stateless layout switching in Ubuntu 14.04Reliable keyboard layout switching with Caps LockHow can I switch input language with CapsLock on Ubuntu 18.04?Configure keyboard shortcuts to CapsLock and Shift + CapsLock in 18.04 Bionic BeaverHow to assign Caps Lock (first lang) and Shift+Caps Lock (second lang) in Ubuntu 18.04?Ubuntu 18.04 - how to change keyboard shortcuts without Gnome control center GUI?Manipulate the Default Shortcut Super+Space for Switching to Next Input Source without Graphical RepresentationSwitching < and ^ with german layoutPermanently set keyboard layout options with setxkbmap in gnome/unityReliable keyboard layout switching with Caps LockWhen changing layout in Xfce, caps lock is always onKubuntu 18.04 Bionic Beaver release filesUbuntu 18.04 Bionic Beaver install hangs after choosing keyboard layoutHow to assign Caps Lock (first lang) and Shift+Caps Lock (second lang) in Ubuntu 18.04?Remapping Caps Lock to Escape in Ubuntu 18.04 bionicProblem with nstalling Steam on Ubuntu 18.04 LTS Bionic BeaverConfigure keyboard shortcuts to CapsLock and Shift + CapsLock in 18.04 Bionic Beaver

Where can I find the list of all tendons in the human body?

If a massive object like Jupiter flew past the Earth how close would it need to come to pull people off of the surface?

Asking bank to reduce APR instead of increasing credit limit

Why were the Night's Watch required to be celibate?

California: "For quality assurance, this phone call is being recorded"

The oldest tradition stopped before it got back to him

Are there regional foods in Westeros?

Asking for something with different prices

Did airlines fly their aircraft slower in response to oil prices in the 1970s?

Joist hangers to use for rough cut 2x8 (2 3/4" x 8 3/4")?

Is there a rule that prohibits us from using 2 possessives in a row?

How can an eldritch abomination hide its true form in public?

Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?

Why is Colorado so different politically from nearby states?

Future enhancements for the finite element method

Orientable with respect to complex cobordism?

How can I stop my presentation being derailed by audience questions?

Can I ask a publisher for a paper that I need for reviewing

Can a rogue effectively triple their speed by combining Dash and Ready?

Creating Fictional Slavic Place Names

Opposite of "Squeaky wheel gets the grease"

Is the capacitor drawn or wired wrongly?

Modern approach to radio buttons

How can I offer a test ride while selling a bike?



Modeless/stateless layout language switching with Caps Lock, again (18.04 LTS Bionic Beaver)


How do I programmatically change the current input method?How to use Alt+Shift to switch keyboard layouts?Fast switch input source via CapsLock button in Ubuntu 17.10Stateless layout switching in Ubuntu 14.04Reliable keyboard layout switching with Caps LockHow can I switch input language with CapsLock on Ubuntu 18.04?Configure keyboard shortcuts to CapsLock and Shift + CapsLock in 18.04 Bionic BeaverHow to assign Caps Lock (first lang) and Shift+Caps Lock (second lang) in Ubuntu 18.04?Ubuntu 18.04 - how to change keyboard shortcuts without Gnome control center GUI?Manipulate the Default Shortcut Super+Space for Switching to Next Input Source without Graphical RepresentationSwitching < and ^ with german layoutPermanently set keyboard layout options with setxkbmap in gnome/unityReliable keyboard layout switching with Caps LockWhen changing layout in Xfce, caps lock is always onKubuntu 18.04 Bionic Beaver release filesUbuntu 18.04 Bionic Beaver install hangs after choosing keyboard layoutHow to assign Caps Lock (first lang) and Shift+Caps Lock (second lang) in Ubuntu 18.04?Remapping Caps Lock to Escape in Ubuntu 18.04 bionicProblem with nstalling Steam on Ubuntu 18.04 LTS Bionic BeaverConfigure keyboard shortcuts to CapsLock and Shift + CapsLock in 18.04 Bionic Beaver






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








11















This has been asked countless times, so I'll try to be brief.



I have two input layouts, Ukrainian and English, and want:



  • to use Caps Lock for fast switching;

  • not have any delays imposed, I'm a fast typer;

  • not have mode errors:

    • (any number of) CapsLock sets English,

    • (any number of) ShiftCapsLock sets Ukrainian;


  • see the current layout in the standard widget.

I've already tried three (!) GUIs to configure this, the Gnome Settings, the gnome-tweak-tool, the dconf-editor/gsettings. Nothing works. Tweaks crashes randomly.



Enough homework done



I've asked this myself 4 years ago for 14.04 LTS. Since then, that UI popup appeared and all broke. I can now easily configure stateful CapsLock toggle, but even then, it goes with that irritating delay. Basically unusable at times when I need language switched 4-5 times per sentence.



This thread suggests caps:none XKB option as a bug workaround. I've tried that, both with gsettings CLI and dconf-editor, and in combinations with grp:shift_caps_switch XKB option. No dice. Something trumps those core XKB features as it seems.



This thread offers caps:menu XKB option as a hack to be able to bind CapsLock in Gnome Settings → Devices → Keyboard. It kinda works, but A) it gives cyclic/stateful switching; B) I have to wait a decent timeout on every switch.



This thread asks exactly what I need, yet it's unanswered and even worse: closed as duplicate of two other questions (???) none of which are the same, and none of which give me a working solution. What's wrong with you guys?



There's another exact match — alas, unanswered as well!




Wanted: clean solution










share|improve this question



















  • 1





    What about reputation instead of $ for a bounty, let's say +50 points reputation?

    – karel
    Mar 5 at 11:15












  • @karel I see nothing wrong with that, however "fresh" questions are not eligible for rep bounty on stackexchange. A bounty can be started on a question two days after the question was asked; please un-downvote.

    – ulidtko
    Mar 5 at 11:25











  • I didn't downvote. All I did was commented.

    – karel
    Mar 5 at 11:26












  • Ok. Nevertheless, I did both offered and earned reputation bounties specifically on AskUbuntu. This question is going to get one, too, when it's time.

    – ulidtko
    Mar 5 at 11:28







  • 1





    @ulidtko I'll try to take a peak at gnome-tweaks-tool. Won't promise if I can dig out anything and will need quite some time, since I'm busy lately, but I'll post an answer if I dig out anything related to gnome-tweak-tool. Feel free to leave me a comment here or contact me in other ways

    – Sergiy Kolodyazhnyy
    Mar 19 at 23:11

















11















This has been asked countless times, so I'll try to be brief.



I have two input layouts, Ukrainian and English, and want:



  • to use Caps Lock for fast switching;

  • not have any delays imposed, I'm a fast typer;

  • not have mode errors:

    • (any number of) CapsLock sets English,

    • (any number of) ShiftCapsLock sets Ukrainian;


  • see the current layout in the standard widget.

I've already tried three (!) GUIs to configure this, the Gnome Settings, the gnome-tweak-tool, the dconf-editor/gsettings. Nothing works. Tweaks crashes randomly.



Enough homework done



I've asked this myself 4 years ago for 14.04 LTS. Since then, that UI popup appeared and all broke. I can now easily configure stateful CapsLock toggle, but even then, it goes with that irritating delay. Basically unusable at times when I need language switched 4-5 times per sentence.



This thread suggests caps:none XKB option as a bug workaround. I've tried that, both with gsettings CLI and dconf-editor, and in combinations with grp:shift_caps_switch XKB option. No dice. Something trumps those core XKB features as it seems.



This thread offers caps:menu XKB option as a hack to be able to bind CapsLock in Gnome Settings → Devices → Keyboard. It kinda works, but A) it gives cyclic/stateful switching; B) I have to wait a decent timeout on every switch.



This thread asks exactly what I need, yet it's unanswered and even worse: closed as duplicate of two other questions (???) none of which are the same, and none of which give me a working solution. What's wrong with you guys?



There's another exact match — alas, unanswered as well!




Wanted: clean solution










share|improve this question



















  • 1





    What about reputation instead of $ for a bounty, let's say +50 points reputation?

    – karel
    Mar 5 at 11:15












  • @karel I see nothing wrong with that, however "fresh" questions are not eligible for rep bounty on stackexchange. A bounty can be started on a question two days after the question was asked; please un-downvote.

    – ulidtko
    Mar 5 at 11:25











  • I didn't downvote. All I did was commented.

    – karel
    Mar 5 at 11:26












  • Ok. Nevertheless, I did both offered and earned reputation bounties specifically on AskUbuntu. This question is going to get one, too, when it's time.

    – ulidtko
    Mar 5 at 11:28







  • 1





    @ulidtko I'll try to take a peak at gnome-tweaks-tool. Won't promise if I can dig out anything and will need quite some time, since I'm busy lately, but I'll post an answer if I dig out anything related to gnome-tweak-tool. Feel free to leave me a comment here or contact me in other ways

    – Sergiy Kolodyazhnyy
    Mar 19 at 23:11













11












11








11


1






This has been asked countless times, so I'll try to be brief.



I have two input layouts, Ukrainian and English, and want:



  • to use Caps Lock for fast switching;

  • not have any delays imposed, I'm a fast typer;

  • not have mode errors:

    • (any number of) CapsLock sets English,

    • (any number of) ShiftCapsLock sets Ukrainian;


  • see the current layout in the standard widget.

I've already tried three (!) GUIs to configure this, the Gnome Settings, the gnome-tweak-tool, the dconf-editor/gsettings. Nothing works. Tweaks crashes randomly.



Enough homework done



I've asked this myself 4 years ago for 14.04 LTS. Since then, that UI popup appeared and all broke. I can now easily configure stateful CapsLock toggle, but even then, it goes with that irritating delay. Basically unusable at times when I need language switched 4-5 times per sentence.



This thread suggests caps:none XKB option as a bug workaround. I've tried that, both with gsettings CLI and dconf-editor, and in combinations with grp:shift_caps_switch XKB option. No dice. Something trumps those core XKB features as it seems.



This thread offers caps:menu XKB option as a hack to be able to bind CapsLock in Gnome Settings → Devices → Keyboard. It kinda works, but A) it gives cyclic/stateful switching; B) I have to wait a decent timeout on every switch.



This thread asks exactly what I need, yet it's unanswered and even worse: closed as duplicate of two other questions (???) none of which are the same, and none of which give me a working solution. What's wrong with you guys?



There's another exact match — alas, unanswered as well!




Wanted: clean solution










share|improve this question
















This has been asked countless times, so I'll try to be brief.



I have two input layouts, Ukrainian and English, and want:



  • to use Caps Lock for fast switching;

  • not have any delays imposed, I'm a fast typer;

  • not have mode errors:

    • (any number of) CapsLock sets English,

    • (any number of) ShiftCapsLock sets Ukrainian;


  • see the current layout in the standard widget.

I've already tried three (!) GUIs to configure this, the Gnome Settings, the gnome-tweak-tool, the dconf-editor/gsettings. Nothing works. Tweaks crashes randomly.



Enough homework done



I've asked this myself 4 years ago for 14.04 LTS. Since then, that UI popup appeared and all broke. I can now easily configure stateful CapsLock toggle, but even then, it goes with that irritating delay. Basically unusable at times when I need language switched 4-5 times per sentence.



This thread suggests caps:none XKB option as a bug workaround. I've tried that, both with gsettings CLI and dconf-editor, and in combinations with grp:shift_caps_switch XKB option. No dice. Something trumps those core XKB features as it seems.



This thread offers caps:menu XKB option as a hack to be able to bind CapsLock in Gnome Settings → Devices → Keyboard. It kinda works, but A) it gives cyclic/stateful switching; B) I have to wait a decent timeout on every switch.



This thread asks exactly what I need, yet it's unanswered and even worse: closed as duplicate of two other questions (???) none of which are the same, and none of which give me a working solution. What's wrong with you guys?



There's another exact match — alas, unanswered as well!




Wanted: clean solution







18.04 gnome keyboard-layout input-language accessibility






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 5 at 16:48









pomsky

35.2k11109142




35.2k11109142










asked Mar 5 at 9:31









ulidtkoulidtko

3,92912744




3,92912744







  • 1





    What about reputation instead of $ for a bounty, let's say +50 points reputation?

    – karel
    Mar 5 at 11:15












  • @karel I see nothing wrong with that, however "fresh" questions are not eligible for rep bounty on stackexchange. A bounty can be started on a question two days after the question was asked; please un-downvote.

    – ulidtko
    Mar 5 at 11:25











  • I didn't downvote. All I did was commented.

    – karel
    Mar 5 at 11:26












  • Ok. Nevertheless, I did both offered and earned reputation bounties specifically on AskUbuntu. This question is going to get one, too, when it's time.

    – ulidtko
    Mar 5 at 11:28







  • 1





    @ulidtko I'll try to take a peak at gnome-tweaks-tool. Won't promise if I can dig out anything and will need quite some time, since I'm busy lately, but I'll post an answer if I dig out anything related to gnome-tweak-tool. Feel free to leave me a comment here or contact me in other ways

    – Sergiy Kolodyazhnyy
    Mar 19 at 23:11












  • 1





    What about reputation instead of $ for a bounty, let's say +50 points reputation?

    – karel
    Mar 5 at 11:15












  • @karel I see nothing wrong with that, however "fresh" questions are not eligible for rep bounty on stackexchange. A bounty can be started on a question two days after the question was asked; please un-downvote.

    – ulidtko
    Mar 5 at 11:25











  • I didn't downvote. All I did was commented.

    – karel
    Mar 5 at 11:26












  • Ok. Nevertheless, I did both offered and earned reputation bounties specifically on AskUbuntu. This question is going to get one, too, when it's time.

    – ulidtko
    Mar 5 at 11:28







  • 1





    @ulidtko I'll try to take a peak at gnome-tweaks-tool. Won't promise if I can dig out anything and will need quite some time, since I'm busy lately, but I'll post an answer if I dig out anything related to gnome-tweak-tool. Feel free to leave me a comment here or contact me in other ways

    – Sergiy Kolodyazhnyy
    Mar 19 at 23:11







1




1





What about reputation instead of $ for a bounty, let's say +50 points reputation?

– karel
Mar 5 at 11:15






What about reputation instead of $ for a bounty, let's say +50 points reputation?

– karel
Mar 5 at 11:15














@karel I see nothing wrong with that, however "fresh" questions are not eligible for rep bounty on stackexchange. A bounty can be started on a question two days after the question was asked; please un-downvote.

– ulidtko
Mar 5 at 11:25





@karel I see nothing wrong with that, however "fresh" questions are not eligible for rep bounty on stackexchange. A bounty can be started on a question two days after the question was asked; please un-downvote.

– ulidtko
Mar 5 at 11:25













I didn't downvote. All I did was commented.

– karel
Mar 5 at 11:26






I didn't downvote. All I did was commented.

– karel
Mar 5 at 11:26














Ok. Nevertheless, I did both offered and earned reputation bounties specifically on AskUbuntu. This question is going to get one, too, when it's time.

– ulidtko
Mar 5 at 11:28






Ok. Nevertheless, I did both offered and earned reputation bounties specifically on AskUbuntu. This question is going to get one, too, when it's time.

– ulidtko
Mar 5 at 11:28





1




1





@ulidtko I'll try to take a peak at gnome-tweaks-tool. Won't promise if I can dig out anything and will need quite some time, since I'm busy lately, but I'll post an answer if I dig out anything related to gnome-tweak-tool. Feel free to leave me a comment here or contact me in other ways

– Sergiy Kolodyazhnyy
Mar 19 at 23:11





@ulidtko I'll try to take a peak at gnome-tweaks-tool. Won't promise if I can dig out anything and will need quite some time, since I'm busy lately, but I'll post an answer if I dig out anything related to gnome-tweak-tool. Feel free to leave me a comment here or contact me in other ways

– Sergiy Kolodyazhnyy
Mar 19 at 23:11










2 Answers
2






active

oldest

votes


















3














In Ubuntu 18.04, by default there is a option to choose Caps_Lock and Shift+Caps_Lock to achieve the behavior we are looking for, is in gnome-tweaks. But this is not working and could not get the reason why.



enter image description here



I could manage to achieve this behavior by the below workaround.



See this link for a 20Sec Video. https://imgur.com/QNdrVqa



first check the below commands in terminal whether they are changing the input language.



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()"


and



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()"


well, they are working.



enter image description here



we need to bind these commands to key presses of Caps_Lock and Shift+Caps_Lock



can achieve this with xbindkeys if xbindkeys is not yet installed install it by sudo apt install xbindkeys



  1. create a file .xbindkeysrc in $HOME folder
    touch ~/.xbindkeysrc

  2. to know the keycode/id what ever it is called

    run xbindkeys --key once the white box appears press the Caps_Lock button, do it for Shift button also and copy the keycodes/ids as show below

enter image description here



  1. this step is Optional.. Disable the Caps Lock. See below gif. If caps lock is not disabled.. when you hit the key multiple times it will toggle while you try to change the language. I have Disabled it. but it is based on your interest.

enter image description here



  1. Open the file .xbindkeysrc
    gedit ~/.xbindkeysrc and edit the file like below based on the results of above steps

Change the values in below content according to the results you got in step 2 above.
Content:



"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()""
m:0x10 + c:66

"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()""
Shift+Mod2 + Shift_L+m:0x10 + c:66


  1. Save the file, Close & Reboot..





share|improve this answer


















  • 2





    OMG it worked! I didn't even need to log-out, evenless reboot (xbindkeys --poll-rc). I also left grp:shift_caps_switch XKB option on — which changed how my key codes are printed (m:0x0 + c:66 ISO_First_Group & m:0x1 + c:66 Shift + ISO_First_Group); no problems from that. Even the keyboard LED shines! Amazing job, you totally should've get this bounty. (gnome-tweaks authors, whoever they are, get a grumpy frown from me & others.)

    – ulidtko
    Mar 19 at 12:35



















5





+150









There is a bug report you can subscribe to:



  • keyboard panel does not allow to set up Caps as input switch

The bug report reads:




Keyboard panel has options for input switching, but it does not allow
to use Caps as language switch.



Steps to reproduce:



  1. gnome-control-center keyboard

  2. Scroll down to 'Typing' section

  3. Click on Switch to next input source

  4. Press Caps

Expected result: Caps Lock key is accepted as switch key Actual
results: Caps key is ignored in the selection window.



P.S. Same goes for 'Switch to previous input source' and Shift-Caps
key combination.




Bug Workarounds



The bug is currently on the "Wishlist". These workarounds are proposed:



Workaround 1



Found a workaround for this bug:



  1. Install dconf-editor (sudo apt-get install dconf-editor)

  2. Go to /org/gnome/desktop/wm/keybindings/

  3. Select key switch-input-source, turn off "Use default value" and set "Custom value" to ['Caps_Lock']

  4. (Optional) You can also change value for switch-input-source-backward to something like ['Caps_Lock'] (again, turning off "Use default value")

Workaround 2



Another way to do this:
1. Install GNOME Tweaks (gnome-tweak-tool)
2. Open the Tweaks app
3. Switch to the Keyboard & Mouse panel
4. Click Additional Layout Options
5. Use the "Switching to another layout" section



Subscribe to bug report



I would recommend subscribing to the bug report and adding your own experiences. The more people subscribing to the bug report, the faster the solution comes (usually).






share|improve this answer























  • Workaround 1 doesn't suit my requirements, it gives cyclic switching, which is not what I want. Workaround 2 (Gnome-Tweaks) has been tried and beaten to death; I can make it crash, but can't make it work. Thanks for (yet another) link though.

    – ulidtko
    Mar 14 at 12:00











  • I upvoted your question to hopefully draw more attention. Posting all your trials and errors on the bug report might be helpful.

    – WinEunuuchs2Unix
    Mar 14 at 12:26











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1123163%2fmodeless-stateless-layout-language-switching-with-caps-lock-again-18-04-lts-bi%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














In Ubuntu 18.04, by default there is a option to choose Caps_Lock and Shift+Caps_Lock to achieve the behavior we are looking for, is in gnome-tweaks. But this is not working and could not get the reason why.



enter image description here



I could manage to achieve this behavior by the below workaround.



See this link for a 20Sec Video. https://imgur.com/QNdrVqa



first check the below commands in terminal whether they are changing the input language.



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()"


and



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()"


well, they are working.



enter image description here



we need to bind these commands to key presses of Caps_Lock and Shift+Caps_Lock



can achieve this with xbindkeys if xbindkeys is not yet installed install it by sudo apt install xbindkeys



  1. create a file .xbindkeysrc in $HOME folder
    touch ~/.xbindkeysrc

  2. to know the keycode/id what ever it is called

    run xbindkeys --key once the white box appears press the Caps_Lock button, do it for Shift button also and copy the keycodes/ids as show below

enter image description here



  1. this step is Optional.. Disable the Caps Lock. See below gif. If caps lock is not disabled.. when you hit the key multiple times it will toggle while you try to change the language. I have Disabled it. but it is based on your interest.

enter image description here



  1. Open the file .xbindkeysrc
    gedit ~/.xbindkeysrc and edit the file like below based on the results of above steps

Change the values in below content according to the results you got in step 2 above.
Content:



"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()""
m:0x10 + c:66

"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()""
Shift+Mod2 + Shift_L+m:0x10 + c:66


  1. Save the file, Close & Reboot..





share|improve this answer


















  • 2





    OMG it worked! I didn't even need to log-out, evenless reboot (xbindkeys --poll-rc). I also left grp:shift_caps_switch XKB option on — which changed how my key codes are printed (m:0x0 + c:66 ISO_First_Group & m:0x1 + c:66 Shift + ISO_First_Group); no problems from that. Even the keyboard LED shines! Amazing job, you totally should've get this bounty. (gnome-tweaks authors, whoever they are, get a grumpy frown from me & others.)

    – ulidtko
    Mar 19 at 12:35
















3














In Ubuntu 18.04, by default there is a option to choose Caps_Lock and Shift+Caps_Lock to achieve the behavior we are looking for, is in gnome-tweaks. But this is not working and could not get the reason why.



enter image description here



I could manage to achieve this behavior by the below workaround.



See this link for a 20Sec Video. https://imgur.com/QNdrVqa



first check the below commands in terminal whether they are changing the input language.



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()"


and



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()"


well, they are working.



enter image description here



we need to bind these commands to key presses of Caps_Lock and Shift+Caps_Lock



can achieve this with xbindkeys if xbindkeys is not yet installed install it by sudo apt install xbindkeys



  1. create a file .xbindkeysrc in $HOME folder
    touch ~/.xbindkeysrc

  2. to know the keycode/id what ever it is called

    run xbindkeys --key once the white box appears press the Caps_Lock button, do it for Shift button also and copy the keycodes/ids as show below

enter image description here



  1. this step is Optional.. Disable the Caps Lock. See below gif. If caps lock is not disabled.. when you hit the key multiple times it will toggle while you try to change the language. I have Disabled it. but it is based on your interest.

enter image description here



  1. Open the file .xbindkeysrc
    gedit ~/.xbindkeysrc and edit the file like below based on the results of above steps

Change the values in below content according to the results you got in step 2 above.
Content:



"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()""
m:0x10 + c:66

"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()""
Shift+Mod2 + Shift_L+m:0x10 + c:66


  1. Save the file, Close & Reboot..





share|improve this answer


















  • 2





    OMG it worked! I didn't even need to log-out, evenless reboot (xbindkeys --poll-rc). I also left grp:shift_caps_switch XKB option on — which changed how my key codes are printed (m:0x0 + c:66 ISO_First_Group & m:0x1 + c:66 Shift + ISO_First_Group); no problems from that. Even the keyboard LED shines! Amazing job, you totally should've get this bounty. (gnome-tweaks authors, whoever they are, get a grumpy frown from me & others.)

    – ulidtko
    Mar 19 at 12:35














3












3








3







In Ubuntu 18.04, by default there is a option to choose Caps_Lock and Shift+Caps_Lock to achieve the behavior we are looking for, is in gnome-tweaks. But this is not working and could not get the reason why.



enter image description here



I could manage to achieve this behavior by the below workaround.



See this link for a 20Sec Video. https://imgur.com/QNdrVqa



first check the below commands in terminal whether they are changing the input language.



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()"


and



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()"


well, they are working.



enter image description here



we need to bind these commands to key presses of Caps_Lock and Shift+Caps_Lock



can achieve this with xbindkeys if xbindkeys is not yet installed install it by sudo apt install xbindkeys



  1. create a file .xbindkeysrc in $HOME folder
    touch ~/.xbindkeysrc

  2. to know the keycode/id what ever it is called

    run xbindkeys --key once the white box appears press the Caps_Lock button, do it for Shift button also and copy the keycodes/ids as show below

enter image description here



  1. this step is Optional.. Disable the Caps Lock. See below gif. If caps lock is not disabled.. when you hit the key multiple times it will toggle while you try to change the language. I have Disabled it. but it is based on your interest.

enter image description here



  1. Open the file .xbindkeysrc
    gedit ~/.xbindkeysrc and edit the file like below based on the results of above steps

Change the values in below content according to the results you got in step 2 above.
Content:



"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()""
m:0x10 + c:66

"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()""
Shift+Mod2 + Shift_L+m:0x10 + c:66


  1. Save the file, Close & Reboot..





share|improve this answer













In Ubuntu 18.04, by default there is a option to choose Caps_Lock and Shift+Caps_Lock to achieve the behavior we are looking for, is in gnome-tweaks. But this is not working and could not get the reason why.



enter image description here



I could manage to achieve this behavior by the below workaround.



See this link for a 20Sec Video. https://imgur.com/QNdrVqa



first check the below commands in terminal whether they are changing the input language.



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()"


and



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()"


well, they are working.



enter image description here



we need to bind these commands to key presses of Caps_Lock and Shift+Caps_Lock



can achieve this with xbindkeys if xbindkeys is not yet installed install it by sudo apt install xbindkeys



  1. create a file .xbindkeysrc in $HOME folder
    touch ~/.xbindkeysrc

  2. to know the keycode/id what ever it is called

    run xbindkeys --key once the white box appears press the Caps_Lock button, do it for Shift button also and copy the keycodes/ids as show below

enter image description here



  1. this step is Optional.. Disable the Caps Lock. See below gif. If caps lock is not disabled.. when you hit the key multiple times it will toggle while you try to change the language. I have Disabled it. but it is based on your interest.

enter image description here



  1. Open the file .xbindkeysrc
    gedit ~/.xbindkeysrc and edit the file like below based on the results of above steps

Change the values in below content according to the results you got in step 2 above.
Content:



"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()""
m:0x10 + c:66

"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()""
Shift+Mod2 + Shift_L+m:0x10 + c:66


  1. Save the file, Close & Reboot..






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 17 at 15:02









PRATAPPRATAP

4,2272935




4,2272935







  • 2





    OMG it worked! I didn't even need to log-out, evenless reboot (xbindkeys --poll-rc). I also left grp:shift_caps_switch XKB option on — which changed how my key codes are printed (m:0x0 + c:66 ISO_First_Group & m:0x1 + c:66 Shift + ISO_First_Group); no problems from that. Even the keyboard LED shines! Amazing job, you totally should've get this bounty. (gnome-tweaks authors, whoever they are, get a grumpy frown from me & others.)

    – ulidtko
    Mar 19 at 12:35













  • 2





    OMG it worked! I didn't even need to log-out, evenless reboot (xbindkeys --poll-rc). I also left grp:shift_caps_switch XKB option on — which changed how my key codes are printed (m:0x0 + c:66 ISO_First_Group & m:0x1 + c:66 Shift + ISO_First_Group); no problems from that. Even the keyboard LED shines! Amazing job, you totally should've get this bounty. (gnome-tweaks authors, whoever they are, get a grumpy frown from me & others.)

    – ulidtko
    Mar 19 at 12:35








2




2





OMG it worked! I didn't even need to log-out, evenless reboot (xbindkeys --poll-rc). I also left grp:shift_caps_switch XKB option on — which changed how my key codes are printed (m:0x0 + c:66 ISO_First_Group & m:0x1 + c:66 Shift + ISO_First_Group); no problems from that. Even the keyboard LED shines! Amazing job, you totally should've get this bounty. (gnome-tweaks authors, whoever they are, get a grumpy frown from me & others.)

– ulidtko
Mar 19 at 12:35






OMG it worked! I didn't even need to log-out, evenless reboot (xbindkeys --poll-rc). I also left grp:shift_caps_switch XKB option on — which changed how my key codes are printed (m:0x0 + c:66 ISO_First_Group & m:0x1 + c:66 Shift + ISO_First_Group); no problems from that. Even the keyboard LED shines! Amazing job, you totally should've get this bounty. (gnome-tweaks authors, whoever they are, get a grumpy frown from me & others.)

– ulidtko
Mar 19 at 12:35














5





+150









There is a bug report you can subscribe to:



  • keyboard panel does not allow to set up Caps as input switch

The bug report reads:




Keyboard panel has options for input switching, but it does not allow
to use Caps as language switch.



Steps to reproduce:



  1. gnome-control-center keyboard

  2. Scroll down to 'Typing' section

  3. Click on Switch to next input source

  4. Press Caps

Expected result: Caps Lock key is accepted as switch key Actual
results: Caps key is ignored in the selection window.



P.S. Same goes for 'Switch to previous input source' and Shift-Caps
key combination.




Bug Workarounds



The bug is currently on the "Wishlist". These workarounds are proposed:



Workaround 1



Found a workaround for this bug:



  1. Install dconf-editor (sudo apt-get install dconf-editor)

  2. Go to /org/gnome/desktop/wm/keybindings/

  3. Select key switch-input-source, turn off "Use default value" and set "Custom value" to ['Caps_Lock']

  4. (Optional) You can also change value for switch-input-source-backward to something like ['Caps_Lock'] (again, turning off "Use default value")

Workaround 2



Another way to do this:
1. Install GNOME Tweaks (gnome-tweak-tool)
2. Open the Tweaks app
3. Switch to the Keyboard & Mouse panel
4. Click Additional Layout Options
5. Use the "Switching to another layout" section



Subscribe to bug report



I would recommend subscribing to the bug report and adding your own experiences. The more people subscribing to the bug report, the faster the solution comes (usually).






share|improve this answer























  • Workaround 1 doesn't suit my requirements, it gives cyclic switching, which is not what I want. Workaround 2 (Gnome-Tweaks) has been tried and beaten to death; I can make it crash, but can't make it work. Thanks for (yet another) link though.

    – ulidtko
    Mar 14 at 12:00











  • I upvoted your question to hopefully draw more attention. Posting all your trials and errors on the bug report might be helpful.

    – WinEunuuchs2Unix
    Mar 14 at 12:26















5





+150









There is a bug report you can subscribe to:



  • keyboard panel does not allow to set up Caps as input switch

The bug report reads:




Keyboard panel has options for input switching, but it does not allow
to use Caps as language switch.



Steps to reproduce:



  1. gnome-control-center keyboard

  2. Scroll down to 'Typing' section

  3. Click on Switch to next input source

  4. Press Caps

Expected result: Caps Lock key is accepted as switch key Actual
results: Caps key is ignored in the selection window.



P.S. Same goes for 'Switch to previous input source' and Shift-Caps
key combination.




Bug Workarounds



The bug is currently on the "Wishlist". These workarounds are proposed:



Workaround 1



Found a workaround for this bug:



  1. Install dconf-editor (sudo apt-get install dconf-editor)

  2. Go to /org/gnome/desktop/wm/keybindings/

  3. Select key switch-input-source, turn off "Use default value" and set "Custom value" to ['Caps_Lock']

  4. (Optional) You can also change value for switch-input-source-backward to something like ['Caps_Lock'] (again, turning off "Use default value")

Workaround 2



Another way to do this:
1. Install GNOME Tweaks (gnome-tweak-tool)
2. Open the Tweaks app
3. Switch to the Keyboard & Mouse panel
4. Click Additional Layout Options
5. Use the "Switching to another layout" section



Subscribe to bug report



I would recommend subscribing to the bug report and adding your own experiences. The more people subscribing to the bug report, the faster the solution comes (usually).






share|improve this answer























  • Workaround 1 doesn't suit my requirements, it gives cyclic switching, which is not what I want. Workaround 2 (Gnome-Tweaks) has been tried and beaten to death; I can make it crash, but can't make it work. Thanks for (yet another) link though.

    – ulidtko
    Mar 14 at 12:00











  • I upvoted your question to hopefully draw more attention. Posting all your trials and errors on the bug report might be helpful.

    – WinEunuuchs2Unix
    Mar 14 at 12:26













5





+150







5





+150



5




+150





There is a bug report you can subscribe to:



  • keyboard panel does not allow to set up Caps as input switch

The bug report reads:




Keyboard panel has options for input switching, but it does not allow
to use Caps as language switch.



Steps to reproduce:



  1. gnome-control-center keyboard

  2. Scroll down to 'Typing' section

  3. Click on Switch to next input source

  4. Press Caps

Expected result: Caps Lock key is accepted as switch key Actual
results: Caps key is ignored in the selection window.



P.S. Same goes for 'Switch to previous input source' and Shift-Caps
key combination.




Bug Workarounds



The bug is currently on the "Wishlist". These workarounds are proposed:



Workaround 1



Found a workaround for this bug:



  1. Install dconf-editor (sudo apt-get install dconf-editor)

  2. Go to /org/gnome/desktop/wm/keybindings/

  3. Select key switch-input-source, turn off "Use default value" and set "Custom value" to ['Caps_Lock']

  4. (Optional) You can also change value for switch-input-source-backward to something like ['Caps_Lock'] (again, turning off "Use default value")

Workaround 2



Another way to do this:
1. Install GNOME Tweaks (gnome-tweak-tool)
2. Open the Tweaks app
3. Switch to the Keyboard & Mouse panel
4. Click Additional Layout Options
5. Use the "Switching to another layout" section



Subscribe to bug report



I would recommend subscribing to the bug report and adding your own experiences. The more people subscribing to the bug report, the faster the solution comes (usually).






share|improve this answer













There is a bug report you can subscribe to:



  • keyboard panel does not allow to set up Caps as input switch

The bug report reads:




Keyboard panel has options for input switching, but it does not allow
to use Caps as language switch.



Steps to reproduce:



  1. gnome-control-center keyboard

  2. Scroll down to 'Typing' section

  3. Click on Switch to next input source

  4. Press Caps

Expected result: Caps Lock key is accepted as switch key Actual
results: Caps key is ignored in the selection window.



P.S. Same goes for 'Switch to previous input source' and Shift-Caps
key combination.




Bug Workarounds



The bug is currently on the "Wishlist". These workarounds are proposed:



Workaround 1



Found a workaround for this bug:



  1. Install dconf-editor (sudo apt-get install dconf-editor)

  2. Go to /org/gnome/desktop/wm/keybindings/

  3. Select key switch-input-source, turn off "Use default value" and set "Custom value" to ['Caps_Lock']

  4. (Optional) You can also change value for switch-input-source-backward to something like ['Caps_Lock'] (again, turning off "Use default value")

Workaround 2



Another way to do this:
1. Install GNOME Tweaks (gnome-tweak-tool)
2. Open the Tweaks app
3. Switch to the Keyboard & Mouse panel
4. Click Additional Layout Options
5. Use the "Switching to another layout" section



Subscribe to bug report



I would recommend subscribing to the bug report and adding your own experiences. The more people subscribing to the bug report, the faster the solution comes (usually).







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 14 at 11:00









WinEunuuchs2UnixWinEunuuchs2Unix

50.7k13100197




50.7k13100197












  • Workaround 1 doesn't suit my requirements, it gives cyclic switching, which is not what I want. Workaround 2 (Gnome-Tweaks) has been tried and beaten to death; I can make it crash, but can't make it work. Thanks for (yet another) link though.

    – ulidtko
    Mar 14 at 12:00











  • I upvoted your question to hopefully draw more attention. Posting all your trials and errors on the bug report might be helpful.

    – WinEunuuchs2Unix
    Mar 14 at 12:26

















  • Workaround 1 doesn't suit my requirements, it gives cyclic switching, which is not what I want. Workaround 2 (Gnome-Tweaks) has been tried and beaten to death; I can make it crash, but can't make it work. Thanks for (yet another) link though.

    – ulidtko
    Mar 14 at 12:00











  • I upvoted your question to hopefully draw more attention. Posting all your trials and errors on the bug report might be helpful.

    – WinEunuuchs2Unix
    Mar 14 at 12:26
















Workaround 1 doesn't suit my requirements, it gives cyclic switching, which is not what I want. Workaround 2 (Gnome-Tweaks) has been tried and beaten to death; I can make it crash, but can't make it work. Thanks for (yet another) link though.

– ulidtko
Mar 14 at 12:00





Workaround 1 doesn't suit my requirements, it gives cyclic switching, which is not what I want. Workaround 2 (Gnome-Tweaks) has been tried and beaten to death; I can make it crash, but can't make it work. Thanks for (yet another) link though.

– ulidtko
Mar 14 at 12:00













I upvoted your question to hopefully draw more attention. Posting all your trials and errors on the bug report might be helpful.

– WinEunuuchs2Unix
Mar 14 at 12:26





I upvoted your question to hopefully draw more attention. Posting all your trials and errors on the bug report might be helpful.

– WinEunuuchs2Unix
Mar 14 at 12:26

















draft saved

draft discarded
















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1123163%2fmodeless-stateless-layout-language-switching-with-caps-lock-again-18-04-lts-bi%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?