Comments (14)
@DreymaR: I think that -rules evdev should suffice
well thats what I though initally but look at the strace --trace=file setxkbmap ...
when calling it in the repos root dir.
-rules evdev
for some reason it expects rules/
to be in the current dir. In the end it finds it in /usr/share/X11/xkb/rules/
openat(AT_FDCWD, "./rules/evdev-C.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "./rules/evdev.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev-C.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev.lst", O_RDONLY) = 4
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=44667, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev-C", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev", O_RDONLY) = 4
that might not be an issue when actually being inside of xkb-data_xmod/xkb/
where rules/
resides - haven't testet that.
EDIT: which is exactly what happens in #14 (cd into the xkb/
dir first)
vs.
-rules $PWD/xkb-data_xmod/xkb/rules/evdev
from the getgo looks and finds them in ./xkb-data_xmod/xkb/rules/
openat(AT_FDCWD, "/home/birdspider/repos/BigBagKbdTrixXKB/xkb-data_xmod/xkb/rules/evdev-C.lst",O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/birdspider/repos/BigBagKbdTrixXKB/xkb-data_xmod/xkb/rules/evdev.lst", O_RDONLY) = 4
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=47351, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/home/birdspider/repos/BigBagKbdTrixXKB/xkb-data_xmod/xkb/rules/evdev-C", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/birdspider/repos/BigBagKbdTrixXKB/xkb-data_xmod/xkb/rules/evdev", O_RDONLY) = 4
also the order of -I
and -rules
does not seem to matter for setxkbmap
double -I for xkbcomp
It works fine with -I$MYXKB
, I was simply testing/debugging it with only -I$MYXKB
be means of -I -I$MYXKB
but it needs the systems /usr/share/X11/xkb/types/complete
or else:
Can't find file "complete" for types include
@DreymaR: But it shouldn't be strictly necessary since I haven't overridden any system rules
it's not necessary, I do not have any complains - everything works as good as it can under the limits of setxkbmap
and xkbcomp
I just wanted to report my findings.
-model
As an aside, sadly setxkbmap
only takes ONE model[keycodes], so switching per xkb's grp:ctrls_toggle
between evdev[evdev+alias(querty)]
and pc104wide-qu[pc104wide-qu]
- which was my initial plan - remains a no-go
from bigbagkbdtrixxkb.
Hi! The setxkbmap command can take a path to an xkb directory; my setxkb.sh script does this simply by running setxkbmap from the specified directory (which can be set by the '-d {path}' switch). But don't use the provided xkb files alone as they aren't a complete xkb directory! You should install to your preferred local path first using my install script with the '-i {path}' switch. Make sure you have write privileges in the target path. And follow the instructions closely – both my scripts use bash for instance.
Is that helpful?
from bigbagkbdtrixxkb.
Hi!
Will running setxkbmap
from a directory with xkb files use the directory contents? in general, do you know how setxkbmap
searches configuration files?
The reason I want to use a local xkb dir is that I have a git repo with all my configuration files (vimrc etc), and this repo is used in a few machines. I want to add the xkb config to this repo. Using local files is much easier for managing it because then when updating a machine I can just git pull
the changes without the need to write to system files.
BTW, yesterday I installed these files to two of my machines and it works great! Thanks a lot for this awesome work. Up until now I implemented something similar using xbindkeys
, but using xkb
has many advantages over xbindkeys.
from bigbagkbdtrixxkb.
Also, it would be great if I could chat with you about a few things:
- I'm considering moving to Colemak
- I don't know how to implement some of the stuff I have in
xbindkeys
usingxkb
and wanted to verify whether it can be done with someone who knowsxkb
config better than me
If you're cool with that then let me know what's the best way to contact you. Sorry for doing this conversation in a github issue but there's no private messaging in github.
from bigbagkbdtrixxkb.
Hi! Come to Colemak, we have... ummm, not cookies but an awesome layout!
:-) I use WideAngle Colemak-DH, mind you, which is a set of minor tweaks.
Have you read my Big Bag of Tricks topic at the Colemak forum yet?
If I reply to this email, you'll be able to reply back directly I hope. [nope!]
The setxkbmap will look for a workable set of xkb files in the current directory and failing that, in the default system X11 path. So changing to a (complete) xkb directory and running setxkbmap does the trick.
best,
Øystein "DreymaR"
On Dec 28, 2015 12:49 PM, "infokiller" [email protected] wrote:
Also, it would be great if I could chat with you about a few things:
- I'm considering moving to Colemak
- I don't know how to implement some of the stuff I have in xbindkeys
using xkb and wanted to verify whether it can be done with someone who
knows xkb config better than meIf you're cool with that then let me know what's the best way to contact
you. Sorry for doing this conversation in a github issue but there's no
private messaging in github.—
Reply to this email directly or view it on GitHub
#1 (comment)
.
from bigbagkbdtrixxkb.
Yes, that's how I found this repo, awesome work
I can't reply directly... a privacy feature I guess :)
Anyway, I can send you a message in the Colemak forum, does that work for you?
from bigbagkbdtrixxkb.
Of course, anytime!
I'm still a bit new to the GitHub thing, and never seem to find the time to
learn it properly... yet.
Ø
On Dec 28, 2015 4:03 PM, "infokiller" [email protected] wrote:
Yes, that's how I found this repo, awesome work [image:
👍 ]
I can't reply directly... a privacy feature I guess :)
Anyway, I can send you a message in the Colemak forum, does that work for
you?—
Reply to this email directly or view it on GitHub
#1 (comment)
.
from bigbagkbdtrixxkb.
Thanks a lot Øystein!
I sent an email to your Colemak forum user, I hope it arrives!
from bigbagkbdtrixxkb.
So, at the moment it seems that setxkbmap does NOT handle local files? The default is then to use the system (X11 dir) install. Sorry about that.
from bigbagkbdtrixxkb.
I was able to accomplish this with this post: https://unix.stackexchange.com/questions/397716/custom-keyboard-layout-without-root
made that tweak to setxkb and some small changes to use a hardcoded $HOME dir path, and it appears good
from bigbagkbdtrixxkb.
I was able to make it work locally (in my case right out of the git clone) except I couldn't get the Extend
to work on caps or any other key
# in the repo, PWD=the repo root dir
setxkbmap -I"$PWD/xkb-data_xmod/xkb" \
-model 'pc104wide-qu' \
-keycodes 'evdev(pc104wide-qu)' \
-layout us \
-variant cmk_ed_us \
-option misc:extend,lv5:caps_switch_lock \
-print | xkbcomp -I"$PWD/xkb-data_xmod/xkb" - "$DISPLAY"
everything seemed to work, even wide mode, except Extend
which would behave as normal CapsLock.
any idea why that would be? or what to do to enable the Extend
functionality ?
PS:
I also discovered that xkbcomp -I -I"$PWD/xkb-data_xmod/xkb"
(double -I
, checked with strace
, see man xkbcomp
) would force xkbcomp
to exclusively look in the specified dir (that is - ignoring system dirs).
Which in turn could not load some files (symbols/complete
if I remember correctly). May be useful for some usecase.
from bigbagkbdtrixxkb.
@birdspider I don't have a solution for you, but in case it's useful for anyone, what I'm doing for some time now is running xkbcomp keymap.xkb "$DISPLAY"
where keymap.xkb
is the full keymap (self contained, no includes) which I track in a git repo. I find this easier than using xkbcomp
with includes.
from bigbagkbdtrixxkb.
I don't have a solution for you,...
but I have :) - somewhat
Solution
full local loading script (beware that xkbcomp
and setxkbmap
handle their respective -I
different, setxkbmap
is fine with spaces after -I
, xkbcomp
is not), (tee /dev/tty
additionaly just also prints out the piped xkb_keymap
)
#!/usr/bin/env sh
# in the repo, PWD=the repo root dir
XKB_ROOT=./xkb-data_xmod/xkb/
XKB_RULES=`pwd`/xkb-data_xmod/xkb/rules/evdev
setxkbmap \
-rules "${XKB_RULES}" \
-I "${XKB_ROOT}" \
-model 'pc104wide-qu' \
-keycodes 'evdev(pc104wide-qu)' \
-layout 'us' \
-variant 'cmk_ed_us' \
-option 'misc:extend,lv5:caps_switch_lock' \
-print | tee /dev/tty | xkbcomp -I"${XKB_ROOT}" - "$DISPLAY"
Analysis
it seems that setxkbmap ... -option misc:extend,lv5:caps_switch_lock
does not produce the correct xkb symbols, instead I get:
xkb_keymap {
xkb_keycodes { include "evdev(pc104wide-qu)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us(cmk_ed_us)+inet(evdev)"};
xkb_geometry { include "pc(pc104)" };
};
If I manually add +level5(caps_switch_lock)+extend(basic)
to xkb_symbols
like so:
xkb_keymap {
xkb_keycodes { include "evdev(pc104wide-qu)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us(cmk_ed_us)+level5(caps_switch_lock)+extend(basic)+inet(evdev)"};
xkb_geometry { include "pc(pc104)" };
};
At least Extend/Pg{Up,Down}
seems to work
After strace-ing setxkbd
, I finally suceeded by excplicitly telling it where the rules are, otherwise it would use the sys-evdev rules, which lack the options.
setxkbmap \
-rules $PWD/xkb-data_xmod/xkb/rules/evdev \
-I "./xkb-data_xmod/xkb/" \
-model 'pc104wide-qu' \
-keycodes 'evdev(pc104wide-qu)' \
-layout 'us' -variant 'cmk_ed_us' \
-option 'misc:extend,lv5:caps_switch_lock' \
-print
#got me
xkb_keymap {
xkb_keycodes { include "evdev(pc104wide-qu)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us(cmk_ed_us)+inet(evdev)+level5(caps_switch_lock)+extend(basic)" };
xkb_geometry { include "pc(pc104wide-qu)" };
};
#which in turn actually loads fine with `xkbcomp`
from bigbagkbdtrixxkb.
Interesting! Also see #14 for a way that looks cleaner to me. I think that -rules evdev
should suffice if you have the right dirs set? The initial problem with your option line should indeed be that setxkbmap doesn't find the local rules.
I'd think the idea of feeding xkbcomp the sequence -I -I$MYXKB -I/usr/share/X11/xkb
is to ensure that it reads first my/your XKB dir and then the system's? But it shouldn't be strictly necessary since I haven't overriden any system rules, just added new ones.
from bigbagkbdtrixxkb.
Related Issues (20)
- 6 and = flipped in ISO wide HOT 2
- XF86ScrollRight causes X11 to crash HOT 1
- Copy,Cut,Paste on Extend HOT 4
- Ext + Q not registering as Escape HOT 6
- Option to change original XKB files location HOT 4
- Changing the arrangement in geometry/pc does has no effect. HOT 1
- Suggestion: Left Alt as Extend HOT 2
- Applications seeing a mix of symbols through the extend layer, and of the original keypress, triggering unwanted keybindings HOT 3
- equal symbol is not working HOT 3
- install script restore appears not to work HOT 3
- setxkb.sh disables most F1 - F12 keys in all apps, but any modifier(s) + (F1 - F12) keys are working fine HOT 3
- Problems with Super+letter shortcuts HOT 4
- Help Image in Linux HOT 1
- DH mod for Portuguese (Brazil) Layout HOT 4
- How to Restore to Original Layout? HOT 7
- Ok for me to manually Implement Angle Mod? HOT 1
- Problems with multi-key mappings HOT 11
- Suggestion: use klfc HOT 1
- Linux D and V key appear to be in the wrong spot (Mod-DH) HOT 15
- Experience with Synergy by Symless?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigbagkbdtrixxkb.