diff --git a/.config/shell/bin/ned b/.config/shell/bin/ned index 8c1b866..3e29e29 100755 --- a/.config/shell/bin/ned +++ b/.config/shell/bin/ned @@ -29,12 +29,15 @@ usage() { edit() { check_setup - NOTE_PATH="$(fd -at f "$2" "$NOTES_DIR")" - # if there was more than one result - if [ "$(echo "$NOTE_PATH" | wc -l)" -gt 1 ]; then - NOTE_PATH="$(echo "$NOTE_PATH" | fzy)" + # set search term + if [ -z "$2" ]; then + echo "Error: no search term provided" >&2 + exit 1 fi + SEARCH_TERM="$2" + NOTE_PATH="$(cd "$NOTES_DIR" && fzf -1 -q "$SEARCH_TERM" --layout=reverse --info=inline --height=10%)" + $EDITOR_CMD "$NOTE_PATH" } diff --git a/.config/termux/colors.properties b/.config/termux/colors.properties new file mode 100755 index 0000000..b32ba5a --- /dev/null +++ b/.config/termux/colors.properties @@ -0,0 +1,31 @@ +# https://github.com/aaron-williamson/base16-alacritty/blob/master/colors/base16-onedark-256.yml +# Base16 One dark +# Daniel Pfeifer (http://github.com/purpleKarrot) +foreground=#abb2bf +background=#282c34 +cursor=#abb2bf + +color0=#282c34 +color1=#e06c75 +color2=#98c379 +color3=#e5c07b +color4=#61afef +color5=#c678dd +color6=#56b6c2 +color7=#abb2bf + +color8=#545862 +color9=#e06c75 +color10=#98c379 +color11=#e5c07b +color12=#61afef +color13=#c678dd +color14=#56b6c2 +color15=#c8ccd4 + +color16=#d19a66 +color17=#be5046 +color18=#353b45 +color19=#3e4451 +color20=#565c64 +color21=#b6bdca diff --git a/.config/termux/tasker/light-status.sh b/.config/termux/tasker/light-status.sh new file mode 100755 index 0000000..96b3f45 --- /dev/null +++ b/.config/termux/tasker/light-status.sh @@ -0,0 +1,10 @@ +#!/data/data/com.termux/files/usr/bin/bash +PLG="$HOME/bin/tplink_smartplug.py -t 192.168.1.250 -c" + +# If the light is on +if $PLG info | grep ',"relay_state":1,';then + exit 1 +else + exit 0 +fi + diff --git a/.config/termux/tasker/toggle-lights.sh b/.config/termux/tasker/toggle-lights.sh new file mode 100755 index 0000000..77571f1 --- /dev/null +++ b/.config/termux/tasker/toggle-lights.sh @@ -0,0 +1,13 @@ +#!/data/data/com.termux/files/usr/bin/bash +PLG="$HOME/bin/tplink_smartplug.py -t 192.168.1.250 -c" + +# If the light is on +if $PLG info | grep ',"relay_state":1,';then + $PLG off && + exit 0 +else + $PLG on && + exit 1 +fi + +exit 0 diff --git a/.config/termux/termux.properties b/.config/termux/termux.properties new file mode 100755 index 0000000..f3ec189 --- /dev/null +++ b/.config/termux/termux.properties @@ -0,0 +1,97 @@ +### After making changes and saving you need to run `termux-reload-settings` +### to update the terminal. All information here can also be found on the +### wiki: https://wiki.termux.com/wiki/Touch_Keyboard + +extra-keys = [ \ + [{key: 'ESC', popup: {macro: "ESC S", display: ""}},{key: '-', popup: '_'},{key: '/', popup: '\\\\'},{key: '|', popup: '_'},{key: 'HOME', popup: '['},{key: 'UP', popup: 'KEYBOARD'},{key: 'END', popup: ']'},'BKSP',{key: 'DEL', popup: 'ESC'}], \ + ['TAB',{key: ':', popup: {macro: "ESC : w q ENTER", display: "vim exit"}},{key: 'CTRL', popup: {macro: 'CTRL c', display: ''}},{key: '=', popup: {key: '~'}},{key: 'LEFT', popup: '{'},{key: 'DOWN', popup: 'TAB'},{key: 'RIGHT', popup: '}'},{key: "'", popup: '"'},{key: 'ENTER', popup: {macro: 'ESC S todo ENTER', popup: 'todo'}}] \ +] + +# remove home and end, move control and alt to the left + + +############### +# Extra keys +############### + + +### Settings for choosing which set of symbols to use for illustrating keys. +### Choose between default, arrows-only, arrows-all, all and none +# extra-keys-style = default + +### Default extra-key configuration +# extra-keys = [[ESC, TAB, CTRL, ALT, {key: '-', popup: '|'}, DOWN, UP]] + +### Two rows with more keys +# extra-keys = [['ESC','/','-','HOME','UP','END','PGUP'], \ +# ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']] + +### Configuration with additional popup keys (swipe up from an extra key) +# extra-keys = [[ \ +# {key: ESC, popup: {macro: "CTRL f d", display: "tmux exit"}}, \ +# {key: CTRL, popup: {macro: "CTRL f BKSP", display: "tmux ←"}}, \ +# {key: ALT, popup: {macro: "CTRL f TAB", display: "tmux →"}}, \ +# {key: TAB, popup: {macro: "ALT a", display: A-a}}, \ +# {key: LEFT, popup: HOME}, \ +# {key: DOWN, popup: PGDN}, \ +# {key: UP, popup: PGUP}, \ +# {key: RIGHT, popup: END}, \ +# {macro: "ALT j", display: A-j, popup: {macro: "ALT g", display: A-g}}, \ +# {key: KEYBOARD, popup: {macro: "CTRL d", display: exit}} \ +# ]] + +############### +# Colors/themes +############### + +### Force black colors for drawer and dialogs +# use-black-ui = true + +############### +# Keyboard shortcuts +############### + +### Open a new terminal with ctrl + t (volume down + t) +# shortcut.create-session = ctrl + t + +### Go one session down with (for example) ctrl + 2 +# shortcut.next-session = ctrl + 2 + +### Go one session up with (for example) ctrl + 1 +# shortcut.previous-session = ctrl + 1 + +### Rename a session with (for example) ctrl + n +# shortcut.rename-session = ctrl + n + +############### +# Bell key +############### + +### Vibrate device (default). +# bell-character = vibrate + +### Beep with a sound. +# bell-character = beep + +### Ignore bell character. +# bell-character = ignore + +############### +# Back key +############### + +### Send the Escape key. +# back-key=escape + +### Hide keyboard or leave app (default). +# back-key=back + +############### +# Keyboard issue workarounds +############### + +### Letters might not appear until enter is pressed on Samsung devices +# enforce-char-based-input = true + +### ctrl+space (for marking text in emacs) does not work on some devices +# ctrl-space-workaround = true