Skip to main content
Topic: Hyperland + sddm: duplicate xdg-desktop processes. Better Hyplerland + greetd (Read 1939 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Hyperland + sddm: duplicate xdg-desktop processes. Better Hyplerland + greetd

Hello community, I would like to share with you my experience with Hyprland.

After 25 years of using Gnome, when I found out that It was going to increase its dependence on systemd, I was "slightly" disappointed... So, I installed XFCE, after that I discovered something called Hyprland.

I was curious and I got into this "new world" that, thanks to Gnome 49, I have discovered.

The point is that as a DM sever I were using SDDM. When starting Hyprland and doing "ps aux | grep xdg", I observed repeated instances of the xdg-desktop-portal, xdg-dekstop-gtk, and xdg-desktop-hyprland processes.

This didn't make me laugh at all, so I started "like a fool" to investigate helping myself with chatgpt and gemini. That took me into dark paths of scripts that tried to kill the duplicates and restart the basic processes, or to modify .desktop files and... I don't know what the hell sddm is doing, but it duplicated my processes. So I kept investigating, this time going from chatgpt and gemini that had me fed up after telling me one thing and the opposite as a "definitive solution". Consulting several sites I decided to go to the minimum, remove sddm and install greetd. To make it a little nicer, I also installed nwg-hello (just that, I don't want to install all nwg although it doesn't seem like a bad thing either). By the way, nwg-hello with mugshot takes the image of my avatar perfectly. After ignoring the AI, I left a fairly simple hyprland.conf. And... Done!: No more xdg duplicate issues. I rebooted several times till be sure, close the session and restart. It seems to work, finally.
❯ ps aux | grep xdg
jopeless  3527  0.1  0.0 548508 17604 ?        Sl   18:50   0:00 /usr/lib/xdg-desktop-portal
jopeless  3544  0.0  0.0 308704  9784 ?        Sl   18:50   0:00 /usr/lib/xdg-permission-store
jopeless  3550  0.0  0.0 548188 10524 ?        Sl   18:50   0:00 /usr/lib/xdg-document-portal
jopeless  3562  0.2  0.0 488624 27524 ?        Sl   18:50   0:00 /usr/lib/xdg-desktop-portal-gtk
jopeless  3589  0.1  0.2 472952 76744 ?        Sl   18:50   0:00 /usr/lib/xdg-desktop-portal-hyprland
jopeless  3914  0.0  0.0   9352  6256 pts/0    S+   18:51   0:00 grep --colour=auto xdg

Here is my hyrpland.conf, just the "autostart.conf" chunk since I use sources to split the configuration into smaller and more manageable files:
# Autostart necessary processes (like notifications daemons, status bars, etc.)

# Inicial helpers de xdg. ¡NO, ES UN ERROR! No lanzar nada.
#exec-once = dbus-launch /usr/lib/xdg-desktop-portal
#exec-once = dbus-launch /usr/lib/xdg-desktop-portal-hyprland
#exec-once = dbus-launch /usr/lib/xdg-desktop-portal-gtk

#Forma correcta de iniciar pipewire
exec-once = dbus-launch pipewire
exec-once = dbus-launch wireplumber
exec-once = dbus-launch pipewire-pulse

# Para permitir la elevación de permisos
exec-once = /usr/lib/hyprpolkitagent/hyprpolkitagent

# GTK apps: sin botones minimizar/maximizar/cerrar
exec-once = gsettings set org.gnome.desktop.wm.preferences button-layout :

# Activamos hypraper y un script de carga random
exec-once = hyprpaper
exec-once = ~/.config/hypr/scripts/random-wallpaper-hyprland

# Para montar discos usb
exec-once = udiskie

# waybar ha de ser lo último en arrancarse.
exec-once = waybar
---------------------------------------------------------------------------------
As you can see I'm still improving (and customizing) my system. I'm learning like donkeys, unfortunately. But I don't want to install any set of dotfiles out there.
What has been your experience?
Have you managed to install Hyprland with SDDM without duplicating your xdg processes?
Any criticism/observation is welcome.
Thank you for reading. Thank you for your time.

Re: Hyperland + sddm: duplicate xdg-desktop processes. Better Hyplerland + greetd

Reply #1
Improving and simplifying the configuration.
My goal is to have XFCE as a base or "stable" desktop and to learn Hyrpland.
My error 1: I started dbus in runlevel default --> I have removed this because it is initiated by demand.
My error 2:I started pipewire from the autoexec section of Hyprland --> No!!!!. a) Install pipewire-openrc, wireplumber-openrc, and pirewire-pulse-openrc. b) Activate them in --user:
$doas rc-update add pipewire default --user
$doas rc-update add wireplumber default --user
$doas rc-update add pipewire-pulse-openrc --user

