Biont / sway-launcher-desktop

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

Some applications won't launch #57

Closed GreyXor closed 2 years ago

GreyXor commented 2 years ago

Hello, I try to run gnome-disks but nothing happens, if I try /usr/bin/gnome-disks it works correctly. From my terminal, both of them run correctly.

I'm using Arch Linux testing with sway-launcher-desktop-git

Do you have any idea why they don't start, how can i debug this ? Thanks

Biont commented 2 years ago

Thanks for the report. You can dump to a log file using the instructions in the README

But I just installed the package and it seems to launch correctly (apart from an empty terminal window popping up. I thought this was fixed -.-)

Maybe your log helps

GreyXor commented 2 years ago

debug log : Starting launcher instance with the following providers: desktop user command

Biont commented 2 years ago

There should be more output. Did you attempt to start gnome-disks when you created the log?

GreyXor commented 2 years ago

@Biont Yes i tried to start it with log.

i just found that Clocks is working from sway-launcher-desktop.

Biont commented 2 years ago

What's your terminal emulator? Did you set an appropriate TERMINAL_COMMAND ? The default is $TERMINAL -e, where the -e flag is just an educated guess and something that many terminals support.

So either define your TERMINAL environment variable somewhere (.bashrc) or start the launcher with a TERMINAL_COMMAND:

TERMINAL_COMMAND='foot -e' ./sway-launcher-desktop.sh

GreyXor commented 2 years ago

Thanks now it works by adding export TERMINAL=alacritty in my .zshrc. This is what I expected apart from an empty terminal window popping up. Thanks :)

Biont commented 2 years ago

Great! As for the empty terminal window: This is another instance of the command name varying greatly from its XDG desktop entry. The command gnome-disks will open a new window with the actual GUI. That's what happens if you type it into a CLI so of course it'll happen as well if we invoke a new terminal instance with it. We normally expect command entries to produce CLI output, so it makes sense to open up a new terminal instance. At least I see no real alternative here.

Now the clean way to launch GUI apps is via their desktop file. But this doesn't come up when you search for gnome-disks because it is actually called "Disks".

It's the same situation with gedit and it's "Text editor" desktop entry. I hope this further clears things up for you.

GreyXor commented 2 years ago

Yes, it's very clear

liljenstolpe commented 2 years ago

I am having some of the same problems. I have tried with TERMINAL exported as well as not. Alacritty, zsh, and the latest master of launcher.

My sway config fragment (I added the explicit bash launch of launcher-desktop as a test - no effect):

set $term alacritty
# set $menu rofi -show run
set $menu "$term --class launcher -e /bin/bash /sbin/sway-launcher-desktop"

The log below was included by making three runs from the shell

sway-launcher-desktop 3>> /tmp/launcher.log

The first was the command was an executable in my $PATH with an argument. It did not work

# cam -p

The second was the same command, but with the path prepended. It did work

# ~/.local/bin/cam -u

The third was firefox - which also worked

# firefox

My zsh path is replicated in my .bashrc

The log

❯ cat /tmp/launcher.log
Starting launcher instance with the following providers: desktop user command
Launching command: alacritty -e activate-global-python-argcomplete
Starting launcher instance with the following providers: desktop user command
Launching command: ~/.local/bin/cam -u
Starting launcher instance with the following providers: desktop user command
Launching command: /sbin/sway-launcher-desktop run-desktop '/usr/share/applications/firefox.desktop'
Searching for pattern: ^\\[Desktop Entry\\]
Generated Launch command from .desktop file: exec /usr/lib/firefox/firefox