I'm running wofi
with the drun
mode. wofi
is correctly finding the desktop files of the Htop
and Neovim
packages my distribution (Void Linux) includes.
But when I attempt to launch them by clicking on their entries or pressing [Enter] when their entry is selected, I get a console output of sh: 1: exec: xterm: not found
.
My terminal being used is kitty
, and I've explicitly set it in the config file as well as left the default behavior and they both result in this error being shown.
For kicks and giggles, I switched to using run
mode. I select the entry from that wofi
instance and it successfully executes (opens up a kitty
terminal window with that program running).
I've read from https://todo.sr.ht/~scoopta/wofi/4 and https://todo.sr.ht/~scoopta/wofi/2 about the way that wofi
might be trying to launch from this drun
mode. I could be wrong, but it appears maybe the gappinfogetexecutatble maybe what is trying to fire off the selected entry executable with xterm
?
If so, then that's a configuration issue on my part and I would happily resort to figuring out how to resolve that on my end.
If not, there may be an opportunity here to utilize the TERMINAL
key of the desktop file, and if true, execute the entry in the terminal desired by the config (or the default fallbacks?).
Thanks for your time, and this is just 1 of 2 issues I have with wofi
amid a MYRIAD of problems that it solves. So, fantastic work by this whole community.
Wofi does not deal with terminal execution for drun mode, terminal execution is only handled internally for run mode, for drun it's all up to the desktop file and GIO which wofi uses to execute desktop files. It also does not use
g_app_info_get_executable()
anymore. It used to however now it starts desktop files withg_app_info_launch_uris_async()
andg_desktop_app_info_launch_action()
depending on whether or not a primary action is used or not. I'm not entirely sure what GIO's behavior is when dealing with terminal execution but it sounds like it might not be what most expect based on https://www.reddit.com/r/swaywm/comments/fgk3w0/gio/ however there's probably not a lot I could do without some serious work arounds.
I agree. Workarounds should be in the protocol, not the client. Thanks for the info. Its not a deal breaker for me at all, very minor issue. I'll resolve it as Not Your Bug.
Sorry, can't edit that comment, but I meant to say that workarounds should not be in the client*, and rather that fixes should be relied on in the protocol* haha
The error of the
sh: 1 xterm not found
was because I didn't have thegsettings org.gnome.desktop.default-applications.terminal exec
key set correctly. Gnome is such a PITA :/.
AND I had to symlink /usr/bin/xterm to my actual terminal. Honestly, what's the point of a desktop spec if the spec isn't applicable outside of the gnome desktop environment?
I'm not sure it's a problem with the desktop spec so much as a lack of specification in the desktop spec. The desktop spec doesn't seem to specify how the desktop should find the terminal to be used, GIO decided that using
gnome-terminal
,mate-terminal
,nxterm
,color-xterm
,rxvt
,dtterm
, and then finallyxterm
if no other could be found in that order was the best, the reddit post mentions this. They also link their preferred term tognome-terminal
as it's the highest priority one. GIO doesn't actually seem to checkorg.gnome.desktop.default-applications.terminal
but maybe I just overlooked that part of the code. Either way I think there should be some standard way to set a terminal to be used but apparently not, GIO isn't the only thing that has this problem. Wofi's internal terminal lookup code also has it, I just use common wayland terminals instead of common X terms and provide a config override. It'd be nice if there was some$XDG_
variable for this but alas not.
I just use common wayland terminals instead of common X terms and provide a config override
Hey, just figured this issue on my Manjaro Sway setup. Creating a symlink from my terminal emulator 'termite' to 'xterm' seems to make it working, but I want to ask you if there might be some other way to configure the terminal emulator to be used for drun / run mode in wofi (you mentioned a config override in the response above?)
Thanks a lot, Andreas
Scoopta's referring to the terminal execution of run mode. It has a config option to specify a terminal to use. Drun mode does not have this, unfortunately.
As ~cloudninja pointed out. Run mode has the ability to manually specify a terminal using the
term
config option, if none is specified the order is kitty, termite, alacritty, gnome-terminal, weston-terminal. Drun mode relies on GIO for desktop launching and GIO picks the terminal to use when running a desktop file withTerminal=true
. GIO unfortunately does not provide an option to override its order which was mentioned earlier and is as follows gnome-terminal, mate-terminal, nxterm, color-xterm, rxvt, dtterm, xterm. Unfortunately the best solution is to symlink your actual terminal to gnome-terminal or one of the others.
What do you mean when you refer to
GIO
in the context of this thread, as I'm currently also trying to get drun mode to launch with kitty and having a bit of trouble as you have mentioned thatgsettings org.gnome.desktop.default-applications.terminal exec
seems to be ignored.
There is no overriding the behavior, beyond symlinking your desired terminal emulator to the
xterm
binary location, unfortunately. Unless something has changed, GIO doesn't provide a way of overriding the terminal when telling it to launch desktop files.
I found a stackoverflow question/thread that mentioned something about GIO being deprecated?
I want to use terminator instead of default terminal in Ubuntu mate. I changed it in dconf Editor but the entry is DEPRECATED because managed by GIO.
https://askubuntu.com/questions/724810/how-change-default-terminal-in-open-in-terminal-in-gio
Does this mean that we should be using something else?