SwayWM Support For Backslash App: Feature Request

by Viktoria Ivanova 50 views

Hey guys! I've been using Backslash for a while now, and it's been a total game-changer for my workflow. Seriously, it's become my go-to app for staying organized and on top of things. But, as a Sway window manager user, I've run into a bit of a snag, and I think a feature addition could make Backslash even more awesome for the Sway community.

The Challenge: Backslash and SwayWM Compatibility

Currently, Backslash's standard hotkeys don't seem to play nicely with Sway. This means that toggling the app's visibility using the usual keyboard shortcuts doesn't work as expected. Now, I know I'm not the only one out there rocking Sway, and I'm sure other users would love to seamlessly integrate Backslash into their workflow. This is where the idea of external control comes into play, imagine being able to control Backslash from an external program or script within Sway. This would open up a whole new level of customization and integration, allowing us to tailor Backslash to our specific needs and preferences within the Sway environment. The current situation presents a challenge for Sway users who want to fully leverage Backslash's capabilities. The inability to use standard hotkeys means a less fluid and efficient workflow, requiring users to resort to workarounds or miss out on convenient features. So, a solution that bridges this gap is essential for a smoother user experience.

This is where things get interesting. Integrating Backslash with window managers like Sway involves addressing how applications interact with the windowing system. Sway, being a Wayland compositor and an i3-compatible window manager, offers a unique approach to window management. Unlike traditional desktop environments, Sway puts a strong emphasis on keyboard-driven workflows and scripting, providing users with fine-grained control over their workspace. This is why the ability to control Backslash externally is so crucial for Sway users. It aligns perfectly with the Sway philosophy of empowering users to customize their environment to their exact specifications. Imagine being able to create custom scripts that automatically show or hide Backslash based on specific conditions, such as when a particular application is launched or when a certain workspace is activated. This level of automation can significantly enhance productivity and streamline workflows. The challenge, however, lies in finding the right mechanism for this external control. Standard hotkeys often rely on specific desktop environment APIs or protocols, which may not be directly compatible with Sway's approach. This is why exploring alternative methods, such as Unix sockets and custom event handling, becomes essential for achieving seamless integration. The goal is to find a solution that not only works reliably but also feels natural and intuitive within the Sway ecosystem.

Inspiration: Sway IPC and Unix Sockets

So, here's my thought: What if Backslash could communicate with Sway using a mechanism similar to the Sway IPC (Inter-Process Communication)? For those unfamiliar, Sway IPC allows external programs to interact with Sway by sending commands and receiving events over a Unix socket. Think of it like a direct line of communication between Backslash and Sway. This approach offers a powerful and flexible way to control Backslash's behavior from within Sway. By implementing a similar system, Backslash could expose a set of commands that Sway users can use to show, hide, or otherwise manipulate the app. This could involve sending specific messages to the Unix socket, which Backslash would then interpret and act upon. For example, a user could create a Sway configuration that binds a specific key combination to a script that sends a