Emacs on Manjaro Kde edition

Hi there,

I have recently tried Emacs on Manjaro Kde edition. Feels good except for the problem that the Emacs refuses the launch. I have been reading on the web that Emacs would not launch when mixed/inconsistent theming is used and I am guessing the problem is relevant to Manjaro kde theming. I have been on Manjaro KDE edition for arm/pinebook pro.

How can this be fixed? Emacs has been an important program for me and I am staying within a GTK based environment because of this. If there is a fix in Manjaro KDE, I could consider switching to KDE. Otherwise, I will stay within Gtk based desktop environment (XFCE and sway are the only choices for pinebook pro).

KDE Plasma themes do not apply to GTK-based applications. However, you can select a different GTK theme in System Settings. :arrow_down:

Appearance → Application StyleConfigure GNOME/GTK Application Style…

Yes, I have tried to unify the theme settings and even matching gtk theme with that of kde. My best try has been emacs launching without icons on its toolbar; yes, I ended up getting text only toolbar buttons. Otherwise, I was not successful.

It is odd that KDE users don’t seem to use Emacs. I understand that attractive theming is a competency of Manjaro KDE; however, I don’t believe the theme should be dictating on which programs a user can use in the KDE desktop environment. I know this is not an issue with other distros using KDE; eg OpenSuse.

Unless there is substantial help in this forum for KDE, I will stick with a Manjaro edition in which Emacs works fine…

I have faced the same issue. Here is how I have fixed it:

  1. Add the following line in /home/< user >/.Xresources (if the file doesn’t exist, create it):
    The color you choose doesn’t matter.

  2. run this command:
    xrdb ~/.Xresources

  3. Now launch emacs. If it works, you have to make sure that the command is run every time you boot.

  4. Create a script fix_emacs.sh at /home/< user >/.config/autostart-scripts with the following content:
    xrdb ~/.Xresources

  5. Make sure that the fix_emacs.sh script is executable.

  6. Reboot.

Works fine here.
What happens when you launch it from terminal?

As you said, you just read somewhere that theming could be an issue, and you are guessing thats the reason. But as emacs is a GTK application … it doesnt really have anything to do with KDE ‘dictating’ a theme or breaking things with them… KDE is a QT desktop … its not forcing anything.
But you also dont know its a theme issue.

Once again … please attempt launching it to see any clues as to what the issue actually is.

1 Like

Yes, I am aware that Qt and GTK are different stories although some compatibility when it comes to theming is possible. And Emacs is supposed to launch without having any problems under a QT or GTK oriented desktop; or even a window manager. Actually, I am running Emacs in Manjaro Sway without any problems (Sway with a bit of GTK biased setup).

I also need to reiterate that other KDE based distros such as Kubuntu, Opensuse KDE, or even Fedora KDE have no issues with installing and running Emacs. So, it has to be something to do with Manjaro KDE Edition.

I have used Manjaro KDE as it comes with the Pinebook Pro laptop I purchased. Emacs was the first application that I have tried. I installed from the “Official Repositories” and it didn’t launch. Then, I tried launching from the Konsole, it gave me a one line error. I do not remember the error exactly but it was saying something to do with colors or whatever. Googling the one line error lead me to some links about Emacs would refuse to launch when there are inconsistencies in theming. Since Manjaro KDE is using an intense mix of themes, (breeze, breath, matcha and whatever else) it made sense to me. I tried to choose one theme instead of the mixed themes but I didn’t seem to get a long way. That would include changing the GTK settings from the KDE Settings.

I am curious to learn, how did you install Manjaro and had no problems when the default Manjaro KDE images I used gave me this problem? Installing and setting up GNU Emacs was supposed to be one of the most straightforward tasks to do, esp. when it comes to installing from a Linux distro; yet, I ended up spending good time and scratching my head with what I faced with. Just to let you know, I tried official Manjaro KDE 20.04 through 20.08. I automatically assumed Emacs will be neglected in forthcoming Manjaro KDE releases, which is at 20.10 now.

Sorry, when I was saying KDE dictating I was particularly mentioning Manjaro KDE. It gave me the impression that it is designed with the assumption that users would only use what it comes with default applications or that users would like to stay with QT/Kde applications only. Now, I am thinking that perhaps the programs in its official repositories are not well tested to run with what is available in Manjaro KDE edition images.

Please let me know how you installed Manjaro and Emacs. I might consider retrying again if how you do it makes sense to me…

Thank you for the information. I might try it if I decide on Manjaro KDE. I am disappointed with what I see with Manjaro KDE and Manjaro XFCE. I am using Manjaro Sway edition now, which is working ok with Emacs; yet, I have other problems with it.

I will try your recipe if I decide to give KDE Edition another look. It has just been quite an ordeal with me as I jumped from KDE (emacs not working), to XFCE (has been unstable for me, I ended up having the XFCE edition sucking a 2.5GB memory on startup) to Sway (works better except for a few issues, which I am trying to resolve). I am on Pinebook pro so I don’t have another option. The i3 edition is booting up to a blank screen, likely a GPU problem (a wild guess).

Thank you for the help again.

I think the error @pines is facing is Undefined color: "WINDOW_FOREGROUND" , which can be solved by the command xrdb ~/.Xresources, as I suggested earlier. But it turns out, simply installing gcc will solve this issue too, as suggested in the Arch wiki here.

You make a lot of assumptions.

All I did was install it, ran it … then uninstalled it.

