diff options
author | Adam T. Carpenter <atc@53hor.net> | 2020-05-19 16:55:44 -0400 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2020-05-19 16:55:44 -0400 |
commit | 86bda792526ffbd675afd3e0841cce517187bde6 (patch) | |
tree | b99117826b702daed7d1b32ac0eac2bc3cc78779 /oldi3status.sh | |
parent | 0ce7301d8799ba91a0d57ab208e2d80d20935a83 (diff) | |
download | scripts-86bda792526ffbd675afd3e0841cce517187bde6.tar.xz scripts-86bda792526ffbd675afd3e0841cce517187bde6.zip |
added screencasting script, mail block, minor tweaks
Diffstat (limited to 'oldi3status.sh')
-rwxr-xr-x | oldi3status.sh | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/oldi3status.sh b/oldi3status.sh deleted file mode 100755 index e1cb415..0000000 --- a/oldi3status.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# Adam's custom i3status script. - -# Configuration variables. -ticker_length=5 # Ticker length in words. - -# Echo the text the ticker should scroll over. No newlines! -init_ticker() { - echo $(fortune | tr -d '\b\r\\' | tr -s '\n\t\v\f' ' ' | tr -s '"' "'") -} - -# Cut up text for ticker tape. -gen_ticker() { - echo $( - echo $text | cut -d' ' -f$word_index-$(( - $word_index + $ticker_length - 1 - )) - ) -} - -# Prints out valid JSON for i3status using given parameters. -printer() { - printf "\"full_text\":\"%s\"," "$1" - printf "\"align\":\"%s\"," "$2" - printf "\"min_width\":%d}," $3 -} - -# Main loop. -i3status | ( - read line && \ - echo "$line" && \ - read line && \ - echo "$line" && \ - read line && \ - echo "$line" && \ - while : -do - # Get i3status line. - read line - - # If ticker text is empty, re-initialize text and word index. Then generate - # ticker text. - [[ -z "$ticker_text" ]] && word_index=1 && text=$(init_ticker) - ticker_text=$(gen_ticker) && ((word_index += 1)) - - # Print i3status header string. - printf ",[{" - - # Print ticker tape JSON. - printer "$ticker_text" "left" 250 - - # Print the rest of the status string. - echo "${line#,\[}" - #printf "%s" $line - -done) |