this repo has no description
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'master' of https://github.com/icyphox/shlide

Akshay 0cc2b403 bd9835c3

+16 -7
+16 -7
shlide
··· 31 31 } 32 32 33 33 colorify() { 34 + # 'eval' hack to achieve substitution for colors. 34 35 eval "declare dummy=\"$1\"" 35 36 printf '%b' "$dummy" 36 37 } 37 38 39 + # Filter out color sequences. 38 40 shopt -s extglob 39 41 ansi_filter() { 40 - local IFS= 41 - echo "${1//$'\e'[\[(]*([0-9;])[@-n]/}" 42 - #/" a little fix to keep my vim syntax hl sane 42 + local IFS= 43 + echo "${1//$'\e'[\[(]*([0-9;])[@-n]/}" 44 + #" A little fix to prevent vim syntax highlighting from breaking. 43 45 } 44 46 45 47 ··· 91 93 92 94 } 93 95 96 + die() { 97 + printf '\e[?25h' 98 + exit 0 99 + } 100 + 94 101 display_end() { 95 102 read -r LINES COLUMNS < <(stty -F /dev/tty size) 96 103 ((l=$LINES/2)) ··· 108 115 while true; do 109 116 # Clear the screen. 110 117 printf '\e[2J' 118 + 119 + # Capture Ctrl+C. 120 + trap 'die' INT 121 + 111 122 # Display END reached prompt, and then exit 112 123 [[ "$i" -eq "${#slides[@]}" ]] && { 113 124 display_end ··· 115 126 case "$input" in 116 127 "j"|"n"|"q") 117 128 printf '\e[2J' 118 - printf '\e[?25h' 119 - exit 129 + die 120 130 ;; 121 131 *) 122 132 ((--i)) ··· 139 149 ;; 140 150 "q") 141 151 # Return the cursor on exit. 142 - printf '\e[?25h' 143 - exit 152 + die 144 153 ;; 145 154 esac 146 155 done