Closed pintassilgo closed 5 months ago
Hello, thanks for your report!
I've only tested it on a Debian KDE live USB with the following conditions and it works:
/usr/bin/
, but it shouldn't make any difference as long as the directory is in PATHsudo -E makima
::konsole.toml
at the end of the config fileThere are two things that I can think of:
kdotool getactivewindow getwindowclassname
work in your terminal? It should just print konsole
Thanks for your reply.
Does kdotool getactivewindow getwindowclassname work in your terminal? It should just print konsole
Yes. It prints org.kde.konsole
. It's not a Flatpak, it's from package manager. I use openSUSE Tumbleweed.
So I just tried again with Usb KeyBoard Usb KeyBoard::org.kde.konsole.toml
instead of Kate, but A is still a, not b as expected...
Are you running Makima as a systemd service?
Yes.
Also, just to make sure, can you post your systemd unit?
[Unit]
Description=Makima remapping daemon
[Service]
Type=simple
Restart=always
RestartSec=3
ExecStart=/home/user/pr/makima/makima
User=user
Group=input
Environment="MAKIMA_CONFIG=/home/user/pr/makima/"
[Install]
WantedBy=default.target
I use makima to remap some things, it works. It's just this new app-specific feature that isn't working.
Hello, I've done a couple of changes in v0.9.1 to correctly intercept stdout from kdotool and redirect stderr to null when running as a systemd service
I can't test if this works because in my Debian KDE live ISO I don't seem to be able to access uinput when running Makima as a systemd service (I should actually do some research on this one in case it affects other systems and not just that live ISO), but I'm pretty confident that active window retrieval should work now on Plasma
Let me know if this solves the issue, and again, thanks for the detailed info
Edit: tested it on Tumbleweed KDE and it works, let me know if it works on your end as well
Thanks! I confirm it's working now.
I suggest linking to kdotool
repo in docs to make easier for users to know where to download it.
And just adding, having kdotool
in ~/.local/bin
- which is in PATH - wasn't enough, it doesn't work. It only worked when I placed it in /usr/bin
. I guess this is because makima runs as root (remembering it starts from a systemd service), so... Maybe it's worth a word about that in docs too.
I suggest linking to kdotool repo in docs
Will do
makima runs as root
Not exactly, if you run it as a systemd service with User=your_user
and Group=input
(like you're doing), then Makima runs as your user and not with elevated permissions. However, it doesn't inherit your shell's environment, it inherits your systemd user environment (which you can see by calling systemctl --user show-environment
) so if you set PATH
from .bashrc or .zshrc, it won't be available to Makima. In case you need to pass a different PATH
to Makima, you can either import it directly into systemd (systemctl --user import-environment PATH
, or whatever other variable), or you can add it into the systemd unit by adding Environment=PATH=...
)
But anyway, thank you for the feedback! I'll mention this in the docs as well
Thanks for the explanation.
it inherits your systemd user environment (which you can see by calling
systemctl --user show-environment
)
The printed PATH from this command includes /home/user/.local/bin
, so I don't know why it doesn't work.
Oh, interesting, I'll see if I can do something about that
I'm probably doing something wrong, maybe you can please help me.
So to test this new feature of v0.9.0 I first downloaded kdotool tarball then extracted the binary to
~/.local/bin
.I confirmed
print $XDG_CURRENT_DESKTOP
returnsKDE
.To run a simple test, I duplicated my keyboard toml file appending window class. I don't know if there's a easier way to get window class, so I used "Detect Window Properties" from Window Rules (Kwin). The app I chose to test was Kate, which is Plasma default editor. I'm not sure if its window class is
kate
ororg.kde.kate
, but I tried both separately and none worked. So, for me, filename wasUsb KeyBoard Usb KeyBoard::kate.toml
orUsb KeyBoard Usb KeyBoard::org.kde.kate.toml
.Content was simple this:
So that pressing
A
key should printb
.Restarted systemd service but... it doesn't work.
Maybe kdotool needs to be available as root, so I placed the file in
/usr/bin
and restarted the service, but it still doesn't work.Am I missing something?
Thanks.