Desktop applications running in terminal in Manjaro Sway

Hi there,

I am using Manjaro Sway edition in Pinebook Pro. I have a problem with terminal based applications. I can see some of them when I search in Wofi; however, those applications do not launch when I choose them.

The applications are the desktop applications that run in terminal. A few of them are Neovim, R, ipython etc. As far as I understand, this is somewhat related with Termite that comes with Sway because I installed Gnome terminal and those applications launch in Gnome terminal when I choose from Wofi.

How can I make Termite to launch when I choose Neovim, R or ipython from Wofi? If termite is not suited, how can I setup and polish Gnome Terminal to use it as my default terminal application?

Any help would be appreciated.

dmenu, bmenu, wofi and so on just execute the commands. Usually that would include scripts/ commands/ “applications” alike depending on your setup.

I think for dmenu you could append -b to launch it inside the default terminal.

Take a look at wofi’s documentation. There has to be some additional arguments you can pass so that whatever you run from wofi will spawn a terminal to execute it in.

PS: Example of where you don’t want such behavior - killall XXX or reboot :grin:

A reason could be that xdg open doesn’t use termite as the default terminal on the system… I haven’t found the time to check it yet, but there is some discussions about it on GH: termite as default terminal · Issue #729 · thestinger/termite · GitHub. Eventually introducing a XTERM variable set to termite should do the fix, but I haven’t tried it yet.

Tried to configure it in “Preferred Applications”, but seems still not to work properly…

1 Like

Found something here…

gsettings get org.gnome.desktop.default-applications.terminal exec

which is set to ‘gnome-terminal’ by default…

EDIT: but changing it to ‘termite’ as part of the login procedure doesn’t change anything :slightly_frowning_face:

1 Like

OK, I guess I pinpointed it…

if you run wofi launcher from a terminal via wofi --show drun --term /usr/bin/termite and choose some of the terminal applications such as Neovim or Ranger it will always come back with
sh: line 0: exec: xterm: not found

Checking the wofi repo I found this thread: ~scoopta/wofi#73: sh: 1: exec: xterm: not found — sourcehut todo. It looks there is some fix sequence of checking for a valid (X-) terminal… and the fallback goes to xterm. It suggests to create a link from /usr/bin/xterm to /usr/bin/termite…

EDIT: ok, creating this symlink make launching the terminal works at least…

lrwxrwxrwx 7 root 16 Nov 21:07 /usr/bin/xterm -> termite

2 Likes

Uhmm there are a few issues with your recommendation. I removed Thunar and any XFCE related applications from my Sway install. They are not Wayland applications afaik and I replaced them with software that is more compatible with Wayland. These software are mostly coming from Gnome/GTK3 territory. I have been having issues with those XFCE applications; e.g. I was not able to scroll down in the Thunar File Manager in my Pinebook Pro.

Just a suggestion: Can you switch the XFCE based applications with Gnome/Wayland compatible ones? I have no issues with Nautilus; same for Gnome System Monitor, Baobab or Rhythmbox. They are fairly lightweight, feature rich and work in Wayland.

The same goes with Gnome Terminal: If you install Gnome Terminal without changing the gsettings variable, you will be able to launch those applications in Gnome Terminal from Wofi without any issues.

Why are you working against the tide by choosing Termite against Gnome Terminal?

At this stage I feel like removing Termite and installing Gnome Terminal instead. Gnome Terminal suits better to my needs and feels more mature. I am capable of calling Terminal based aplications like ipython, R etc from Wofi when I have Gnome Terminal.

This time though I need some help in setting up Gnome Terminal in my Sway installation. Maybe another thread on how to setup Gnome Terminal in Sway would be a good idea.

I decided against the GNOME packages as they bring in a lot of additional dependencies that might not be required for a lightweight desktop environment such as Sway.

You will also have to live with the Wayland - X11 bridge for a foreseeable future as not every Linux GUI application out there is adapted to Wayland yet, so choosing the more lean XFCE apps instead was a no-brainer.

Nevertheless you can always choose to replace apps from the default installation with your preferred ones. I also did this for some of the apps coming with the sway image…

At the end the system is yours to tinker with…

I have already installed a few Gnome applications, i…e. Nautilus, Gnome System Monitor, Rhythmbox, and Baobab. I am not noticing any performance decrease; the dependencies were fairly low. I had some doubts with Nautilus because it installed tracker as a dependency. Tracker indexer is one reason why Gnome feels so system resource heavy. However, I don’t have any difference in my system resource usage on a cold boot. Even Nautilus, it seems to be using tracker only when I make a file research.

To my understanding, as long as I stay away from two big resource hungry components of Gnome, which are Evolution and Tracker, the applications are lightweight and tend to be more featureful.

Thunar was problematic for me because I couldn’t scroll within the file manager. I decided to remove as many X based applications as possible. The only X or Xwayland application in my system is Emacs.

I am hesitant to remove Termite from my system and switch to Gnome Terminal. However, I briefly installed and tested Gnome Terminal, and it is seemingly better integrating with Sway/Wayland.

I will open another thread on setting up Gnome Terminal if I start the switch.

With Sway I would recommend Kitty or Terminology

I personally use kitty because there is a good integration with Ranger filemanager (for instance to view images inside ranger instead of in a w3m window).

Terminology is a bit bigger but has more options like in terminal picture and video support.

Whatever terminal you use. As showed in you other thread it can be resolved with desktop.entry file. The issue you have now according to that is that with Neovim it does not seem to fill the whole terminal. Which is odd since the other apps you tested had no problem.

That seems to be the issue now or am I incorrect?

Kitty and Alacritty needs OpenGL3 to work and are only able to be executed with some custom environment flags in place at the moment (see [ARM Stable Update] 2020-10-27 - KDE Plasma, Firefox, Uboots and Kernels).

I gave Alacritty a try with these overrides and noticed that neovim behaves in a proper way with it. So the issue might be related to termite not reporting screen space on-time for neovim to catch up… doing a force screen refresh usually results in neovim catching up in termite though.

So sorry, I dont run ARM but Sway is no stranger to me. Thanks for the link learned something new :slight_smile:

1 Like

Yes, I also have other problems with termite; e.g. when I write a long command and termite is open side by side with another application, the command ends up repeating at the same line overwriting the powerline prompt etc. This can also be relevant to the symptom.

That may be a poweline silver issue. I had such experience. Then I uninstalled powerline silver and switched to zsh with oh-my-zsh. Since then no command prompt glitches.

The wofi-ranger issue was solved for me by installing and configuring xterm. I really like how ranger and w3m can render images in terminal.

EDIT: I made an mistake, I wrote “powerline” but meant “silver” and the issue @appelgriebsch mentioned in following comment. Sorry.

I would not prefer to install another terminal application; esp. xterm in my Sway environment; I would prefer the terminal application to be Wayland native.

I have used Powerline with Gnome Terminal and Xfce Terminal in the past. I did not have the symptom. I tend to think it is a Termite problem. It may be relevant to the symptom because it may be the case that Termite is not encountering the available space it occupies.

If I have to switch to another Terminal program, I would prefer it to be Gnome Terminal. Actually, Gnome Terminal is also mentioned as an option in Sway wiki. Besides being mature enough, it is Wayland application and it didn’t request to install any dependency when I tested it in my Sway environment.

Terminal is an important part of the deal especially when it comes to using a keyboard driven lightweight wm like Sway. I hope we could have a good terminal program soon. On the side, I am still considering to switch to Gnome Terminal. Fonts and powerline do not seem as polished as in Termite, but I assume this could be fixed.

Similar problem with Termite here. The terminal only went 15 digits (using half screen) before returning back on itself overwriting the prompt. However when in full screen this does not happen. Following this thread I tried to install terminology, but it did not go so well. It seems to require a lot of manual configuring. Any suggestions for a newbie?

IMHO Alacritty would be a very good alternative to termite and my preferred terminal emulator, but as said above it uses some OpenGL3 functionalities that are still only available behind some feature flags on the Panfrost driver of the Pinebook Pro…

Therefore it might need more testing before making it the default in the Sway image.

Also take other devices, like Raspberry Pi and Odroids into account here. :slight_smile:

1 Like

Please note that there is a bug report for the Silver prompt in GH for this… Line wrapping issue with silver in termite (using bash) · Issue #58 · reujab/silver · GitHub.

Looks like it has been solved already, but we are still waiting for a new release of it (which should include this bugfix).