You are not logged in.

#1 Yesterday 17:48:16

Enrico1989
Member
Registered: 2018-07-05
Posts: 284

Can start-cosmic from console, but not via xinitrc

(Not sure if this is in any way related to Ctrl+Alt+Fx and back to X11 session shows black screen.)

Until recently, I had

if [ -d "$xinitdir"/xinitrc.d ] ; then
 for f in "$xinitdir/xinitrc.d"/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

exec gnome-session

in ~mymom/.xinitrc and

[[ -f ~/.bashrc ]] && . ~/.bashrc

[[ ! $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

in ~mymom/.bash_profile, and she could power on the computer, log in with her credentials from VT1, and Gnome would welcome her.

Since one day (after some upgrade I've made from remote, presumably) she couldn't start it anymore. (*)

So I tried cosmic as an alternative to Gnome, but wherease if I log in and run start-cosmic it starts and works (at least as far as me admiring the background and logging out), if instead I put

exec start-cosmic

in ~mymom/.xinitrc and then login with her credentials, it doesn't start, in the sense that I just see a black screen.


---

(*) I've asked on libera's archlinux channel, and I've come to know that Gnome doesn't use x11 anymore, but wayland (since mid Sept 2025?). I've been told that, if I want things to work easily, starting Gnome from VT is not the way to go, but I should use gdm instead, but I'd see a black screen when starting xmonad for my user from the login manger that comes with gdm, so I've decided to see what else is out there in DE/WM land that could be nice for mom, and I chose to try cosmic.

Offline

#2 Yesterday 17:54:10

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,084

Re: Can start-cosmic from console, but not via xinitrc

Cosmic uses Wayland, of course it doesn't run from startx.

Offline

#3 Yesterday 18:04:10

Enrico1989
Member
Registered: 2018-07-05
Posts: 284

Re: Can start-cosmic from console, but not via xinitrc

Oh, right.

But shouldn't it work if I put

start-cosmic

in .bash_profile?

Offline

#4 Yesterday 18:05:08

Enrico1989
Member
Registered: 2018-07-05
Posts: 284

Re: Can start-cosmic from console, but not via xinitrc

Oh, it works with the ampersand after that.

Is this the way?

Nope. At least, starting it like that, I don't see buttons working, in the sense that they visually react, but don't really result in anything, e.g. logging out doesn't work, opening a terminal doesn't work, opening file manager doesn't work.


Having

exec cosmic-session

in ~/.bash_profile seems to do the job, unless I'm celebrating too early again.

Is this the way?

Last edited by Enrico1989 (Yesterday 18:26:37)

Offline

#5 Yesterday 18:45:44

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,802

Re: Can start-cosmic from console, but not via xinitrc

Maybe, but you should absolutely guard that behind something that verifies that you are logging in from a VT terminal and not try to start cosmic again each time a login shell gets opened.

Offline

#6 Yesterday 18:54:40

Enrico1989
Member
Registered: 2018-07-05
Posts: 284

Re: Can start-cosmic from console, but not via xinitrc

V1del wrote:

Maybe, but you should absolutely guard that behind something that verifies that you are logging in from a VT terminal and not try to start cosmic again each time a login shell gets opened.

You mean something like this, right?

[[ ! $DISPLAY && ( $XDG_VTNR == 1 || $XDG_VTNR == 2 ) ]] && exec cosmic-session

Offline

#7 Today 12:24:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,802

Re: Can start-cosmic from console, but not via xinitrc

yep, though DISPLAY is not entierly guaranteed in theory anymore on a wayland session (in practice if you have xorg-xwayland installed and intended to be used, it will most likely be defined within a running session's scope, so same difference).

Offline

Board footer

Powered by FluxBB