pop-os / cosmic-settings

COSMIC Settings
GNU General Public License v3.0
165 stars 107 forks source link

[FR] Add settings to remap/adjust keyboard keys #383

Open MikhailTNY opened 4 months ago

MikhailTNY commented 4 months ago

Not sure if this is permitted but here's a screenshot of Gnome Tweaks, which I used on PopOS to remap certain keys on my keyboard to match my preferences. It would be awesome if this can be either integrated or available via terminal on Cosmic DE.

image

Use case: It's easier for me to use common shortcuts, control +e/s/f etc with my thumb instead of my weaker pinky and avoiding the need to move my wrist.

Alexis-Lapierre commented 3 months ago

Theses settings looks like they are already supported by the underlying settings deamon, but it currently require to edit the config file manually.

The relevant config file is situated on your system at ~/.config/cosmic/com.system76.CosmicComp/v1/xkb_config

In my use case I use:

(
    rules: "",
    model: "",
    layout: "us",
    variant: "",
    options: Some("caps:swapescape"),
    repeat_delay: 350,
    repeat_rate: 35,
)

For yours it should be: options: Some("ctrl:swap_lalt_lctl_lwin") instead of my caps:swapescape.

(You can find more available options on the /usr/share/X11/xkb/rules/base.lst file, under the option section)

Alexis-Lapierre commented 3 months ago

So the only missing feature is being able to set this up from the GUI settings app, which is easier than implementing everything from scratch.

nilesjohnson commented 2 months ago

I was looking for key remap and also key repeat settings; looks like they're both here. Add my vote for GUI access to these.

shoenig commented 2 months ago

Just noting for anyone like me looking for how to configure Caps Lock as a Ctrl key:

cat ~/.config/cosmic/com.system76.CosmicComp/v1/xkb_config
(
    rules: "",
    model: "",
    layout: "us",
    variant: "",
    options: Some("ctrl:nocaps"),
    repeat_delay: 600,
    repeat_rate: 25,
)
heydoyouknowme0 commented 1 month ago

I wanted to know if it's possible to remap a combination of keys to a single key. This would be really useful for my 60% keyboard. It's not a huge requirement, as there are alternatives, but it would be a nice feature to have.

petrem commented 1 month ago

The various available settings can be found in the xkeyboard-config(7) man page, in the OPTIONS section. Multiple options can be added as comma-separated strings, e.g. options: Some("caps:ctrl_modifier,shift:both_capslock,terminate:ctrl_alt_bksp").