Apparently … it may likely be because I already have gcc installed.
But we probably could have arrived here a lot quicker if you posted the error instead of wildly blaming the distro, as it is well documented at a rather reasonable location as pointed out by @onnyyonn above.

I have emacs-nox installed, because I hate the archaic look of Emacs when it’s running in a GUI environment, and its GUI guise doesn’t add anything to the functionality. So I prefer running Emacs in a terminal window or a tty, even though lately I’ve been using nano instead, or Kate if I want a GUI editor.

Thank you for the extra info. I do not remember if I installed gcc when using emacs or not. I may need to install again to see if it fixes the problem.

In any case I will try the recipe/hack as well to see if any of your suggestions could fix it.

Well, I make assumptions/guesses when I don’t have enough info about a rare problem that I have not faced before. How do you solve these kind of problems?

I think the error was the same as what was written on Arch Wiki. I will try and see if any recipes can work.

I am not very high using Arch Wiki, actually. The last I tried the wiki was for setting up mpd for a terminal based music player. The instructions in Arch Wiki was not useful for setting it up; they seemed to be inaccurate. It was the first (and the last) time I tried Arch Wiki.

I could try the Wiki again and hope it would help. Arch Wiki can have some information about this and that but it does not mean up-to-date. I guess at the end of the idea I try it at my own risk…

In case I can’t do the Manjaro KDE Edition; I will stay with Manjaro Sway Edition. It has its own problems; e.g., I can’t launch terminal based desktop applications. However, it has been usable for me overall.

Yes, I have the same problem. But using the GUI can give you additional advantage as compared to konsole version.

Have you tried theming Emacs? I am using Solarized-Zenburn theme that comes with Solarized theme on Melpa. I also switched the default font, switched to an icons only toolbar. After a few more tricks like using dashboard, switching the toolbar location etc., Emacs is looking very good. I tried powerline on emacs as well; unfortunately the fonts with powerline are unreadable with Solarized theme. I am skipping for now.

In case you are using Emacs frequently and want more features, you might want to consider switching to the GTK version. I am using Emacs daily, and it became one of the must-have applications. It is more important to have Emacs than using which Desktop Environment I use.

Hi there,

I am updating you with the issue: Based on our conversation here, I flashed Manjaro 20.10 on an sd card, updated to latest version after a first boot, and installed emacs. Emacs refused to launch again. I issued the command:

pacman -S base-devel

to install gcc package. I launched emacs again; indeed it is launching now.

However, Emacs toolbar does not have any icons; there is only text on the toolbar buttons.

I launched Emacs from the Konsole to see if there are any errors/warnings that might help. The error I get is below:

(emacs:1804): Gtk-WARNING **: 10:35:45.061: Theme parsing error: gtk.css:2:33: Failed to import: Error opening file .config/gtk-3.0/window_decorations.css: No such file or directory

If you have any other suggestions, I would be interested in trying.

Emacs in this form is still not usable for me as I prefer icons only on the toolbar instead of text only.

I just realize your screenshot also indicates the symptom that I have been describing in this thread. You also have a toolbar without icons. Normally, you are supposed to have icons beside the text such as “Open”, “Close” etc. At least it is the case in other DEs/WMs like Gnome, Sway etc.

I can’t use emacs in this form with Kde. So, I will stick with Sway if I can’t see the icons in the toolbar.

Those are client-side window decorations, which often turn out problematic in Plasma. You can work around that by installing gtk3-nocsd-git from the AUR.

Also, do note that the window control buttons on client-side decorations stop working if the application itself ever crashes, and then it becomes impossible to close the window of a misbehaving application by clicking its “close” button.

Thank you for the response. I found gtk3-nocsd from the official repositories and installed. It didn’t make any difference. I realized gtk3-nocsd-git is available from AUR; so, I tried installing. The package gave a lot of compile errors; however, finished. I launched emacs again with no difference. I rebooted and launched again without any difference: emacs with no icons and text only toolbar.

I know other gtk3 applications like firefox, thunderburd etc that are well integrated with plasma. Yet, I am not sure if these use client side decorations; I didn’t know Emacs was using client side decorations either.

However, I know other KDE centric linux distros are providing emacs with toolbar icons. Kubuntu comes to my mind: both emacs-snapshot from ppa and emacs26 were working and emacs in any case was looking well-integrated into plasma with appropriate “Breeze” theming.

That package is not in the official repository. I’ve just checked. It’s only available from the AUR.

The gtk3-nocsd-git package does not add any icons to the toolbar. It’s only there to remove the CSD icons from it.

All GTK3 applications do. GTK2 applications might not.

That’s a GTK-specific variant of the Breeze theme, because Plasma’s own Breeze theme cannot affect GTK applications.

I’m guessing there’s something you’re not doing right. Either it’s in the GTK Settings section of Plasma or in the Emacs settings itself.

I am just checking the gtk3-nocsd package again from the pamac software installer on my Sway environment. Actually it says “Official repositories” under the description. The gtk3-nocsd-git says “AUR” below its description. Am I missing something?

If gtk3-nocsd does not affect the icons, how would i benefit from it? The toolbar does not have any icons be it CSD or whatever. Just to your information, emacs provides option to remove text from the toolbar and display icons only; provided you have those icons.

I don’t believe I am doing anything wrong as I didn’t even touch any settings; be it from Kde plasma or Emacs…

just to add on what I have observed. I don’t experience any toolbar icons issues with any other gtk3 programs like libreoffice, firefox or thunderbird.