Git Product home page Git Product logo

Comments (9)

cyrinux avatar cyrinux commented on September 18, 2024

a basic example to fix your problem is this

~/.config/xkb/symbols/fr-remap

default partial alphanumeric_keys modifier_keys

xkb_symbols "basic" {
    include "fr"
    replace key <TLDE>  { [ at, numbersign, asciitilde, notsign ] };
    replace key <AC09>  { [ l, L, notsign, bar ] };
};

then in sway config for example load like this

...
input type:keyboard {
    xkb_layout fr-remap
    xkb_variant basic
    xkb_numlock enable
}
...

To continue the remapping explore /usr/share/X11/xkb/symbols/fr then use replace key.
Feel free to share your result, i'm doing this right now too on a french azerty layout on a m2 air.

  • I also swap some key with this hid_apple setup

/etc/modprobe.d/hid_apple.conf

options hid_apple swap_opt_cmd=1 swap_fn_leftctrl=1 iso_layout=1
  • A complete version of my actual remapping is here:
default partial alphanumeric_keys modifier_keys

xkb_symbols "basic" {
    include "fr"
    replace key <CAPS> { [ Hyper_L ] };
    replace key <LWIN> { [ Super_L ] };
    modifier_map Mod4 { <META>, Hyper_L };
    modifier_map Mod3 { <META>, Super_L };
    replace key <TLDE>  { [ at, numbersign, asciitilde, notsign ] };
    replace key <AE08>  { [ exclam, 8, backslash, exclamdown ] };
    replace key <AE06>  { [ minus, 6, trademark, notsign  ] };
    replace key <AE12>  { [ minus, underscore, braceright, bar ] };
    replace key <AB10>  { [ equal, plus, notsign, notsign ] };
    replace key <AD12>  { [ dollar, asterisk, EuroSign, notsign ] };
    replace key <BKSL>  { [ asterisk, grave, grave, notsign ] };
    replace key <AC09>  { [ l, L, notsign, bar ] };
};

from linux.

lou-perret avatar lou-perret commented on September 18, 2024

Seems better, but I cannot swap the left CTRL & CMD to do copy / paste with CMD. Does it work for you ?

from linux.

cyrinux avatar cyrinux commented on September 18, 2024

What DE do you use ? Can be then simply shortcut parameters in KDE shortcuts settings or your sway config for example ? Also install and use wev in order to get information about the key you press.

from linux.

nsklaus avatar nsklaus commented on September 18, 2024

Seems better, but I cannot swap the left CTRL & CMD to do copy / paste with CMD. Does it work for you ?

here's what i usualy do: (tested on a few intel macbooks, but keyboard mapping is the same on m1 too, so it should work here as well)

sudo vim /usr/share/X11/xkb/symbols/pc
replace like this: (note that LCTL points to Super_L and so on)

key <LCTL> {    [ Super_L       ]   };
key <LWIN> {    [ Control_L     ]   };
 
key <RCTL> {    [ Super_R       ]   };
key <RWIN> {    [ Control_R     ]   };

then to apply changes, you can either reboot, or log out/in or in term:

setxkbmap -layout fr -variant mac

after that change gets applied, copy/paste will work with cmd+c and cmd+v globaly.
note: that you will also need to change default hotkeys for copy/paste in terminal, for example in konsole. because default is usualy ctrl+shift+c / ctrl+shift+v .. remap it to remove the need for shift. when changing the hotkey pressing cmd+c keys, it will be taken in as ctrl+c.

also interesting to note:
there are a few distros that have a broken french macbook keymap file.
void, artix, and some other have a broken one. iirc there's a good one on fedora.
see arch forum here
fabienh is mentionning the ticket on core kbd package.
worst case scenario pickup the correct keymap on fedora and put it in your asahi/arch install.

from linux.

ToCodeABluejay avatar ToCodeABluejay commented on September 18, 2024

I have found that none of tha available fr/azerty layouts are accurate. The 'mac-fr' layout is so completely unusable as, for instance, a character is mapped to the return key. I have found that, while it is still not perfect, that the 'fr-latin9" seems to be good enough to be usable. While the 'mac-fr' layout does not work for modern Macs, it's certainly possible that people may use then on legacy machines? It would be nice if we could relegate the antiquated layout to 'mac-fr-legacy' or something of that sort. However, for our purposes in the here in now, we need an accurate keyboard layout available to Mac users with a French layout. To accomodate this, I thought it may work nice to simply copy the existing fr-lating9.map file into a repository, and edit it as necessary until our configuration is accurate. I have already made a few changes, but feel free to try it and edit it yourself!! https://github.com/ToCodeABluejay/kbd-mac-fr

from linux.

ToCodeABluejay avatar ToCodeABluejay commented on September 18, 2024

I just created a pull request to kbd...
legionus/kbd#93

from linux.

ToCodeABluejay avatar ToCodeABluejay commented on September 18, 2024

legionus/kbd#98

from linux.

ToCodeABluejay avatar ToCodeABluejay commented on September 18, 2024

Merged. I may make some more minor revisions in the future to more closely mimic mac OS, but this is certainly able to be used comfortably day-to-day...

from linux.

nsklaus avatar nsklaus commented on September 18, 2024

@ToCodeABluejay
i noticed several problems remaining on current "mac-fr" keymap.
i referenced them here: #268
would there be a chance for more revision from you, since you've already improved the situation from initial mac-fr keymap and your PR was accepted on mainstream kbd..

from linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.