Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmodmap with inputs #4250

Closed
hum6ug opened this issue Jun 12, 2019 · 4 comments
Closed

xmodmap with inputs #4250

hum6ug opened this issue Jun 12, 2019 · 4 comments

Comments

@hum6ug
Copy link

@hum6ug hum6ug commented Jun 12, 2019

  • Sway Version: sway version 1.1-rc1-38-g3f77591b (Jun 11 2019, branch 'master')

I was using a script in i3 to set my us key layout to use German "umlaut" (ä, ö, ü and ß).

setxkbmap -layout us -variant altgr-intl -option caps:none
xmodmap -e 'keycode  66 = Mode_switch'
xmodmap -e 'keycode  26 = e E EuroSign cent'
xmodmap -e 'keycode  30 = u U udiaeresis Udiaeresis'
xmodmap -e 'keycode  32 = o O odiaeresis Odiaeresis'
xmodmap -e 'keycode  38 = a A adiaeresis Adiaeresis'
xmodmap -e 'keycode  39 = s S ssharp'

Is it possible to do this with inputs?

@RedSoxFan

This comment has been minimized.

Copy link
Member

@RedSoxFan RedSoxFan commented Jun 19, 2019

You'll have to use a custom layout.

Save the following to $HOME/.xkb/symbols/us-german-umlaut

default partial alphanumeric_keys
xkb_symbols "basic" {
	include "us(altgr-intl)"
	include "level3(caps_switch)"
	name[Group1] = "English (US, international with German umlaut)";
	key <AD03> { [ e, E, EuroSign, cent ] };
	key <AD07> { [ u, U, udiaeresis, Udiaeresis ] };
	key <AD09> { [ o, O, odiaeresis, Odiaeresis ] };
	key <AC01> { [ a, A, adiaeresis, Adiaeresis ] };
	key <AC02> { [ s, S, ssharp ] };
};

Then in your sway config, you can use input <identifier> xkb_layout us-german-umlaut. You can use swaymsg -t get_inputs to find the identifier for the keyboard. Alternatively, using * (wildcard for all devices) or type:keyboard (wildcard for all keyboards) in place of the identifier would also work

@RedSoxFan RedSoxFan closed this Jun 19, 2019
@hum6ug

This comment has been minimized.

Copy link
Author

@hum6ug hum6ug commented Jun 19, 2019

Thank you SO much! Works as expected

@rianhunter

This comment has been minimized.

Copy link

@rianhunter rianhunter commented Sep 3, 2019

@RedSoxFan Have a similar issue but it's not clear how to convert a set of xmodmap commands to a layout file. Could you provide some brief guidance or link to a guide on how to create these layout files?

edit: I was able to solve my issue (making the "PrtSc" key map to Win) by using:

input * xkb_options altwin:prtsc_win

In general you want to stay away from writing custom xkb files unless absolutely necessary. Take a look at /usr/share/X11/xkb/rules/evdev.lst to see if the customization you want exists as a xkb variant or option. More information here https://www.x.org/releases/current/doc/xorg-docs/input/XKB-Config.html

@tmccombs

This comment has been minimized.

Copy link
Contributor

@tmccombs tmccombs commented Feb 2, 2020

Could you provide some brief guidance or link to a guide on how to create these layout files?

Maybe put a link to some documentation on this in wiki and/or FAQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.