sinadarvi / windows-persian-keyboard-for-linux

Customize Linux Persian keyboard layout to be like windows layout
MIT License
124 stars 20 forks source link

Semi-Space #24

Closed radiumatic closed 7 months ago

radiumatic commented 7 months ago

Hi, For some reason, the Shift + Space combination doesn't insert a semi-space character, nor does Ctrl + Shift + 2. I doubt this is intentional.

Thanks for this project.

MasterKia commented 7 months ago

Works fine here.

radiumatic commented 7 months ago

Yeah, turns out there are two versions of the same layout in my system. I guess one of them comes with xkb package. (Fedora 39) I'll close this issue, but if you know what's going on, please share. @MasterKia

cs127 commented 7 months ago

Yeah, turns out there are two versions of the same layout in my system. I guess one of them comes with xkb package. (Fedora 39) I'll close this issue, but if you know what's going on, please share. @MasterKia

I PR'd the layout to xkb and it was added to xkb about a year ago. the one that ships with xkb has the ZWNJ/semispace on AltGr (right alt) + Shift + 2.

this repo is out of date, and also seems to be unmaintained.

I would recommend replacing your current copies of /usr/share/X11/xkb/symbols/ir and /usr/share/X11/xkb/rules/evdev.xml with ones from a clean install, so that the outdated layout from this repo gets removed, and only the one from xkb remains.

MasterKia commented 7 months ago

with ones from a clean install

Could you share them?

cs127 commented 7 months ago

Could you share them?

here you go!

put evdev.xml in /usr/share/X11/xkb/rules and ir in /usr/share/X11/xkb/symbols

these are from xkeyboard-config version 2.40 (which is currently the latest as I'm writing this). just to be safe, make sure that you are also using version 2.40 before using these.

radiumatic commented 7 months ago

Yeah, turns out there are two versions of the same layout in my system. I guess one of them comes with xkb package. (Fedora 39) I'll close this issue, but if you know what's going on, please share. @MasterKia

I PR'd the layout to xkb and it was added to xkb about a year ago. the one that ships with xkb has the ZWNJ/semispace on AltGr (right alt) + Shift + 2.

this repo is out of date, and also seems to be unmaintained.

I would recommend replacing your curremt copies of /usr/share/X11/xkb/symbols/ir and /usr/share/X11/xkb/rules/evdev.xml with ones from a clean install, so that the outdated layout from this repo gets removed, and only the one from xkb remains.

Thanks, but I'm really used to the Shift + Space combination. Is there a way to change AltGr + Shift + 2 to Shift + Space?

cs127 commented 7 months ago

Thanks, but I'm really used to the Shift + Space combination. Is there a way to change AltGr + Shift + 2 to Shift + Space?

you can manually edit the /usr/share/X11/xkb/symbols/ir file at the bottom of the xkb_symbols "winkeys" layout (around line 170 in the current version), add this line before the closing curly bracket:

    key <SPCE> { [ space, U200C ] };

so at the end you have something like this:

    include "level3(ralt_switch)"
    key <SPCE> { [ space, U200C ] };
};

and reboot (I'm not sure if rebooting is required but whatever)

this will add the ZWNJ to the second level of the space key (i.e. when you're holding shift)

if at any point you update xkeyboard-config and it modifies the file (you would know if shift+space stopped working), just edit the file and add the line again.

radiumatic commented 7 months ago

How can I move all common characters (like @) from the AltGr bindings to Shift + {key}? @cs127

cs127 commented 7 months ago

How can I move all common characters (like @) from the AltGr bindings to Shift + {key}? @cs127

if you're talking about the windows layout, @ is already on shift+2, what do you mean?

radiumatic commented 6 months ago

I think I finally know what's going on, if I have to take a guess, this is added in the new versions of xkb not yet reached Ubuntu 22.04 LTS. @MasterKia @cs127

All layouts added to /usr/share/X11/xkb/rules/*.conf, must also be added to the file /usr/share/X11/xkb/rules/base.lst.

I've also found a few not-so-pleasant-to-search-for tricks to force the the font Vazir on all Arabic glyphs across all apps. (The default Fedora font is awful) Would it be useful to write a few scripts to automatically apply these kind of things? Like awesome-persian-linux or somesuch.