Unleashing the Power: TTY, Linux Framebuffer, EGLFS and SDL - Without the weight of Xorg or Wayland

2025-09-13

1. TTY Environment Setup

For efficient management of your terminals and processes, it is essential to use a terminal multiplexer.

if status --is-login  
    if test -z "$DISPLAY" -a $XDG_VTNR = 1  
        exec tmux  
    end  
end  

This will automatically start tmux in the tty number 1 (a terminal multiplexer similar to tmux).
Alternatively, you can use dvtm.

2. Web Browsing from TTY

3. Multimedia Viewing: Images, PDFs, and Videos

My /etc/mpv/mpv.conf:

$ cat /etc/mpv/mpv.conf  
--profile=fast  
--sub-auto=all  
--vo=drm
--ytdl-raw-options="format=bestvideo[height<=?360]+bestaudio/best[height<=?360]/bestvideo[height<=?480]+bestaudio/best[height<=?480],write-auto-sub=,sub-lang=[es,en,ru],write-sub="  
--volume-max=600  
#--save-position-on-quit  
#--untimed  
#--profile=low-latency  
--mute=yes  

My /etc/yt-dlp.conf:

$ cat /etc/yt-dlp.conf  
--format=233+230  
--write-auto-sub  
--write-sub  
--sub-lang=en  
#--cookies-from-browser firefox  

Important: If you use mpv for videos, run it outside tmux; otherwise, you won’t be able to switch between other TTYs.

4. Using Lightweight Graphical Applications in TTY (FrameBuffer: eglfs and linuxfb)

#export QTWEBENGINE_CHROMIUM_FLAGS="--ignore-gpu-blacklist --disable-gpu"
export QTWEBENGINE_CHROMIUM_FLAGS="--ignore-gpu-blacklist"
export QT_QPA_PLATFORM=eglfs  

Then, start your Qt application (e.g., qutebrowser).

export QT_QPA_PLATFORM=linuxfb:size=1000x1000  

To run some applications that normally require a graphical server (like graphical web browsers), you can run it using linuxfb or eglfs.

Always open Qt apps inside a Terminal Multiplexer, otherwise when the application freezes your entire machine will freeze and you won’t be able to use Control+C.

In some Linux distributions, you need to run the following command to get the mouse and keyboard working:
sudo chmod 666 /dev/input/event*
# You need to open the live dashboard first.  
  
falkon "https://www.youtube.com/live_dashboard"  
  
### Stream to YouTube only tty.  
ffmpeg -f alsa -i pipewire -thread_queue_size 1024 -f fbdev -framerate 60 -i /dev/fb0 -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -c:a aac -b:a 128k -f flv -async 1 -ar 48000 -latency 100 -bufsize 1000k rtmp://a.rtmp.youtube.com/live2/KEY 2> /dev/null  
  
#### Stream to YouTube TTY with camera.  
ffmpeg -f alsa -i pipewire -thread_queue_size 1024 -f fbdev -framerate 60 -i /dev/fb0 -f v4l2 -framerate 60 -video_size 320x240 -i /dev/video0 -filter_complex "[2:v]scale=320:240[cam];[1:v][cam]overlay=main_w-overlay_w-10:main_h-overlay_h-10[outv]" -map "[outv]" -map 0:a -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -c:a aac -b:a 128k -f flv -bufsize 1000k rtmp://a.rtmp.youtube.com/live2/KEY 2> /dev/null  
  
### Stream to YouTube full cam.  
ffmpeg -f alsa -i pipewire -thread_queue_size 1024 -f v4l2 -framerate 60 -video_size 1280x720 -i /dev/video0 -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -c:a aac -b:a 128k -f flv -bufsize 1000k rtmp://a.rtmp.youtube.com/live2/KEY 2> /dev/null  
  
### Record video.  
ffmpeg -f alsa -i pipewire -f fbdev -r 30 -i /dev/fb0 record.mp4  
  

5. Additional Tips and Useful Tools

My current alias for web-browsing:

alias dgg 'w3m  dgg.gg'
alias mojeek "w3m https://www.mojeek.com/search?q=hola"
alias wiby "w3m http://wiby.org"
alias news "netsurf-fb -f sdl -w 1366 -h 768 news.ycombinator.com"
alias doom 'cd doom; bash play_doom.sh;'
alias rcommandline "w3m old.reddit.com/r/commandline"
alias google 'w3m  google.com'