Skip to content

Commit

Permalink
config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
callumacrae committed Apr 19, 2023
1 parent 37d463b commit 61e3f9c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ tmux/status/next-event-2
tmux/status/audio-status-2

*nosync*
secrets.sh
2 changes: 1 addition & 1 deletion tmux/config/vim.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ setw -g monitor-activity on
set -g visual-activity on

# vim-tmux-navigator config
forward_programs="view|n?vim?|fzf"
forward_programs="n?vim?|fzf"
should_forward="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?($forward_programs)(diff)?$'"
bind -n 'C-h' if-shell "$should_forward" 'send-keys C-h' '%if "#{?pane_at_left,0,1}" select-pane -L %endif'
Expand Down
11 changes: 6 additions & 5 deletions tmux/status/next-event-2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ if nextEvent != nil, let title = nextEvent!.title, let startDate = nextEvent!.st

let minsUntil = startDate.timeIntervalSinceNow / 60

let dateFormat = DateFormatter()
dateFormat.dateFormat = "HH:mm"
let time = dateFormat.string(from: startDate)

let icon = ""
let truncateTo = 21

if minsUntil < 60 {
var color = ""
if minsUntil <= 0 {
Expand All @@ -53,10 +58,6 @@ if nextEvent != nil, let title = nextEvent!.title, let startDate = nextEvent!.st
color = "#[fg=yellow] "
}

let dateFormat = DateFormatter()
dateFormat.dateFormat = "HH:mm"
let time = dateFormat.string(from: startDate)

var truncatedTitle = title
if title.count > truncateTo {
let index = title.index(title.startIndex, offsetBy: truncateTo - 2)
Expand All @@ -65,6 +66,6 @@ if nextEvent != nil, let title = nextEvent!.title, let startDate = nextEvent!.st

print(color + icon + time + " " + truncatedTitle)
} else {
print(icon)
print(icon + "#[fg=brightblack]" + time)
}
}
10 changes: 8 additions & 2 deletions tmux/status/notifications-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ notifications=""

dock_notifications=$(osascript $CURRENT_DIR/notifications-dock.scpt)
[[ "$dock_notifications" -gt 0 ]] && notifications="${notifications}${dock_notifications}"
[ $office_hours -eq 1 ] &&

if [ $office_hours -eq 1 ]; then
github_notifications=$(gh api notifications -q 'map(select(.unread)) | length')
[[ "$github_notifications" -gt 0 ]] && notifications="${notifications}${github_notifications}"
[[ "$github_notifications" -gt 0 ]] && notifications="${notifications}${github_notifications}"

notion_notifications=$($CURRENT_DIR/notifications-notion.sh)
[[ "$notion_notifications" -gt 0 ]] && notifications="${notifications}${notion_notifications}"
fi

# email_notifications=$(cat $TMPDIR/himalaya-counter)
# [[ "$email_notifications" -gt 0 ]] && notifications="${notifications}  ${email_notifications}"

Expand Down
13 changes: 13 additions & 0 deletions tmux/status/notifications-notion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export $(cat $CURRENT_DIR/../../secrets.sh | xargs)

curl 'https://www.notion.so/api/v3/getUserNotifications' \
-H 'content-type: application/json' \
-H "cookie: $NOTION_COOKIE" \
--silent \
--data-raw '{"size":1000}' | jq -r '
def unreadForSpace:
reduce (.unread | to_entries[]) as {$key,$value} (0; . += $value);
reduce .results[] as $space (0; . += ($space | unreadForSpace))'
2 changes: 2 additions & 0 deletions zsh/node.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ export NVM_COMPLETION=true
export NVM_AUTO_USE=true

export NVM_LAZY_LOAD_EXTRA_COMMANDS=('nvim')

export PATH="~/.yarn/bin:$PATH"

0 comments on commit 61e3f9c

Please sign in to comment.