Skip to content

Instantly share code, notes, and snippets.

@muralisc
Last active November 21, 2017 00:22
Show Gist options
  • Save muralisc/c0f6c2093e6c40c9d9f7 to your computer and use it in GitHub Desktop.
Save muralisc/c0f6c2093e6c40c9d9f7 to your computer and use it in GitHub Desktop.
A quick script for creating screenshots of colorschemes in "flazz/vim-colorschemes"
#!/bin/bash
geo=235x65+0+0
cSchemes=`ls -1 ~/.vim/bundle/vim-colorschemes/colors | sed 's/.vim$//'`
for currentScheme in $cSchemes
do
sed -i "s/^colorscheme .*/colorscheme $currentScheme/" ~/.vimrc
urxvt --geometry $geo -e vim ~/.vimrc &
pid=$!
sleep 0.25 # VERY IMPORTANT for this gap for the window to form
# sometimes the status bar wont apprear . Press 'j' to make it appear
xdotool key --window `xwininfo -name "vim"| grep ' id'| awk '{print $4}' | xargs printf "%d\n"` j
sleep 0.25 # VERY IMPORTANT for this gap for the screenshot to capture
scrot ${currentScheme}.png
kill $pid
done
rm vimCSscreenshots.tgz
tar czf vimCSscreenshots.tgz *.png
rm *.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment