“It’ll be easy!”
NO IT WON’T BE ASDSFSDGDG
ahem. What I mean to say is that the UI is done and ready! I think it looks relatively nice, simple, and most importantly, is functional.
I, somehow, managed to log 11 HOURS, of which a significiant part of was not doing the UI, actually! It was literally just trying to get the global shortcut functionality to work again!
Wayland doesn’t like you doing that, actually
I use KDE Plasma as my desktop environment, which uses Wayland by default as of Plasma 6. I want to support all systems, and that obviously includes my own, but the Global Shortcut plugin for Tauri, as it turns out, only natively supports X11. Ah.
At first, I tried using this pull request by patching it into my dependencies, so the Tauri plugin would use that instead of the normal crate. This worked actually! Until I tried using unregister_all(), at which point it crashes the xdg-desktop-portal with a SIGABRT, somehow, for some reason.
I have no idea if that’s an issue with my system (I tried updating!) but I couldn’t find a way around it, so I ended up scrapping that plan (using an unreviewed, unmerged PR probably isn’t a great idea anyway…).
What now?
After what I said about rdev in the last devlog, I ended up writing a key handler module that would fallback to rdev when detecting Wayland (inspired by how murmur ended up doing this as well).
Except… I wrote all this, spent a couple of hours getting everything working, and then somehow, by having moved the callback function for shortcuts into the Rust code (where I previously was trying it from the frontend in TypeScript), it… WORKS?! With the default Tauri plugin, which is only supposed to work on X11.
This requires some more testing (is this a KDE Plasma specific thing?! or Xwayland??), so I’m keeping the keys module I made around for now just in case.
Good news!
The good news is that this means it works! The really only last two bits I need are Windows support and saving the config.
Should this have taken this long? Probably not. I attribute that to still wandering my way through Rust and literally never having used Tauri before (lol). A good amount of time was spent getting the UI working in a way that I was happy with, too!
With that said, here’s a quick recording of everything working!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.