dot

packages and services management
Log | Files | Refs | README

commit dcd3bbdda97224aa29636c1af4968d668706dfce
parent a06ac7878a5403598730440e8d1715f5f6497e65
Author: sshbio <jd@ssh.bio>
Date:   Thu, 23 Jun 2016 02:47:47 +0200

Added reference to piano on README and improved structure

Diffstat:
MREADME | 9+++++----
Mbin/dna | 96++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mbin/fig | 2+-
Mbin/piano | 159++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
4 files changed, 150 insertions(+), 116 deletions(-)

diff --git a/README b/README @@ -1,9 +1,9 @@ #!/bin/sh : ' __ - ________╱╲__ ╱╲__ ╲╱____ - ╱ __╱ __╱ __ ╲╱ __ ╲╱╲╱ __ ╲ -__╲ ╲_╲ ╲╱ ╱ ╱ ╱ ╱_╱ ╱ ╱ ╱_╱ ╱ -╲___╱___╱_╱ ╱_╱╲____╱╲╱╲____╱ http://ssh.bio + ________/\__ /\__ \/____ + / __/ __/ __ \/ __ \/\/ __ \ +__\ \_\ \/ / / / /_/ / / /_/ / +\___/___/_/ /_/\____/\/\____/ http://ssh.bio INSTALL @@ -74,6 +74,7 @@ THE SCRIPTS (~/DOT/BIN) fig Single-font Figlet implementations. agenda Terminal agenda viewer that can import ical files. lsync Sync two directories both ways keeping the latest versions. + piano Terminal piano! Dvorak layout only for now... |TT|TTT|TT|TTT| VIM PLUGINS diff --git a/bin/dna b/bin/dna @@ -23,65 +23,65 @@ f1=''; f2=''; f3=''; f4=''; f5=''; f6=''; f7= #===[ DNA BASES ]=============================================================== A="\ - ${f1}O${R} ${f1}O${R} *───* - ╲╲ ╱ ╱ ╲ - ${f3}P${R} ${f4}N${R}. ${f4}N${R}H2 ${f6}│││││││${R} ${f1}O${R} * * - ╱ ╲ ╱╱ \`. ╱ ╲╲ ╱ \`. ,'│ - ${f1}O${R}─ ${f1}O${R} * *───* *───${f4}N${R} \`${f1}O${R}' * - ╱ ╲ ╱╱ ╲╲ ╱ ╲ ╱ - * ,${f1}O${R}. ${f4}N${R}───* ${f4}N${R} ${f6}││││││││${R} H${f4}N${R} * ${f1}O${R} ${f1}O${R}─ - │,' \`. ╱ ╲ ╱ ╲ ╱╱ ╲ ╱ - * * ${f4}N${R}===* *───* ${f3}P${R} - ╲ ╱ ╱╱ ╲ ╱ ╲╲ - *───* Adenine ${f1}O${R} * ${f1}O${R} ${f1}O${R} - │ │ + ${f1}O${R} ${f1}O${R} *---* + \\\\ / / \\ + ${f3}P${R} ${f4}N${R}. ${f4}N${R}H2 ${f6}|||||||${R} ${f1}O${R} * * + / \\ // \`. / \\\\ / \`. ,'| + ${f1}O${R}- ${f1}O${R} * *---* *---${f4}N${R} \`${f1}O${R}' * + / \\ // \\\\ / \\ / + * ,${f1}O${R}. ${f4}N${R}---* ${f4}N${R} ${f6}||||||||${R} H${f4}N${R} * ${f1}O${R} ${f1}O${R}- + |,' \`. / \\ / \\ // \\ / + * * ${f4}N${R}===* *---* ${f3}P${R} + \\ / // \\ / \\\\ + *---* Adenine ${f1}O${R} * ${f1}O${R} ${f1}O${R} + | | " G="\ - ${f1}O${R} ${f1}O${R} *───* - ╲╲ ╱ ╱ ╲ - ${f3}P${R} ${f4}N${R}. ${f1}O${R} ${f6}│││││││${R} H2${f4}N${R} * * - ╱ ╲ ╱╱ \`. ╱╱ ╲ ╱ \`. ,'│ - ${f1}O${R}─ ${f1}O${R} * *───* *───${f4}N${R} \`${f1}O${R}' * - ╱ ╲ ╱╱ ╲ ╱ ╲ ╱ - * ,${f1}O${R}. ${f4}N${R}───* ${f4}N${R}H ${f6}││││││││${R} ${f4}N${R} * ${f1}O${R} ${f1}O${R}─ - │,' \`. ╱ ╲ ╱ ╲╲ ╱╱ ╲ ╱ - * * ${f4}N${R}===* *───* ${f3}P${R} - ╲ ╱ ╲ ╱╱ ╱ ╲╲ - *───* Guanine ${f4}N${R}H2 ${f6}│││││││${R} ${f1}O${R} ${f1}O${R} ${f1}O${R} - │ │ + ${f1}O${R} ${f1}O${R} *---* + \\\\ / / \\ + ${f3}P${R} ${f4}N${R}. ${f1}O${R} ${f6}|||||||${R} H2${f4}N${R} * * + / \\ // \`. // \\ / \`. ,'| + ${f1}O${R}- ${f1}O${R} * *---* *---${f4}N${R} \`${f1}O${R}' * + / \\ // \\ / \\ / + * ,${f1}O${R}. ${f4}N${R}---* ${f4}N${R}H ${f6}||||||||${R} ${f4}N${R} * ${f1}O${R} ${f1}O${R}- + |,' \`. / \\ / \\\\ // \\ / + * * ${f4}N${R}===* *---* ${f3}P${R} + \\ / \\ // / \\\\ + *---* Guanine ${f4}N${R}H2 ${f6}|||||||${R} ${f1}O${R} ${f1}O${R} ${f1}O${R} + | | " C="\ - ${f1}O${R} ${f1}O${R} ${f1}O${R} ${f6}│││││││${R} H2${f4}N${R} *───* - ╲╲ ╱ ╱╱ ╲ ╱ ╲ - ${f3}P${R} *───* *===${f4}N${R} * * - ╱ ╲ ╱╱ ╲╲ ╱ ╲ ╱ \`. ,'│ - ${f1}O${R}─ ${f1}O${R} * ${f4}N${R} ${f6}││││││││${R} H${f4}N${R} *───${f4}N${R} \`${f1}O${R}' * - ╱ ╲ ╱ ╲ ╱╱ ╲ ╱ - * ,${f1}O${R}. ${f4}N${R}───* *───* * ${f1}O${R} ${f1}O${R}─ - │,' \`. ╱ ╲ ╱╱ \`. ╱╱ ╲ ╱ - * * ${f4}N${R}H2 ${f6}│││││││${R} ${f1}O${R} \`${f4}N${R} ${f3}P${R} - ╲ ╱ ╱ ╲╲ - *───* Cytosine ${f1}O${R} ${f1}O${R} - │ │ + ${f1}O${R} ${f1}O${R} ${f1}O${R} ${f6}|||||||${R} H2${f4}N${R} *---* + \\\\ / // \\ / \\ + ${f3}P${R} *---* *===${f4}N${R} * * + / \\ // \\\\ / \\ / \`. ,'| + ${f1}O${R}- ${f1}O${R} * ${f4}N${R} ${f6}||||||||${R} H${f4}N${R} *---${f4}N${R} \`${f1}O${R}' * + / \\ / \\ // \\ / + * ,${f1}O${R}. ${f4}N${R}---* *---* * ${f1}O${R} ${f1}O${R}- + |,' \`. / \\ // \`. // \\ / + * * ${f4}N${R}H2 ${f6}|||||||${R} ${f1}O${R} \`${f4}N${R} ${f3}P${R} + \\ / / \\\\ + *---* Cytosine ${f1}O${R} ${f1}O${R} + | | " T="\ - ${f1}O${R} ${f1}O${R} * ${f1}O${R} *───* - ╲╲ ╱ ╲ ╱╱ ╱ ╲ - ${f3}P${R} *───* *===${f4}N${R} * * - ╱ ╲ ╱╱ ╲ ╱ ╲ ╱ \`. ,'│ - ${f1}O${R}─ ${f1}O${R} * ${f4}N${R}H ${f6}││││││││${R} ${f4}N${R} *───${f4}N${R} \`${f1}O${R}' * - ╱ ╲ ╱ ╲╲ ╱╱ ╲ ╱ - * ,${f1}O${R}. ${f4}N${R}───* *───* * ${f1}O${R} ${f1}O${R}─ - │,' \`. ╱ ╲╲ ╱ \`. ╱╱ ╲ ╱ - * * ${f1}O${R} ${f6}│││││││${R} H2${f4}N${R} \`${f4}N${R} ${f3}P${R} - ╲ ╱ ╱ ╲╲ - *───* Thymine ${f1}O${R} ${f1}O${R} - │ │ + ${f1}O${R} ${f1}O${R} * ${f1}O${R} *---* + \\\\ / \\ // / \\ + ${f3}P${R} *---* *===${f4}N${R} * * + / \\ // \\ / \\ / \`. ,'| + ${f1}O${R}- ${f1}O${R} * ${f4}N${R}H ${f6}||||||||${R} ${f4}N${R} *---${f4}N${R} \`${f1}O${R}' * + / \\ / \\\\ // \\ / + * ,${f1}O${R}. ${f4}N${R}---* *---* * ${f1}O${R} ${f1}O${R}- + |,' \`. / \\\\ / \`. // \\ / + * * ${f1}O${R} ${f6}|||||||${R} H2${f4}N${R} \`${f4}N${R} ${f3}P${R} + \\ / / \\\\ + *---* Thymine ${f1}O${R} ${f1}O${R} + | | " dna=$1 diff --git a/bin/fig b/bin/fig @@ -204,7 +204,7 @@ do l3="$l3"'/ / / /' l4="$l4"' \ \/ /' l5="$l5"' __\ /' - l6="$l6"" \\_,-'" + l6="$l6"" \\_,-'" ;; z) l1="$l1"' ' diff --git a/bin/piano b/bin/piano @@ -5,99 +5,132 @@ # / /_/ / / // /_/ // / / // /_/ / # / ____/ \/ \____/ \/ \/ \____/ - Console beep piano! #=\/============================================================================ -# -# QWERTY (not implemented): + +BEGIN { + +#===[ KEYBOARD LAYOUT ]========================================================= + +# QWERTY # ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ # |Esc |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10 |F11 |F12 |Del | # |____|____|____|____|____|____|____|____|____|____|____|____|____|______| # |` ~ |1 ! |2 @ |3 # |4 $ |5 % |6 ^ |7 & |8 * |9 ( |0 ) |- _ |= + |Bkspc | # |____|____|____|____|____|____|____|____|____|____|____|____|____|______| # |Tab |Q |W |E |R |T |Y |U |I |O |P |[ { |] } | | -# |_____|____|____|____|____|____|____|____|____|____|____|____|____| | | -# |Caps |A |S |D |F |G |H |J |K |L |; : |' " | <-' | -# |______|____|____|____|____|____|____|____|____|____|____|____|_________| +# |_____|____|____|____|____|____|____|____|____|____|____|____|____| <-' | +# |Caps |A |S |D |F |G |H |J |K |L |; : |' " |\ | | | +# |______|____|____|____|____|____|____|____|____|____|____|____|____|____| # |Shift |Z |X |C |V |B |N |M |, < |. > |/ ? |Shift | # |_______|____|____|____|____|____|____|____|____|____|____|_____________| -# |Ctrl |Super |Alt |Space |Alt Gr |Opt |Ctrl | -# |______|______|______|_______________________________|_______|____|_____| -# -# DVORAK (implemented): +# |Ctrl |Super |Alt |Space |Alt Gr|Opt |Ctrl | +# |______|______|______|_______________________________|______|_____|_____| + + # Bottom two rows Top two rows + qwerty = "zsxdcvgbhnjm,l.;/" "q2w3er5t6y7ui9o0p[=]"; # Without shift + QWERTY = "ZSXDCVGBHNJM<L>:/" "Q@W#ER5T^Y&UI(O)P{+}"; # With shift + qwerty = qwerty QWERTY; + +# DVORAK # ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ # |Esc |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10 |F11 |F12 |Del | # |____|____|____|____|____|____|____|____|____|____|____|____|____|______| # |` ~ |1 ! |2 @ |3 # |4 $ |5 % |6 ^ |7 & |8 * |9 ( |0 ) |[ { |] } |Bkspc | # |____|____|____|____|____|____|____|____|____|____|____|____|____|______| # |Tab |' " |, < |. > |P |Y |F |G |C |R |L |/ ? |= + | | -# |_____|____|____|____|____|____|____|____|____|____|____|____|____| | | -# |Caps |A |O |E |U |I |D |H |T |N |S : |- _ | <-' | -# |______|____|____|____|____|____|____|____|____|____|____|____|_________| +# |_____|____|____|____|____|____|____|____|____|____|____|____|____| <-' | +# |Caps |A |O |E |U |I |D |H |T |N |S |- _ |\ | | | +# |______|____|____|____|____|____|____|____|____|____|____|____|____|____| # |Shift |; : |Q |J |K |X |B |M |W |V |Z |Shift | # |_______|____|____|____|____|____|____|____|____|____|____|_____________| -# |Ctrl |Super |Alt |Space |Alt Gr |Opt |Ctrl | -# |______|______|______|_______________________________|_______|____|_____| -# +# |Ctrl |Super |Alt |Space |Alt Gr|Opt |Ctrl | +# |______|______|______|_______________________________|______|_____|_____| + + # Bottom two rows Top two rows + dvorak = ";oqejkixdbhmwnvsz" "'2,3.p5y6f7gc9r0l/]="; # Without shift + DVORAK = ":OQEJKIXDBHMWNVSZ" "\"@<#>P%Y^F&GC(R)L?}+"; # With shift + dvorak = dvorak DVORAK; + + layout = dvorak; + #===[ NOTES FREQUENCIES ]======================================================= -BEGIN { + C0 = 16 " "; Cd0 = 17 " "; D0 = 18 " "; Dd0 = 19 " "; + E0 = 21 " "; F0 = 22 " "; Fd0 = 23 " "; G0 = 25 " "; + Gd0 = 26 " "; A0 = 28 " "; Ad0 = 29 " "; B0 = 31 " "; + C1 = 33 " "; Cd1 = 35 " "; D1 = 37 " "; Dd1 = 39 " "; + E1 = 41 " "; F1 = 44 " "; Fd1 = 46 " "; G1 = 49 " "; + Gd1 = 52 " "; A1 = 55 " "; Ad1 = 58 " "; B1 = 62 " "; + C2 = 65 " "; Cd2 = 69 " "; D2 = 73 " "; Dd2 = 78 " "; + E2 = 82 " "; F2 = 87 " "; Fd2 = 93 " "; G2 = 98 " "; + Gd2 = 104 " "; A2 = 110 " "; Ad2 = 117 " "; B2 = 123 " "; + C3 = 131 " "; Cd3 = 139 " "; D3 = 147 " "; Dd3 = 156 " "; + E3 = 165 " "; F3 = 175 " "; Fd3 = 185 " "; G3 = 196 " "; + Gd3 = 208 " "; A3 = 220 " "; Ad3 = 233 " "; B3 = 247 " "; + C4 = 262 " "; Cd4 = 277 " "; D4 = 294 " "; Dd4 = 311 " "; + E4 = 330 " "; F4 = 349 " "; Fd4 = 370 " "; G4 = 392 " "; + Gd4 = 415 " "; A4 = 440 " "; Ad4 = 466 " "; B4 = 494 " "; + C5 = 523 " "; Cd5 = 554 " "; D5 = 587 " "; Dd5 = 622 " "; + E5 = 659 " "; F5 = 698 " "; Fd5 = 740 " "; G5 = 784 " "; + Gd5 = 831 " "; A5 = 880 " "; Ad5 = 932 " "; B5 = 988 " "; + C6 = 1047 " "; Cd6 = 1109 " "; D6 = 1175 " "; Dd6 = 1245 " "; + E6 = 1319 " "; F6 = 1397 " "; Fd6 = 1480 " "; G6 = 1568 " "; + Gd6 = 1661 " "; A6 = 1760 " "; Ad6 = 1865 " "; B6 = 1976 " "; + C7 = 2093 " "; Cd7 = 2217 " "; D7 = 2349 " "; Dd7 = 2489 " "; + E7 = 2637 " "; F7 = 2794 " "; Fd7 = 2960 " "; G7 = 3136 " "; + Gd7 = 3322 " "; A7 = 3520 " "; Ad7 = 3729 " "; B7 = 3951 " "; + C8 = 4186 " "; Cd8 = 4435 " "; D8 = 4699 " "; Dd8 = 4978 " "; + E8 = 5274 " "; F8 = 5588 " "; Fd8 = 5920 " "; G8 = 6272 " "; + Gd8 = 6645 " "; A8 = 7040 " "; Ad8 = 7459 " "; B8 = 7902 " "; + +#===[ NOTES SELECTION ]========================================================= + print "\ - _________________________________________________________________________...\n\ - | | | | | | | | | | | | | | | | | | | | | | | | | \n\ - | |Db| |Eb| | |Gb| |Ab| |Bb| | |Db| |Eb| | |Gb| |Ab| |Bb| | \n\ - | |C#| |D#| | |F#| |G#| |A#| | |C#| |D#| | |F#| |G#| |A#| | \n\ - | |__| |__| | |__| |__| |__| | |__| |__| | |__| |__| |__| | \n\ - | | | | | | | | | | | | | | | \n\ - | C | D | E | F | G | A | B | C | D | E | F | G | A | B | \n\ - |____|____|____|____|_____|____|____|____|____|____|____|_____|____|____|...\n\ - \n\ - ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ \n\ - |Esc |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10 |F11 |F12 |Del | \n\ - |____|____|____|____|____|____|____|____|____|____|____|____|____|______| \n\ - | |C#Db|D#Eb| |F#Gb|G#Ab|A#Bb| |C#Db|D#Eb| |F#Ab|A#Bb|Bkspc | \n\ - |____|____|____|____|____|____|____|____|____|____|____|____|____|______| \n\ - |Tab |D |E |F |G |A |B |C |D |E |F |G |A | | \n\ - |_____|____|____|____|____|____|____|____|____|____|____|____|____| | | \n\ - |Caps |G#Ab|A#Bb| |C#Eb|D#Eb| |F#Gb|G#Ab|A#Bb| |C#Db| <-' | \n\ - |______|____|____|____|____|____|____|____|____|____|____|____|_________| \n\ - |Shift |A |B |C |D |E |F |G |A |B |C |Shift | \n\ - |_______|____|____|____|____|____|____|____|____|____|____|_____________| \n\ - |Ctrl |Super |Alt |Space |Alt Gr |Opt |Ctrl | \n\ - |______|______|______|_______________________________|_______|____|_____| \n\ -" - dvorak = "a;oqjukixbhmtwnvz-1" "'" "2,.4p5y6fg8c9rl[/]="; - DVORAK = "A:OQJUKIXBHMTWNVZ_1" "\"" "2<>4P5Y6FG8C9RL{?}+"; - - layout = dvorak DVORAK; - -#Gd3 A3 Ad3 B3 C4 Cd4 D4 Dd4 E4 F4 Fd4 G4 Gd4 A4 Ad4 -#B4 C5 Cd5 D5 Dd5 E5 F5 Fd5 G5 Gd5 A5 Ad5 B5 C6 Cd6 -#D6 A6 Ad6 B6 C7 Cd7 D7 Dd7 E7 F7 Fd7 G7 Gd7 A7 Ad7 -#B7 C8 Cd8 D8 Dd8 E8 F8 Fd8 G8 Gd8 A8 Ad8 - split(\ -"208 220 233 247 262 277 294 311 330 349 370 392 415 440 466 " \ -"494 523 554 587 622 659 698 740 784 831 880 932 988 1047 1109 " \ -"1175 1760 1865 1976 2093 2217 2349 2489 2637 2794 2960 3136 3322 3520 3729 " \ -"3951 4186 4435 4699 4978 5274 5588 5920 6272 6645 7040 7459", - freq, " "); + _________________________________________________________________________\n\ + | | | | | | | | | | | | | | | | | | | | | | | | |\n\ + | |Db| |Eb| | |Gb| |Ab| |Bb| | |Db| |Eb| | |Gb| |Ab| |Bb| |\n\ + | |C#| |D#| | |F#| |G#| |A#| | |C#| |D#| | |F#| |G#| |A#| |\n\ + | |__| |__| | |__| |__| |__| | |__| |__| | |__| |__| |__| |\n\ + | | | | | | | | | | | | | | |\n\ + | C | D | E | F | G | A | B | C | D | E | F | G | A | B |\n\ + |____|____|____|____|_____|____|____|____|____|____|____|_____|____|____|\n\ +\n\ + ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ______ \n\ + |Esc |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10 |F11 |F12 |Del |\n\ + |____|____|____|____|____|____|____|____|____|____|____|____|____|______|\n\ + | | |C#Eb|D#Eb| |F#Gb|G#Ab|A#Bb| |C#Db|D#Ab| |F#Gb|Bkspc |\n\ + |____|____|____|____|____|____|____|____|____|____|____|____|____|______|\n\ + |Tab |C |D |E |F |G |A |B |C |D |E |F |G | |\n\ + |_____|____|____|____|____|____|____|____|____|____|____|____|____| <-' |\n\ + |Caps | |C#Eb|D#Eb| |F#Gb|G#Ab|A#Bb| |C#Db|D#Eb| | | |\n\ + |______|____|____|____|____|____|____|____|____|____|____|____|____|____|\n\ + |Shift |C |D |E |F |G |A |B |C |D |E |Shift |\n\ + |_______|____|____|____|____|____|____|____|____|____|____|_____________|\n\ + |Ctrl |Super |Alt |Space (increase duration) |Alt Gr|Opt |Ctrl |\n\ + |______|______|______|_______________________________|______|_____|_____|\n" + + row1 = C2 Cd2 D2 Dd2 E2 F2 Fd2 G2 Gd2 A2 Ad2 B2 C3 Cd3 D3 Dd3 E3; + row2 = C3 Cd3 D3 Dd3 E3 F3 Fd3 G3 Gd3 A3 Ad3 B3 C4 Cd4 D4 Dd4 E4 F4 Fd4 G4; + ROW1 = row1; + ROW2 = C4 Cd4 D4 Dd4 E4 F4 Fd4 G4 Gd4 A4 Ad4 B4 C5 Cd5 D5 Dd5 E5 F5 Fd5 G5; +#===[ ALGORYTHM ]=============================================================== + + split(row1 row2 ROW1 ROW2, frequencies, " "); while (1) { - # Get the key from the user cmd = "dd bs=1 count=1 if=/dev/tty 2>/dev/null" system("stty raw -echo"); cmd | getline key system("stty -raw echo"); close(cmd); - # Exit with ^C if (key == "") { exit; - } - - # Find the corresponding note using the layout and freq - note = freq[index(layout, key)]; - - if (note != "") { - system("beep -l 60 -f " note); + } else if (key == " ") { + duration = duration * 2; + } else if (note = frequencies[index(layout, key)]) { + system("beep -l " duration * 100 " -f " note); + duration = 1; } } }