slide deck presentation tool written in pure bash
6
fork

Configure Feed

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

add 0 and G motions

Akshay a4a20985 e5d1a8d9

+11 -4
+11 -4
shlide
··· 126 126 127 127 slides_dir="${1:-./}" 128 128 slides=("$slides_dir"/[0-9]*.txt) 129 + total="${#slides[@]}" 129 130 i=0 130 - while true; do 131 + while :; do 131 132 # Clear the screen. 132 133 printf '\e[2J' 133 134 ··· 135 136 trap 'die' INT 136 137 137 138 # Display END reached prompt, and then exit. 138 - [[ "$i" -eq "${#slides[@]}" ]] && { 139 + [[ "$i" -eq "$total" ]] && { 139 140 display_end 140 141 read -rsn1 input 141 142 case "$input" in ··· 143 144 die 144 145 ;; 145 146 *) 146 - ((--i)) 147 + ((i=0)) 147 148 ;; 148 149 esac 149 150 } ··· 152 153 [[ "$i" -lt 0 ]] && i=0 153 154 154 155 # Navigate on j/k/n/p and quit on q. 155 - display "$(<"${slides[$i]}")" "${slides[$i]}" "$i" "${#slides[@]}" 156 + display "$(<"${slides[$i]}")" "${slides[$i]}" "$i" "$total" 156 157 read -rsn1 input 157 158 case "$input" in 158 159 "j"|"n"|"") ··· 160 161 ;; 161 162 "k"|"p") 162 163 ((--i)) 164 + ;; 165 + "0") 166 + ((i=0)) 167 + ;; 168 + "G") 169 + ((i=total-1)) 163 170 ;; 164 171 "q") 165 172 # Return the cursor on exit.