Skip to content

Instantly share code, notes, and snippets.

@eggplants
Last active March 6, 2024 17:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eggplants/04fa8e4af972098c6db05c0838d99a16 to your computer and use it in GitHub Desktop.
Save eggplants/04fa8e4af972098c6db05c0838d99a16 to your computer and use it in GitHub Desktop.
On Ubuntu 21.04, this script enables gnome-terminal to show sixel images. (Ref: https://www.kofuk.org/blog/20210803-vte-sixel/, https://twitter.com/man_2_fork/status/1422514528886030337?s=19 )
#!/usr/bin/env -S bash -e
# REPO='https://gitlab.gnome.org/GNOME/vte.git'
REPO='https://github.com/GNOME/vte.git'
LIBPATH='/usr/local/lib/x86_64-linux-gnu'
LDCONFPATH='/etc/ld.so.conf'
# See Deps:
# https://github.com/GNOME/vte/blob/master/meson.build
# On Ubuntu 21.04, GNOME-Terminal 3.38.1:
pip install meson
sudo apt install build-essential git libfribidi-dev \
libgirepository1.0-dev libglib2.0-dev \
libgnutls28-dev libpango1.0-dev libpcre2-8-0 \
libpthread-stubs0-dev libsystemd-dev ninja-build \
python3-pip valac zlib1g-dev -y
(
[ -d "./vte/.git" ] || {
git clone --depth 1 "$REPO" vte
}
cd vte
meson . _build -Dsixel=true && cd _build && ninja
sudo ninja install
grep -q "$LIBPATH" "$LDCONFPATH" || {
sudo sed -i "1iinclude $LIBPATH" "$LDCONFPATH"
sudo ldconfig
}
)
echo -n "done! kill all gnome-terminal-server?(n/y): "
read -r i
[ "$i" = "y" ] && killall gnome-terminal-server
@eggplants
Copy link
Author

image

@eggplants
Copy link
Author

eggplants commented Aug 3, 2021

Test

go get github.com/mattn/go-sixel/cmd/gosr
sudo apt-get install -y libsixel-bin

byobu - Running

image

byobu - Not running

image

@eggplants
Copy link
Author

sudo apt install w3m
w3m -sixel google.com

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment