Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

libchafa API demo: view X11 window in terminal #298

clort81 started this conversation in Show and tell
Discussion options

I felt like playing some games and watching movie in terminal so I made a program to watch any x11 window (by ID) in current terminal.
x11_to_chafa c

It's been working for me and it'd be nice if someone else might enjoy it. I watched half of Barton Fink in 160x50 xterm with block-braille rendering. .. surreal

x11_to_chafa.c

gcc -Os -o x11_to_chafa x11_to_chafa.c -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/local/include/chafa -I/usr/local/lib/chafa/include -L/usr/local/lib -I./stb -lchafa -lX11 -lXext -lXcomposite -lm -lglib-2.0 -lz

You must be logged in to vote

Replies: 1 comment

Comment options

YMMV: if your font has dot-braille (like most do) ⢰ ⢱ ⢲ ⢳ ⢴ ⢵ ⢶ ⢷ ⢸ ⢹ ⢺ ⢻ ⢼ it will look not-so-good.
SOLUTION: link your font here and if it's a bitmap font i'll fix it to have block-braille characters.
bbb_chafa

TODO(?)

  • Pass through terminal keypresses (or X11 keyboard events) to target X11 program.
  • Bridge to ssh/telnet daemon (or make it user's login program)
  • Map ssh keyboard input to game controller 2
fireworksx
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /