You are not logged in.

#1 2023-08-16 15:29:44

me_231231
Member
Registered: 2023-08-09
Posts: 42

[SOLVED] How to replace the tty in linux with some application?

Linux has extensive tty layer that will run on everything, however I want something more modern, at least with font support.
In my head solutions looks something like this. Disable tty layer so that /dev/tty devices dont get created and run some application instead.

For example can I replace whole tty layer with something akin tp fbterm or some other application that uses framebuffer for rendering?
Would I still be able to startx if I turn off tty layer?
Does tty layers has any alternatives?
Can I customize tty layer to render fonts and colors (no I do not want to start X since some window managers get freeze and I need something extrnal to X to make the system "unfreeze" without reboot)?

Alternatively, can I somehow make tty use some framebuffer program for user login? Because after login I guess I can start fbterm with a script.

Last edited by me_231231 (2023-08-18 23:03:57)

Offline

#2 2023-08-16 15:52:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [SOLVED] How to replace the tty in linux with some application?

Your use of the word "layer" is a misleading reification.  There is no such "layer".

You most certainly can replace (a)getty with alternatives including fbterm / yaft and the like.  There are instructions for doing so in the wiki.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-08-16 16:21:22

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

Trilby wrote:

Your use of the word "layer" is a misleading reification.  There is no such "layer".

You most certainly can replace (a)getty with alternatives including fbterm / yaft and the like.  There are instructions for doing so in the wiki.

So I can replce tty login with something else. Thing is X can break especially on systems with nvidia. Can I replace login into virtual terminal on /dev/tty{0-6} with gui framebuffer login?

Offline

#4 2023-08-16 16:39:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [SOLVED] How to replace the tty in linux with some application?

me_231231 wrote:

Can I replace login into virtual terminal on /dev/tty{0-6} with gui framebuffer login?

Yes.

Whether or not you can launch X from that very same tty or not I'm not entirely sure - especially with NVIDIA.  I've (thankfully) never used NVIDIA; it has lots of it's own quirks.

But you could, for example, put a framebuffer loging on all but one virtual terminal / console and have X run on the other.  There are even ways to run X on a console without ever login in to any tty there - though I wouldn't really advise this.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2023-08-16 18:37:02

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

Trilby wrote:

Your use of the word "layer" is a misleading reification.  There is no such "layer".

You most certainly can replace (a)getty with alternatives including fbterm / yaft and the like.  There are instructions for doing so in the wiki.

I am maybe dumb, but can you provide me links to the wiki where it says how to change getty for fbterm, cannot find it sad.
fbterm or getty pages dont say anything about it.

Offline

#6 2023-08-16 19:39:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: [SOLVED] How to replace the tty in linux with some application?

Principally explained for https://wiki.archlinux.org/title/KMSCON
Not sure for https://wiki.archlinux.org/title/Fbterm … nvironment - you might have to derivce your own service file if the package doesn't provide one.

Edit: make sure to have some live distro around to fix things offline if you screw this up!

Last edited by seth (2023-08-16 19:39:56)

Offline

#7 2023-08-16 20:30:00

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

seth wrote:

Principally explained for https://wiki.archlinux.org/title/KMSCON
Not sure for https://wiki.archlinux.org/title/Fbterm … nvironment - you might have to derivce your own service file if the package doesn't provide one.

Edit: make sure to have some live distro around to fix things offline if you screw this up!

I have it ready from fiasco in my last question you answered, don't worry and thank you.

Offline

#8 2023-08-17 19:03:03

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

seth wrote:

Principally explained for https://wiki.archlinux.org/title/KMSCON
Not sure for https://wiki.archlinux.org/title/Fbterm … nvironment - you might have to derivce your own service file if the package doesn't provide one.

Edit: make sure to have some live distro around to fix things offline if you screw this up!

