Skip to content

Instantly share code, notes, and snippets.

@saitoha
saitoha / suckless-st-sixel.diff
Last active December 9, 2023 19:02
Add SIXEL graphics support for suckless st. (sixel.c/sixel_hls.c come from mintty, licensed under GPL)
commit ea830e03d4d4562b1ff225940f65bceddd9cad6c
Author: Hayaki Saito <saitoha@me.com>
Date: Sun Jun 11 23:46:45 2017 +0900
Add sixel graphics support
Signed-off-by: Hayaki Saito <saitoha@me.com>
diff --git a/Makefile b/Makefile
index d8595fe..a25d040 100644
@saitoha
saitoha / Makefile
Last active January 16, 2023 13:16
SIXEL color graphics DEMO (xterm pl#301 and gnuplot)
#
# SIXEL color graphics DEMO
#
# xterm pl#301 with --enable-sixel-graphics option
# gnuplot with --with-bitmap-terminals option
#
# Now the color palette of xterm VT-340 mode is limited to 16.
# If you want to change it to 256, apply the following patch.
# https://gist.github.com/saitoha/7822989/raw/20727b88f0f826bfcb9d644907944b29a456b67f/graphics.c.diff
#
@saitoha
saitoha / tmux-SIXEL.patch
Created July 14, 2015 16:21
tmux: SIXEL integration (for mlterm / RLogin, not works on XTerm)
diff --git a/input.c b/input.c
index d1ff17f..33fad13 100644
--- a/input.c
+++ b/input.c
@@ -1805,6 +1805,7 @@ input_dcs_dispatch(struct input_ctx *ictx)
{
const char prefix[] = "tmux;";
const u_int prefix_len = (sizeof prefix) - 1;
+ u_char *p;
@saitoha
saitoha / README.txt
Last active June 19, 2022 09:51
Install mlterm-cocoa via Homebrew
# install
$ brew install https://gist.githubusercontent.com/saitoha/3377f59b0bf87882f319/raw/mlterm-cocoa.rb
# settings
$ mkdir $HOME/.mlterm
$ curl https://gist.githubusercontent.com/saitoha/3377f59b0bf87882f319/raw/color > $HOME/.mlterm/color
$ curl https://gist.githubusercontent.com/saitoha/3377f59b0bf87882f319/raw/font > $HOME/.mlterm/font
$ curl https://gist.githubusercontent.com/saitoha/3377f59b0bf87882f319/raw/main > $HOME/.mlterm/main
@saitoha
saitoha / .vimrc
Created December 3, 2013 22:56
Vimで画像を見る(DRCSのSIXEL拡張の話) ref: http://qiita.com/kefir_/items/78e64c545a70a0ebea8a
" Vimであいまいな幅の文字の論理幅を1にします
set ambiwidth=single
" RLoginであいまいな幅の文字の論理幅を1にします。
call writefile(["\e[?8428h"], '/dev/tty')
@saitoha
saitoha / screen-bracketed-paste-mode.diff
Created June 11, 2012 12:06
bracketed paste mode patch for GNU screen
diff --git a/src/ansi.c b/src/ansi.c
index d88e153..ecc6e69 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -193,6 +193,7 @@ register struct win *p;
p->w_insert = 0;
p->w_revvid = 0;
p->w_mouse = 0;
+ p->w_bracketed = 0;
p->w_curinv = 0;
@saitoha
saitoha / penetrate.py
Last active August 3, 2021 13:31
cat sixel file with penetrating GNU Screen
% screen
% cat test.png | pngtopnm | pnmquant 256 | ppmtosixel | ./penetrate.py && cat
% cat test.png | sixelconv | ./penetrate.py && cat
@saitoha
saitoha / drcsconv.pl
Created June 20, 2012 13:45
Convert image file to VT-320's DRCS format.
#!/usr/bin/env perl
use strict;
use warnings;
if ($#ARGV != 0) {
print "ussage: drcsconv.pl <filename>.";
exit 0;
}
my $file = $ARGV[0];
@saitoha
saitoha / rxvt-unicode-sixel.patch
Last active May 2, 2019 10:17
Add SIXEL graphics support for rxvt-unicode.
diff --git a/src/Makefile.in b/src/Makefile.in
index 18acb39e..ef2e7a40 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -40,7 +40,7 @@ COMMON = \
screen.o scrollbar.o scrollbar-next.o scrollbar-rxvt.o \
scrollbar-xterm.o scrollbar-plain.o xdefaults.o encoding.o \
rxvttoolkit.o rxvtutil.o keyboard.o rxvtimg.o \
- ev_cpp.o fdpass_wrapper.o ptytty_wrapper.o @PERL_O@
+ ev_cpp.o fdpass_wrapper.o ptytty_wrapper.o sixel.o @PERL_O@
@saitoha
saitoha / drcsconv.pl
Last active April 11, 2019 14:10
Convert an image to DRCS characters
#!/usr/bin/env perl
#
# This snippet is in public domain.
#
use strict;
use warnings;
use encoding "UTF-8";
if ($#ARGV != 0) {