You are not logged in.
So. Since my installation of arch ive been with troubles about keyboard layout, none loadkeys or setxkbmap had effect on my system, only before start the interface.
Here are the outputs of both setxkbmap -layout br-abnt2:
Error loading new keyboard descriptionand loadkeys br-abnt2 (on interface)
Couldn't get a file descriptor referring to the console.At first i didnt even thought about that cuz i installed Gnome, but now im using suckless, that dont have a settings app to set the layout to me.
Basically, searching on the internet i have read that it can be a error on systemd, and that i could create a script to set the layout on the system start. I dont know if this has really any sense, but im actually trying what i find.
So, going to the problem, i have this script i created as a service:
[Unit]
Description=ChangekeyboardLayout
[Service]
Type=oneshot
ExecStart=/usr/local/bin/idioma.sh
[Install]
WantedBy=multi-user.targetThe "idioma.sh" is just a "setxkbmap -layout br-abnt2".
Thanks.
Last edited by romm (2022-01-13 23:29:34)
Offline
The "idioma.sh" is just a "setxkbmap -layout br-abnt2".
Thanks.
Why don't you put that command into ExecStart directly then?
And are you sure that the service in question really has no dependencies?
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
im using suckless, that dont have a settings app to set the layout to me.
Add the command to your X startup script. For example use ~/.xinitrc if you're running 'startx' from a console login or ~/.xprofile if you're running a display manager.
To run it from a unit file see https://wiki.archlinux.org/title/Systemd/User and be sure to set DISPLAY & XAUTHORITY correctly.
But I think you should be using localectl(1) instead.
Jin, Jîyan, Azadî
Offline
You don't want/can't do that in a system service. You'd do it in a user service but there are a few gotchas if you start your X session with startx, at which point you could just put that command directly into your .xinitrc instead.
Offline
You don't want/can't do that in a system service. You'd do it in a user service but there are a few gotchas if you start your X session with startx, at which point you could just put that command directly into your .xinitrc instead.
I already did this before, but doesnt work.
Offline
romm wrote:The "idioma.sh" is just a "setxkbmap -layout br-abnt2".
Thanks.And are you sure that the service in question really has no dependencies?
If you mean setxkbmap, it looks like the main command to change the layout permanently, based on what i searched. Maybe i didnt understand what you are saying.
Offline
"Doesn't work" isn't an error description.
How do you determine that is doesn't work and what did the attempted xinitrc look like and do you use startx to begin with (because most DMs won't use that for your session at all)
Also see https://dwm.suckless.org/patches/autostart/ and last but not least if you're the only user on that system and always want that layout: https://wiki.archlinux.org/title/Xorg/K … tion_files
Edit: also just in case, your findings with gnome will not apply to DWM. Gnome steamrolls over every previous config while DWM won't.
Last edited by seth (2022-01-12 20:29:38)
Offline
"Doesn't work" isn't an error description.
How do you determine that is doesn't work and what did the attempted xinitrc look like and do you use startx to begin with (because most DMs won't use that for your session at all)Also see https://dwm.suckless.org/patches/autostart/ and last but not least if you're the only user on that system and always want that layout: https://wiki.archlinux.org/title/Xorg/K … tion_files
Edit: also just in case, your findings with gnome will not apply to DWM. Gnome steamrolls over every previous config while DWM won't.
Oh, sorry. I forgot to mention that both loadkeys and setxkbmap output the errors i showed even without interface, when without sudo. setxkbmap with sudo too, loadkeys simply doesn't have output despite this is my output of localectl status:
[romrom@archrom ~]$ localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: br-abnt2
X11 Layout: n/aEven my layout in practice being en-us.
Last edited by romm (2022-01-12 20:45:35)
Offline
loadkeys operates the linux console, setxkbmap the X11 session. Don't use sudo for the latter.
Don't just use sudo when things don't work your way in general, you're just causing more trouble.
As for setxkbmap, you'll have to apply that for a running X11 server, you cannot use that on the console.
Also see the wiki link I posted.
Edit: and that somehow didn't touch on V1del's xinitrc suggestion at all.
Last edited by seth (2022-01-12 20:50:46)
Offline
loadkeys operates the linux console, setxkbmap the X11 session. Don't use sudo for the latter.
Don't just use sudo when things don't work your way in general, you're just causing more trouble.As for setxkbmap, you'll have to apply that for a running X11 server, you cannot use that on the console.
Also see the wiki link I posted.Edit: and that somehow didn't touch on V1del's xinitrc suggestion at all.
So. I may haven't read the error that showed on the start of x before when i tested putting setxkbmap on .xinitrc, but today i did it and noticed that X was not finding my layout. Apparently, the problem was me using the name of the layout i used on console (br-abnt2) to put on X session (just "br"). After i saw the layout list of X, i got it. Systemd had nothing to do with it.
Thank you, guys.
Last edited by romm (2022-01-13 23:31:00)
Offline