Skip to content

Commit 2d690ea

Browse files
authored
Merge pull request #80 from 0xacx/support-kitty-term-image-view
Support kitty term image view
2 parents d0446e2 + d11cb84 commit 2d690ea

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

chatgpt.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ while $running; do
302302
curl -sS $image_url -o temp_image.png
303303
imgcat temp_image.png
304304
rm temp_image.png
305+
elif [[ "$TERM" == "xterm-kitty" ]]; then
306+
curl -sS $image_url -o temp_image.png
307+
kitty +kitten icat temp_image.png
308+
rm temp_image.png
305309
else
306310
echo "Would you like to open it? (Yes/No)"
307311
read -e answer

install.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
2727
fi
2828
fi
2929

30+
# Installing magick if using kitty
31+
if [[ "$TERM" == "xterm-kitty" ]]; then
32+
if [[ ! $(which magick) ]]; then
33+
curl -sS https://imagemagick.org/archive/binaries/magick -o /usr/local/bin/magick
34+
chmod +x /usr/local/bin/magick
35+
echo "Installed magick"
36+
fi
37+
fi
38+
3039
# Installing chatgpt script
3140
curl -sS https://raw.githubusercontent.com/0xacx/chatGPT-shell-cli/main/chatgpt.sh -o /usr/local/bin/chatgpt
3241

0 commit comments

Comments
 (0)