nwg-piotr / nwg-drawer

Application drawer for wlroots-based Wayland compositors
MIT License
233 stars 25 forks source link

Change term overriding variable and improve error handling? #98

Open MakiseKurisu opened 11 months ago

MakiseKurisu commented 11 months ago

I was troubled by an stupid issue where I can launch other desktop entries but not the Looking Glass Client. Today I decided to investigate it.

Initially I though the desktop entry was bad but it worked with gkk-launch. I then launch nwg-drawer in terminal and found that it is trying to run xterm-kitty to launch a console program (which looking-glass-client is). I then realized that nwg-drawer uses $TERM as the default terminal, which is almost never going to give you a executable file name, since this variable denotes the terminal capabilities, not the binary itself.

Unfortunately there is no standard way to indicate the preferred default terminal, but whatever that would be, it is not gonna be $TERM, and such silent failure is confusing, as there is no error in main menu, and no graphical error message when the terminal failed to launch.

I think we could use $TERMINAL as overriding variable instead (used by i3 and suggested in another post, and actually check if this is a valid terminal and tell the user. Or show a graphical error message when the terminal failed to launch.

MakiseKurisu commented 11 months ago

BTW I'm currently using -term to workaround this issue. The issue's topic is improving user experience, not how to make nwg-drawer working.

nwg-piotr commented 11 months ago

Have you tried nwg-drawer -term xterm-kitty?

BTW: xterm-kitty should not be in the Exec= line. Terminal=true should be enough.

MakiseKurisu commented 11 months ago

I'm currently using nwg-drawer -term kitty since xterm-kitty is not an executable on NixOS.

Here is the content of looking-glass-client.desktop, which is already defined according to your suggestion:


[excalibur@nixos:~]$ cat /nix/store/ymm52bjb2nv3smzm8vjpd670si7gvzhj-looking-glass-client.desktop/share/applications/looking-glass-client.desktop
[Desktop Entry]
Exec=looking-glass-client
Icon=lg-logo
Name=Looking Glass Client
Terminal=true
Type=Application
Version=1.4
nwg-piotr commented 11 months ago

Looks good to me.