You are not logged in.

#1 2021-11-26 14:42:23

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 189

[SOLVED] How to start Plasma without DM after network online?

I followed the Arch wiki to start/autologin Plasma/Wayland without using any display manager.

│ File: .zprofile
───────────────────────────────────────────────────
# ~/.zprofile
# sourced by zsh when used as a login shell
[[ ! $DISPLAY && $XDG_VTNR -eq 1 ]] && XDG_SESSION_TYPE=wayland /usr/lib/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland #Plasma/Wayland
# /etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin juan --noclear %I $TERM

But the "problem" is that it starts Plasma before the network is online. I want to start Plasma when "graphical-session.target". How can I do this without display manager?

Last edited by j1simon (2021-11-26 16:05:40)

Offline

#2 2021-11-26 15:16:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,410

Re: [SOLVED] How to start Plasma without DM after network online?

Why and for what reason is this  a problem? This can technically be done but depends on what you're using for establishing the connection or you delay general startup by making an unit that only continues once a connection is established. But without more context I don't even know for what reason this would be an issue. Plasma as a session should not really require a generally working network connection.

Last edited by V1del (2021-11-26 15:18:22)

Online

#3 2021-11-26 15:34:17

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 189

Re: [SOLVED] How to start Plasma without DM after network online?

Plasma can boot without the network being online but some of the programs/widgets I use on the desktop do need it. On the other hand, using the wiki method the graphical environment (Plasma) starts earlier than it would if I used a display manager.
Why don't I use SDDM? Because it "hangs" when restarting or shutting down the computer: https://bbs.archlinux.org/viewtopic.php?id=271475

Offline

#4 2021-11-26 15:51:45

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [SOLVED] How to start Plasma without DM after network online?

The graphical.target does not depend on the network-online.target - plasma starts faster because you've no clumsy DM in the way.
You can

for ((i=0;i<30;++i)); do ping -qc1 google.com&& break; done

to wait for some sort of internet connection and a limited time.

Offline

#5 2021-11-26 15:52:28

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,410

Re: [SOLVED] How to start Plasma without DM after network online?

While I think this is an ugly hack and technically a bug in these widgets as they should have API to query for network connectivity, if you're using network manager you can run nm-online (... potentially with a timeout) before executing the plasma session, which will block until network manager has established a connection.

... or do some generic pings of course tongue

Last edited by V1del (2021-11-26 15:53:14)

Online

#6 2021-11-26 16:05:06

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 189

Re: [SOLVED] How to start Plasma without DM after network online?

I solved it by adding this to the file /etc/systemd/system/getty@tty1.service.d/override.conf:

[Unit]
Wants=network-online.target
After=network.target network-online.target
...

Offline

Board footer

Powered by FluxBB