dot

packages and services management
Log | Files | Refs | README

commit 5bc8b6a444c66758d09e8c46113049114885b5c5
parent 191541d5de6dd158ebee1549aa3ff39cfd1f256a
Author: josuah <mail@josuah.net>
Date:   Sun, 18 Dec 2016 17:10:43 +0000

Added a script to prompt for a theme to set

Diffstat:
M.local/bin/piano | 19+++++++++++++++----
M.local/bin/tty-theme | 319+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
M.profile | 5++---
MREADME | 8++++----
4 files changed, 332 insertions(+), 19 deletions(-)

diff --git a/.local/bin/piano b/.local/bin/piano @@ -43,7 +43,9 @@ BEGIN { # |Ctrl |Super |Alt |Space |Alt Gr|Opt |Ctrl | # |______|______|______|_______________________________|______|_____|_____| - # Bottom two rows Top two rows + # map the keys to row positions + + # 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; @@ -106,25 +108,34 @@ BEGIN { |Ctrl |Super |Alt |Space |Alt Gr|Opt |Ctrl |\n\ |______|______|______|_______________________________|______|_____|_____|\n" + # map the notes to rows positions row1 = C3 Cd3 D3 Dd3 E3 F3 Fd3 G3 Gd3 A3 Ad3 B3 C4 Cd4 D4 Dd4 E4; row2 = C4 Cd4 D4 Dd4 E4 F4 Fd4 G4 Gd4 A4 Ad4 B4 C5 Cd5 D5 Dd5 E5 F5 Fd5 G5; - # algorythm + # convert the text line of frequencies into an array of frequencies + split(row1 row2, frequencies, ""); - split(row1 row2, frequencies, " "); + # main execution loop while (1) { + # get one character at a time from stdin (keyboard) 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); + # check which key it is, and play corresponding note + + # if Ctrl + C, quit if (key == "") { exit; + + # else, get the note from the array using key position in layout } else if (note = frequencies[index(layout, key)]) { - system("speaker-test -t sine -f " note "& pid=$! && sleep 0.5 && kill -9 $pid &"); + # play the note with this frequency with some command + system("beep -f " note "&"); } } } diff --git a/.local/bin/tty-theme b/.local/bin/tty-theme @@ -1,14 +1,317 @@ -# Set the theme for the tty from a simple theme file format +# Set the theme for the tty from a simple file format -set_theme() -{ - while read -r color hex comments - do - [ "$hex" ] printf '033]P%s%s' "$color" "$hex" - done < "$1" -} +# normal bold +# 0 8 black +# 1 9 red +# 2 A green +# 3 B orange +# 4 C blue +# 5 D magenta +# 6 E cyan +# 7 F white THEMES=' +alien + +0 000910 +1 ccccbb +2 aaddbb +3 aaddaa +4 aacccc +5 bbbbcc +6 aaddcc +7 cceedd +8 aaccbb +9 ddddcc +A bbeecc +B cceebb +C bbdddd +D ccccdd +E bbeedd +F fff0f8 + + +coal + +0 000000 +1 ee3333 +2 88ff44 +3 ffcc55 +4 77aaaa +5 85678f +6 55ee99 +7 cccccc +8 555555 +9 ff6666 +A aaff66 +B ffff99 +C aaddff +D b294bb +E 99ffbb +F ffffff + + +drakula + +0 282a36 +1 cc4343 +2 42c763 +3 ffb86c +4 6272a4 +5 bd93f9 +6 6fb9c9 +7 e6e6d5 +8 888db4 +9 ff5555 +A 50fa7b +B f1fa8c +C 8196d6 +D ff79c6 +E 8be9fd +F ffffff + + +exo + +0 350600 +1 e62828 +2 77b23e +3 d6722e +4 689db3 +5 936599 +6 30c87e +7 acf88d +8 9b6963 +9 ff5454 +A a0d669 +B ff9e5d +C 94dfff +D 9b78ce +E 77ffbd +F ffffff + + +ghost + +0 000000 +1 91265C +2 439a64 +3 ccdd66 +4 55aaaa +5 516583 +6 4a8f86 +7 99bbbb +8 334444 +9 E71E5B +A 72f4a0 +B f5ff8B +C 99bbff +D 676cb0 +E 00ffff +F ffffff + + +gotham + +0 0a0f14 +1 c33027 +2 26a98b +3 edb54c +4 195465 +5 4e5165 +6 33859d +7 98d1ce +8 406068 +9 d26939 +A 30dbb3 +B ffd280 +C 268099 +D 888ba5 +E 599caa +F d3ebe9 + + +gruvbox + +0 282828 +1 cc241d +2 98971a +3 d79921 +4 458588 +5 b16286 +6 689d6a +7 d5c4a1 +8 928374 +9 fb4934 +A b8bb26 +B fabd2f +C 83a598 +D d2869b +E 8ec07c +F ffffff + + +matrix + +0 000000 +1 883300 +2 00aa55 +3 55aa33 +4 339977 +5 668877 +6 119977 +7 77dd77 +8 338833 +9 aa7733 +A 00ff88 +B 88ee66 +C 33dd88 +D 77bb99 +E 66ddbb +F ddffdd + + +monokai + +0 48483e +1 dc2566 +2 8fc029 +3 d4c96e +4 55bcce +5 9358fe +6 56b7a5 +7 acada1 +8 76715e +9 fa2772 +A a7e22e +B e7db75 +C 66d9ee +D ae82ff +E 66efd5 +F dfe1d3 + + +pink + +0 090a0f +1 f44444 +2 28684f +3 c8907e +4 422d52 +5 710130 +6 2a7e86 +7 bbbbbb +8 3e4053 +9 f44444 +A 43c291 +B f49a7e +C 542a52 +D 9e0f37 +E 688e95 +F ffffff + + +solarized-dark + +0 002b36 +1 dc322f +2 859900 +3 b58900 +4 268bd2 +5 6c71c4 +6 2aa198 +7 93a1a1 +8 657b83 +9 dc322f +A 859900 +B b58900 +C 268bd2 +D 6c71c4 +E 2aa198 +F fdf6e3 + + +solarized-light + +0 ffddbb +1 d0154b +2 779900 +3 ffa700 +4 096daf +5 dd6699 +6 00aa88 +7 000000 +8 bb9988 +9 d0154b +A 779900 +B ffa700 +C 096daf +D 897f74 +E 00aa88 +F 222222 + + +zenburn + +0 191d1b +1 9C6363 +2 60b48a +3 dfaf8f +4 506070 +5 dc8cc3 +6 8cd0d3 +7 dcdccc +8 709080 +9 dca3a3 +A bfebbf +B f0dfaf +C 94bff3 +D ec93d3 +E 93e0e3 +F ffffff ' + +show=0 +while read -r color hex +do + if [ "$hex" ] + then + themes="$themes\033]P$color$hex" + show=1 + elif [ "$color" ] + then + name="$color" + elif [ "$show" -eq 1 ] + then + i=$((i + 1)) + + themes="$themes\033[K " + for c in 0 1 2 3 4 5 6 7 + do + themes="$themes \033[3${c}m___\033[1m___\033[m" + done + themes="$themes\r $name\r $i\n\033[K\n" + + show=0 + fi +done << EOF +$THEMES +EOF + + +if [ -z "$1" ] +then + printf "\033[H\033[J$themes\033]P0000000\033]P7aaaaaa\033[J\n" + read -p "Enter the number of a theme: " number +else + number="$1" +fi + + +printf '\033[%s;0H\033[J' "$((number * 2 - 1))" + +printf "$themes" | cut -d ' +' -f "$((number * 2 - 1))" +printf '\033[J\n' diff --git a/.profile b/.profile @@ -21,10 +21,10 @@ export TERM='screen' # mail export NAME='Josuah Demangeon' export EMAIL='mail@josuah.net' -export MAIL="$HOME/Mail/INBOX" +export MAIL="$HOME/mail/INBOX" # default commands -export EDITOR="vis" +export EDITOR="vim" export VISUAL="$EDITOR" export FCEDIT="$EDITOR" export PAGER="less" @@ -233,7 +233,6 @@ screencast() } - # Startup #_______________________________________________________________________________ diff --git a/README b/README @@ -12,16 +12,17 @@ ________________________________________________________________________________ and install packages in ~/programs/<program_name>, and setup symlinks to .local/ as a local root directory. - This file is the installer script.' + This file is the installer script. You can run it.' cd "${0%/*}" || exit 1 find -type d ! -path './.git*' -path './.*' -exec mkdir -p ~/{} \; find -type f ! -path './.git*' -path './.*' -exec ln -sf "$PWD/{}" ~/{} \; find -L ~ -type l -exec rm {} \; +mkdir -p ~/projects "$MAIL/cur" "$MAIL/new" "$MAIL/tmp" + case "$1" in g | git ) - mkdir -p ~/projects cd ~/projects || exit git clone ssh://repo.or.cz/iomenu.git git clone http://github.com/josuah/iode & @@ -36,10 +37,9 @@ g | git ) ;; m | mail ) - mkdir -p "$MAIL/cur" "$MAIL/new" "$MAIL/tmp" read -p '<address@mail.net> <imap.host.net> <password>:' a h p printf 'machine %s\nlogin %s\npassword "%s"' "$h" "$a" "$p" > ~/.netrc - chmod 400 "$HOME/.netrc" printf '\033[A\r\033[K' + chmod 400 "$HOME/.netrc" ;; esac