I am sorry but it appears to me that fbterm does not have any login abilities and I am lost as how to start it with default arch linux agetty. When I pass "fbterm" instead of $TERM it only sets the $TERM environment variable to fbterm and does not start fbterm upon login, but default linux shell with only 8 colors. hmm
Also there seems to an option for --login-program, does that mean I can use a custom framebuffer program for login there?

Last edited by me_231231 (2023-08-17 19:03:50)

Offline

#9 2023-08-17 20:07:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: [SOLVED] How to replace the tty in linux with some application?

I've no idea whether fbterm can serve as a full console/agetty replacement but if it ca, you want to replace getty@tty1.service, not set some $TERM (what you generally should refrain from anyway)

Offline

#10 2023-08-17 20:11:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [SOLVED] How to replace the tty in linux with some application?

fbterm itself does not provide a login, nor does yaft (AFAIK).  But you could autologin and run one of these programs.  Or you could start them via a framebuffer login program (I know there are some, but I don't recall).

Though I believe KMSCON would kill two birds with one stone and seems the better approach to me anyways.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#11 2023-08-17 20:27:04

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

Trilby wrote:

fbterm itself does not provide a login, nor does yaft (AFAIK).  But you could autologin and run one of these programs.  Or you could start them via a framebuffer login program (I know there are some, but I don't recall).

Though I believe KMSCON would kill two birds with one stone and seems the better approach to me anyways.

KMSCON does not seem to support ttf fonts, can I start fbterm from withing KMSCON console after I login into it?

Offline

#12 2023-08-17 20:30:17

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

Also KMSCON appears to be dead hmm
Last commit in 2014
Cannot find anything online on alternatives either.

Last edited by me_231231 (2023-08-17 20:43:33)

Offline

#13 2023-08-17 20:55:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: [SOLVED] How to replace the tty in linux with some application?

Don't bump. Edit your previous post if nobody has replied.

The wiki wrote:

Alternatively, install kmscon-patched-gitAUR. The patched version, along with its patched dependency (libtsm-patched-gitAUR), includes fixes and improvements (like 24-bit color support) that the canonical version (which has not been updated since 2014) does not.

Trilby wrote:

But you could autologin and run one of these programs

man agetty, " --login-program"

Offline

#14 2023-08-17 21:10:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [SOLVED] How to replace the tty in linux with some application?

me_231231 wrote:

KMSCON does not seem to support ttf fonts

seem?  It certainly does.  It uses pango for font loading/layout and the wiki page even explicitly recommends having specific ttf fonts installed if one needs CJK support.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2023-08-18 18:21:02

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

I have been able to install and run KMSCON with 256 colors, however I am unable to startx from within KMSCON. It says "Cannot open virtual console 1".
The wiki suggests I enable hwaccel option (this also requires drm option), but it does not help. Disabling them does not help either.

Offline

#16 2023-08-18 18:23:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: [SOLVED] How to replace the tty in linux with some application?

This is for switching forth and back, post your xinitrc and xserverrc and but see https://wiki.archlinux.org/title/Xinit#xserverrc first

Offline

#17 2023-08-18 18:39:59

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

seth wrote:

This is for switching forth and back, post your xinitrc and xserverrc and but see https://wiki.archlinux.org/title/Xinit#xserverrc first

Here is my xserverrc:

#!/bin/sh
exec /usr/bin/X -nolisten tcp "$@" vt$XDG_VTNR

Here is my ~/.xinitrc:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

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

xrandr --auto
exec startxfce4

Also it seems that is not supported due to: https://github.com/dvdhrm/kmscon/issues/65
Do I need to modify the current configuration to make X start on a different vt, like vt7?

Offline

#18 2023-08-18 18:43:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: [SOLVED] How to replace the tty in linux with some application?

Do I need to modify the current configuration to make X start on a different vt, like vt7?

What would be the worst possible outcome if you just tried?

Offline

#19 2023-08-18 18:53:28

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

seth wrote:

Do I need to modify the current configuration to make X start on a different vt, like vt7?

What would be the worst possible outcome if you just tried?

This post says things will break in X: https://unix.stackexchange.com/question … arch-linux
I don't wnat that to happen ofc. So I am unsure what to do so things don't break.

Offline

#20 2023-08-18 18:56:44

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: [SOLVED] How to replace the tty in linux with some application?

You mean the computer might explode into your face and kill you when this happens?

Read the xserverrc wiki entry I linked. It explains why to run X11 on the active console and provides an alternative to that as well.

Offline

#21 2023-08-18 19:14:48

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

seth wrote:

You mean the computer might explode into your face and kill you when this happens?

Read the xserverrc wiki entry I linked. It explains why to run X11 on the active console and provides an alternative to that as well.

Sorry for being extremely dense, but I do not get how to do it. When I did "chvt 7 && export XDG_VTNR=7 && sleep 1 && sudo chown dk:tty /dev/tty7 && startx -- vt7 &" it has thrown me into X without mouse or keyboard or ability to switch vts.
The wiki mentions /usr/lib/systemd/systemd-multi-seat-x but I dont have such file on my system hmm
Both pacman and paru don't have such package for install either.

Offline

#22 2023-08-18 19:25:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: [SOLVED] How to replace the tty in linux with some application?

The "simple" solution here is going to be to run X11 as root (not "sudo" it but use the xorg wrapper)
https://wiki.archlinux.org/title/Xorg#Xorg_as_Root (yes, I know about the warning)

Sorry, that thing apparently got dropped ages ago and nobody fixed the wiki.
https://cgit.freedesktop.org/systemd/sy … 50cd99031e

Offline

#23 2023-08-18 19:50:03

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

seth wrote:

The "simple" solution here is going to be to run X11 as root (not "sudo" it but use the xorg wrapper)
https://wiki.archlinux.org/title/Xorg#Xorg_as_Root (yes, I know about the warning)

Sorry, that thing apparently got dropped ages ago and nobody fixed the wiki.
https://cgit.freedesktop.org/systemd/sy … 50cd99031e

Hmmmmm, I dont want to run Xorg as root, would it be a viable solution to write a script that would make user login on tty? I know I can manually start agetty there with autologin, then there the profile script would execute startx and then we do chvt to over there?
Or I am not allowed to do sudo agetty on a tty7?

Last edited by me_231231 (2023-08-18 19:55:21)

Offline

#24 2023-08-18 20:17:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [SOLVED] How to replace the tty in linux with some application?

Ah, wut?  If you're okay with autologin, none of this is relevant.  Just set up autologin and autostart of X as outlined in the wiki on whichever tty you want X running on.

Or in other words:

Me from 20 posts ago! wrote:

... put a framebuffer loging on all but one virtual terminal / console and have X run on the other.  There are even ways to run X on a console without ever login in to any tty there - though I wouldn't really advise this.

Last edited by Trilby (2023-08-18 20:19:04)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#25 2023-08-18 20:26:32

me_231231
Member
Registered: 2023-08-09
Posts: 42

Re: [SOLVED] How to replace the tty in linux with some application?

Trilby wrote:

Ah, wut?  If you're okay with autologin, none of this is relevant.  Just set up autologin and autostart of X as outlined in the wiki on whichever tty you want X running on.

Or in other words:

Me from 20 posts ago! wrote:

... put a framebuffer loging on all but one virtual terminal / console and have X run on the other.  There are even ways to run X on a console without ever login in to any tty there - though I wouldn't really advise this.

I wanted to not do autologin and start X on tty7, but it seems not possible without running X as root as I mentioned above.
The reason I even considered autologin is so that after the user did login and wants to startx it would go to tt7, but I am unable to do so, wiki points to some utility that is not there anymore.

Last edited by me_231231 (2023-08-18 20:27:01)

Offline

Board footer

Powered by FluxBB