This simplifies the autoexec section of hpyrland a lot and I can also take the junk out of putting a delay before starting waybar. Let's look at the new (still incomplete) section of the autoexec section:
#------------------------------------------------------------------------
# Autostart necessary processes (like notifications daemons, status bars, etc.)

# Para permitir la elevación de permisos
exec-once = /usr/lib/hyprpolkitagent/hyprpolkitagent

# GTK apps: sin botones minimizar/maximizar/cerrar
exec-once = gsettings set org.gnome.desktop.wm.preferences button-layout :

# Activamos hypraper y un script de carga random
exec-once = hyprpaper
exec-once = ~/.config/hypr/scripts/random-wallpaper-hyprland

# Para notificaciones (Machaca xfce-notifyd aunque quizá podríamos usar éste sin probelmas)
exec-once = mako

# Para desmontar unidades usb
exec-once = udiskie

# waybar que ha de ser lo último en arrancarse.
exec-once = waybar
#------------------------------------------------------------------------

That's much better and simpler!
I suspect that the reason I was getting multiple xdg processes might be related to all the dbus services I stupidly started.
As you can see, I use the "random-wallpaper-hyprland" script to load, from time to time, a new wallpaper. This one does need a delay to make sure that hyprpaper is active. At the moment, I don't know of any other way to do this better. If anyone has any ideas, please share them. Here's the "random-wallpaper-hyprland" script:

!/bin/bash

WALLPAPER_DIR="$HOME/Imágenes/Wallpapers"
# Comprobar si el directorio existe y no está vacío
if [ ! -d "$WALLPAPER_DIR" ] || [ -z "$(ls -A "$WALLPAPER_DIR")" ]; then
    echo "Error: El directorio de wallpapers no existe o está vacío."
    exit 1
fi

# Esperamos a estar seguros de que hyprpaper está activo:
sleep 2
# Cargar un fondo de pantalla inicial aleatorio
select_and_set_wallpaper() {
    local current_wall=$1
    local new_wallpaper

    if [ -z "$current_wall" ]; then
        # Primera ejecución, elige una imagen aleatoria
        new_wallpaper=$(find "$WALLPAPER_DIR" -type f | shuf -n 1)
    else
        # Elige una imagen diferente de la actual
        new_wallpaper=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$current_wall")" | shuf -n 1)
    fi

    # Si no se encuentra una nueva imagen, salir.
    if [ -z "$new_wallpaper" ]; then
        echo "Error: No se encontró un nuevo wallpaper."
        exit 1
    fi

    hyprctl hyprpaper preload "$new_wallpaper"
    hyprctl hyprpaper wallpaper ",$new_wallpaper"
   
    # Descargar la imagen anterior si existe
    if [ -n "$current_wall" ]; then
        hyprctl hyprpaper unload "$current_wall"
    fi
}

# Ejecutar el script por primera vez para establecer un fondo al inicio
select_and_set_wallpaper

# Iniciar un bucle para cambiar el fondo cada 1 hora (3600 segundos)
while true; do
    sleep 3600
    current_wall=$(hyprctl hyprpaper listloaded | grep -oP 'Path: \K.*')
    select_and_set_wallpaper "$current_wall"
done

Re: Hyperland + sddm: duplicate xdg-desktop processes. Better Hyplerland + greetd

Reply #2
CONFIRMED: No issues with SDDM and Hyprland.
After the steps done above, suspecting that the problem came from the misconfiguration in the autoexec section of Hyprland, the xdg processes are not duplicated.

I apologize for the "hoax": I'm learning Hyprland and I screwed up.

Greetings.