Compare commits

...

2 commits

Author SHA1 Message Date
Tony Blyler
303b6ce5a6 utilize bash rather than watch for i3 reocurring commands 2021-09-27 09:50:52 -04:00
Tony Blyler
9b0a7e91d5 Update notes to have an fzf mode 2021-09-27 09:50:24 -04:00
2 changed files with 16 additions and 12 deletions
home
.config/i3
.zshrc.d

View file

@ -4,8 +4,8 @@
# #
### Startup ### Startup
exec_always --no-startup-id autotiling exec_always --no-startup-id autotiling
exec_always --no-startup-id flock -n ~/.polybar.lock polybar mybar exec --no-startup-id bash -c 'while sleep 1; do flock ~/.polybar.lock polybar mybar; done'
exec --no-startup-id watch -n 15 autorandr --change exec --no-startup-id bash -c 'while sleep 15; do autorandr --change; done'
exec --no-startup-id dunst exec --no-startup-id dunst
exec --no-startup-id nm-applet exec --no-startup-id nm-applet
exec --no-startup-id blueman-applet exec --no-startup-id blueman-applet

View file

@ -2,6 +2,16 @@
notes() { notes() {
local -r NOTES_DIR="${NOTES_DIR:-${HOME}/notes}" local -r NOTES_DIR="${NOTES_DIR:-${HOME}/notes}"
local -r EDITOR="${EDITOR:-vim}"
local EDITOR_OPTIONS=()
if [[ "${EDITOR}" =~ 'vim$' ]]; then
EDITOR_OPTIONS=(
'-c'
'set spell'
)
fi
for ARG in "$@"; do for ARG in "$@"; do
( (
@ -10,6 +20,10 @@ notes() {
cd "$NOTES_DIR" cd "$NOTES_DIR"
case "${ARG}" in case "${ARG}" in
'fzf')
"${EDITOR}" "${EDITOR_OPTIONS[@]}" "$(notes ls | fzf)"
;;
'ls') 'ls')
ag -g '' -l "${NOTES_DIR}" | sort -hr ag -g '' -l "${NOTES_DIR}" | sort -hr
;; ;;
@ -56,16 +70,6 @@ notes() {
echo -e "# $(date -d "@${NOW}" +'%a %d %b %Y')\n\n## todo\n\n" > "${FILE_PATH}" echo -e "# $(date -d "@${NOW}" +'%a %d %b %Y')\n\n## todo\n\n" > "${FILE_PATH}"
fi fi
local -r EDITOR="${EDITOR:-vim}"
local EDITOR_OPTIONS=()
if [[ "${EDITOR}" =~ 'vim$' ]]; then
EDITOR_OPTIONS=(
'-c'
'set spell'
)
fi
"${EDITOR}" "${EDITOR_OPTIONS[@]}" "${FILE_PATH}" "${EDITOR}" "${EDITOR_OPTIONS[@]}" "${FILE_PATH}"
) )
} }