Biont / sway-launcher-desktop

TUI Application launcher with Desktop Entry support. Made for SwayWM, but runs anywhere
GNU General Public License v3.0
613 stars 29 forks source link

Is there any reason this depends on sway? #7

Closed FunctionalHacker closed 4 years ago

FunctionalHacker commented 4 years ago

I had a quick glance over the code and the only part that seems to make this script Sway specific is the the line where you use swaymsg to start the program.

Is there any benefit to starting the program with swaymsg, rather than f.ex setsid $program? Being that this whole script uses nothing but the CLI, changing that line would make it compatible with just about any WM.

Biont commented 4 years ago

There is no strong reason this script is tied to sway and if there is a simple way to get rid of swaymsg then that would be a welcome change. Sway is just what I am using and what I created the script for. I would have a hard time "supporting" other WMs but that does not mean we need to make it hard to use other WMs.

However, it does not seem to be quite as simple as just replacing swaymsg with setsid. From basic testing, something like exec setsid /bin/sh -c "$command" appears to be working. Is that what you had in mind? If not, can you provide a better example?

Biont commented 4 years ago

@ReekyMarko Any input? I think I might just use the code above otherwise.

FunctionalHacker commented 4 years ago

Sorry I totally forgot about this. Your example is basically what I ment. Great to see you got it implemented already!