Open AshleyYakeley opened 7 months ago
Looks like @rycee last touched this part of the code.
I can see a user service
cat .config/systemd/user/setxkbmap.service
[Install]
WantedBy=graphical-session.target
[Service]
ExecStart=/nix/store/hy9plgqdghxbx6wsn1wa2ivk17qkxkim-setxkbmap-1.3.4/bin/setxkbmap -layout 'us' -variant 'dvorak' -option '' -option 'ctrl:nocaps'
RemainAfterExit=true
Type=oneshot
[Unit]
After=graphical-session-pre.target
Description=Set up keyboard in X
PartOf=graphical-session.target
I can manually enable it
sudo systemctl enable ~/.config/systemd/user/setxkbmap.service
but it fails to run
sudo journalctl -u setxkbmap
Jan 06 21:06:18 stuartwarren-MacBookPro systemd[1]: Starting Set up keyboard in X...
Jan 06 21:06:18 stuartwarren-MacBookPro setxkbmap[34826]: Cannot open display "default display"
Jan 06 21:06:18 stuartwarren-MacBookPro systemd[1]: setxkbmap.service: Main process exited, code=exited, status=1/FAILURE
Jan 06 21:06:18 stuartwarren-MacBookPro systemd[1]: setxkbmap.service: Failed with result 'exit-code'.
Jan 06 21:06:18 stuartwarren-MacBookPro systemd[1]: Failed to start Set up keyboard in X.
Interesting. I can't even see a user service.
$ cat .config/systemd/user/setxkbmap.service
cat: .config/systemd/user/setxkbmap.service: No such file or directory
think you might need:
xsession = {
enable = true;
};
and then somehow load the ~/.xsession
to make it work, though I configure i3 using home-manager https://nix-community.github.io/home-manager/options.xhtml#opt-xsession.windowManager.i3.enable and had to create a /usr/share/xsession/xsession.desktop
file
[Desktop Entry]
Name=XSession
Comment=This session uses the custom xsession file
Exec=/etc/X11/Xsession
Type=Application
So it does kind of work if you do all that and manually enable the user systemd units
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.
* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.
Are you following the right branch?
Is there an existing issue for this?
Issue description
I have this in my Home Manager config, to disable the caps lock key:
However, it doesn't work. Apparently HM is supposed to create a oneshot user-level systemd unit called
setxkbmap
to make the call, but I'm not seeing that insystemctl --user list-units
or insystemctl --user list-unit-files
.If I call
setxkbmap -option caps:none
directly it correctly disables the caps lock key, but I want Home Manager to do it.Related: #3795, however, I am using MATE/Marco rather than Sway.
Maintainer CC
No response
System information