Prototype of tmux thumbnailer
This commit is contained in:
parent
a4014b2012
commit
593badefec
12
script/thumbnail.sh
Executable file
12
script/thumbnail.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
# ASCIICAST_ID=666 COLS=80 LINES=20 COMMAND="df; df; df; sleep 10"
|
||||||
|
# DELAY=1 THUMB_LINES=5 THUMB_COLS=10 ./tmux-save.sh
|
||||||
|
|
||||||
|
SESSION_NAME=asciiio-thumb-$ASCIICAST_ID
|
||||||
|
|
||||||
|
tmux new -s $SESSION_NAME -d -x $COLS -y $LINES "$COMMAND"
|
||||||
|
sleep $DELAY
|
||||||
|
tmux capture-pane -t $SESSION_NAME
|
||||||
|
tmux save-buffer - | tail -n $THUMB_LINES | ruby -e "ARGF.lines.each { |l| puts l[0...$THUMB_COLS] }"
|
Loading…
Reference in New Issue
Block a user