Customizing Input Switch for Cosmic Desktop

System76 released Cosmic Desktop beta which is an interesting project. I use Pop!_OS on my mini PC that I’m daily driving my research activities. I have a dual monitor setup that I cannot use with my Macbook Pro. I wanted to give Cosmic Desktop a try. I installed it on my mini PC and I was impressed UI but I eventually find out that I cannot use my usual keyboard shortcut to switch between languages. I always need to change between Arabic and English. I use Super + Space to switch between languages. The settings in cosmic desktop are not ready yet and many things are missing at the moment.

Cosmic Desktop, as polished as it is, doesn’t yet come with a built-in interface for input source switching. But here’s the good part: it’s built on the X Keyboard Extension (XKB) system, which means you can dive under the hood and set things up yourself. And I’m going to tell you how I use this tweak.

The key to unlocking input source switching lies in a specific XKB option: grp:win_space_toggle. This option maps the Super+Space (or Win+Space) key combination to toggle between keyboard layouts—something that’s incredibly handy if you frequently switch languages or input methods. While Cosmic Desktop doesn’t offer a graphical interface to manage this yet, you can enable it by modifying a configuration file. Here’s where it gets interesting:

The configuration file in question is:

~/.config/cosmic/com.system76.CosmicComp/v1/xkb_config

This is where Cosmic Desktop stores its keyboard layout settings. When I first found this file, it felt like I’d stumbled upon a hidden control panel for the keyboard. To enable the Super+Space shortcut, you need to tweak the options key within this file. By default, it’s set to None, which means no special keyboard options are enabled. Changing it is straightforward.

The original setting looked like this:

options: None,

We need to modify it to:

options: Some(",grp:win_space_toggle"),

This change tells XKB to use the Super+Space key combination for toggling input sources. Simple yet effective.

After saving the change, a logout and login are needed for the update to take effect. This ensures the system reloads the keyboard configuration with the new settings applied. Once you log back in, you can use Super+Space to switch between languages or input methods. It’s a small tweak, but it makes a big difference in daily use.

To verify that your modification is recognized, you can check available XKB options with this command:

cat /usr/share/X11/xkb/rules/base.lst | grep space

You should see grp:win_space_toggle in the list, confirming that it’s a valid option.

This workaround might only be temporary. As Cosmic Desktop evolves, native support for input source switching could/should be added, making manual edits like these unnecessary. But currently, if you’re running Cosmic Desktop and want an easy way to switch input sources, you will need to use this method.