-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Applications sometimes silently don't launch #22
Comments
Hi, thanks for the bug report. Do you have any other ideas? |
I have also experienced this, also on Arch, running zsh and alacritty. I could not identify any repeatable factors, but hopefully this helps. EDIT: I noticed this happens disproportionally more while trying to launch firefox. |
I set up some logging in the function run-desktop() {
echo "Running Command $(date)" >>sway-launcher.log
bash -xc "$("${0}" generate-command "$@")" >>sway-launcher.log 2>>sway-launcher.log
} However, after doing so, I have yet to experience the bug again. I had a similar experience during my first attempt at debugging this. This leads me to believe it may be timing-sensitive in some way, or is affected by a race condition, but I'm not familiar enough with the script to know if that's even possible. For now I'll keep the logging active and see if I can eventually experience the bug again. Would you recommend anything else to write to the log? |
Not sure if this would be any help, but it seems like |
Good finding! I will try to get involved soon, but I am currently occupied by my new family member. |
No worries, there's no rush! It's not a huge inconvenience, so I don't mind if fixing it takes a while (especially as it's so elusive). I'll try and add some more print statements to see where it exits. |
Launching is almost completely broken for me at this point, it has become quite unusable. Launching custom Firefox profiles always fails and some programs also never launch, or some take multiple tries to launch. Are there any points in the code that I should take a look at? I'd like to fix this ASAP. |
Are you suggesting it is getting worse over time? |
I'm not sure if it's getting worse over time, but there was a time when I did use the launcher that the desktop files were launching properly. |
I have also been having the same problem. It's been driving me nuts sometimes where I have to try to launch the app a 2nd time. I also can't find any sort of pattern to it. |
…information is directed to file descriptor 3 and can be dumped using `./sway-launcher-desktop.sh 3>> ~/sway-launcher-desktop.log`
@turtlewit @NullSense @jkehler |
I tried adding the logging redirect but it doesn't seem to output anything. I've already had several failed app launches where nothing happened yet the log file remains completely empty. |
@jkehler just to be sure, you are using the latest master? |
I am on the latest master and I don't get any output. This is my sway command to launch it:
Though it seems to not output anything when launched manually like your example. |
I used the |
@turtlewit looks like it's piping alacritty to the file, instead of sway-launcher-desktop. I'm seeing the same problem here, but it does work in isolation (script just being run from terminal itself). I hope this can be solved by quoting/escaping the full command so it all gets passed inside alacritty's @jkehler Yes it is based on master, but it will not update by itself when new commits are made. |
@jkehler @turtlewit I now provide the file descriptor 3 in a different way which seems to resolve the issue with it not generating any output. Could you please check again? |
@Biont Yes, I now get output in the log. This was the output on a failed launch (of Godot in this case).
If it might help, here's contents the desktop entry I tried to launch: https://pastebin.com/m2njZgwF |
@turtlewit Interesting, it should have logged I tried to catch the stderr of |
Unfortunately this launcher has become completely unusable for me, 70% of the time programs fails to launch for me. I looked through the code multiple times, but don't have enough experience with it to help 🤷 . Will be moving to a wayland rofi clone. |
Sorry to hear that. Were you able to grab any logs with the latest few commits? And have you tried deleting your history file? |
Unfortunately I never set up the logging mentioned here, but I did try uninstalling and reinstalling (Arch AUR). |
Here's what's logged on a failure:
On success, I get:
Since logging |
Thank you @s-hamann So something's probably odd with the way commands are handled in |
I can confirm that now. I added a debug line near the very top and the log's last line is still
|
I searched around a bit and found this thread which discusses a few approaches. Can you try if things are improving @s-hamann ? |
I took a look and just as a raw command it seems to work: ❯ setsid /bin/sh -c "firefox -P Work" >& /dev/null < /dev/null &
[1] 198834
[1] + done setsid /bin/sh -c "firefox -P Work" >&/dev/null < /dev/null EDIT: The launcher seems to work now as well, I updated my firefox .desktop entries. |
I changed the last line to (exec setsid /bin/sh -c "${COMMAND}" >& /dev/null < /dev/null &) since that seems to work for @NullSense. I have no idea what's the key difference here, but I'll test that for a while. I can not reliably reproduce the issue, so I can not easily verify that it's fixed. But I'll report back if anything fails to launch for me. |
Does it still happen with the version I had already committed? |
@Biont |
|
I am so glad we were able to get this sorted out. Thanks for all your help and patience everyone. I will prepare a new release as soon as I find the time |
An issue I've been having for a long time is that applications will sometimes silently won't launch. There is no error output when running the launcher from an interactive shell, and the application will almost always launch after simply trying a second time. Subsequent applications launch without issue.
I've been reluctant to file a bug report because it seems like nobody else has experienced this issue, and I have yet to be able to consistently reproduce it. I've identified 2 common senarios where the bug will most likely occur:
I've attempted to debug it a few times, but like I said, I haven't been able to consistently reproduce it (sometimes applications will launch first time after starting the system, etc.) Are there any particular things I should try to get more helpful output or otherwise attempt to debug it?
Specifics of my setup:
sway-launcher-desktop 1.2.1-2
bindsym $mod+d exec alacritty -t "sway-launcher-desktop" -d 110 36 -e env TERMINAL_COMMAND="alacritty -e" /usr/bin/sway-launcher-desktop
The text was updated successfully, but these errors were encountered: