Compare commits

...

10 Commits

Author SHA1 Message Date
1745a15acf fix(scripts): install-cheat-tldr now updates files 2023-07-23 21:51:40 +03:00
ad08a2956e fix(scripts): improve replacable function errors 2023-07-23 21:19:43 +03:00
8d2083be4c fix(config): moved ssh gpg config from shared 2023-07-23 17:18:03 +03:00
87281a436f feat(config): split ssh configuration by host 2023-07-23 17:17:08 +03:00
4ec9444e29 feat(tools): add taskwarrior and configs 2023-07-23 17:03:04 +03:00
ivuorinen
95d358ae3d chore(git): Update submodules (automated)
config/nvim v3.33.5
2023-07-22 03:04:25 +00:00
ivuorinen
cea61a5719 chore(git): Update submodules (automated)
config/nvim v3.33.4
2023-07-19 03:36:20 +00:00
ivuorinen
28c29d94f2 chore(git): Update submodules (automated)
config/nvim v3.33.3
2023-07-18 03:11:59 +00:00
ivuorinen
1028d3847c chore(git): Update submodules (automated)
config/nvim v3.33.1
2023-07-17 03:16:42 +00:00
3498c6b739 fix(tools): update git dirty without parameters 2023-07-13 17:07:18 +03:00
13 changed files with 82 additions and 25 deletions

2
.gitignore vendored
View File

@@ -7,6 +7,8 @@ Brewfile.lock.json
config/fzf
config/cheat/cheatsheets/pure-bash-bible/*
config/cheat/cheatsheets/tldr/*
ssh/local.d/*
!ssh/local.d/.gitkeep
!.gitkeep
.env

View File

@@ -202,6 +202,10 @@ brew "shfmt"
brew "starship"
# Version control system designed to be a better CVS
brew "subversion"
# Feature-rich console based todo list manager
brew "task"
# Terminal user interface for taskwarrior
brew "taskwarrior-tui"
# Send macOS User Notifications from the command-line
brew "terminal-notifier"
# Thin wrapper for Terraform e.g. for locking state

View File

@@ -11,9 +11,6 @@
[pull]
rebase = true
[gpg]
format = ssh
[alias]
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"

View File

@@ -42,3 +42,36 @@ data.location=$XDG_DATA_HOME/task/
weekstart=monday
news.version=2.6.0
uda.taskwarrior-tui.keyconfig.quit=q
uda.taskwarrior-tui.keyconfig.refresh=r
uda.taskwarrior-tui.keyconfig.go-to-bottom=G
uda.taskwarrior-tui.keyconfig.go-to-top=g
uda.taskwarrior-tui.keyconfig.down=j
uda.taskwarrior-tui.keyconfig.up=k
uda.taskwarrior-tui.keyconfig.page-down=J
uda.taskwarrior-tui.keyconfig.page-up=K
uda.taskwarrior-tui.keyconfig.delete=x
uda.taskwarrior-tui.keyconfig.done=d
uda.taskwarrior-tui.keyconfig.start-stop=s
uda.taskwarrior-tui.keyconfig.quick-tag=t
uda.taskwarrior-tui.keyconfig.undo=u
uda.taskwarrior-tui.keyconfig.edit=e
uda.taskwarrior-tui.keyconfig.modify=m
uda.taskwarrior-tui.keyconfig.shell=!
uda.taskwarrior-tui.keyconfig.log=l
uda.taskwarrior-tui.keyconfig.add=a
uda.taskwarrior-tui.keyconfig.annotate=A
uda.taskwarrior-tui.keyconfig.filter=/
uda.taskwarrior-tui.keyconfig.zoom=z
uda.taskwarrior-tui.keyconfig.context-menu=c
uda.taskwarrior-tui.keyconfig.next-tab=.
uda.taskwarrior-tui.keyconfig.previous-tab=,
taskd.certificate=$XDG_DATA_HOME/task/private.certificate.pem
taskd.key=$XDG_DATA_HOME/task/private.key.pem
taskd.ca=$XDG_DATA_HOME/task/ca.cert.pem
taskd.server=inthe.am:53589
taskd.credentials=inthe_am/ivuorinen/b99a4970-94fb-4fb8-b9fe-e1a8140dd44d
taskd.trust=strict

View File

@@ -1,6 +1,9 @@
[include]
path = ~/.dotfiles/config/git/shared
[gpg]
format = ssh
[user]
name = Ismo Vuorinen
email = ismo.vuorinen@vincit.fi

View File

@@ -46,7 +46,7 @@ gitdirty()
if [[ "${d:0:2}" == "--" ]] || [[ "$d" == "vendor" ]] || [[ "$d" == "node_modules" ]]; then
echo ""
else
cd "$d" > /dev/null
cd "$d"
# If we have `.git` folder, check it.
if [[ -d ".git" ]]; then
@@ -58,7 +58,7 @@ gitdirty()
printf " %s %s\n" "$ICON" "$(pwd)"
else
# If it wasn't git repository, check subdirectories.
gitdirtyrepos -- *
gitdirtyrepos ./*
fi
fi
cd .. > /dev/null

View File

@@ -51,14 +51,15 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
TLDR_FILE="$SECTION_DIR/${FILENAME}"
# echo "-> dest: $TLDR_FILE"
replacable "$FILE" "$TLDR_FILE"
override=$?
if [ "$override" -ne 1 ]; then
cp "$FILE" "$TLDR_FILE" && msg_run "Updated: $TLDR_FILE"
# Update the original file for making the replacable value comparable
if [ -f "$FILE" ] && [ '---' != "$(head -1 < "$FILE")" ]; then
echo -e "---\n$TLDR_SYNTAX\n$TLDR_TAGS\n$TLDR_SOURCE\n---\n$(cat "$FILE")" > "$FILE"
fi
if [ -f "$TLDR_FILE" ] && [ '---' != "$(head -1 < "$TLDR_FILE")" ]; then
echo -e "---\n$TLDR_SYNTAX\n$TLDR_TAGS\n$TLDR_SOURCE\n---\n$(cat "$TLDR_FILE")" > "$TLDR_FILE"
replacable "$FILE" "$TLDR_FILE"
override=$?
if [ "$override" -ne 0 ]; then
cp "$FILE" "$TLDR_FILE" && msg_run "Updated: $TLDR_FILE"
fi
done

View File

@@ -2,7 +2,10 @@
#
# Shared bash functions and helpers
# that can be sourced to other scripts.
#
# Helper env variables. Use like this: VERBOSE=1 ./script.sh
: "${VERBOSE:=0}"
# -- Colors -- #
CLR_RED="\033[1;31m"
@@ -249,23 +252,34 @@ function replacable()
FILE1="$1"
FILE2="$2"
[[ ! -r "$FILE1" ]] && { msg_err "File 1 ($FILE1) does not exist" && return 1; }
[[ ! -r "$FILE2" ]] && { msg_err "File 2 ($FILE2) does not exist" && return 1; }
[[ ! -r "$FILE1" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_err "File 1 ($FILE1) does not exist"
return 0;
}
[[ ! -r "$FILE2" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_err "File 2 ($FILE2) does not exist, replacable"
return 1;
}
FILE1_HASH=$(get_sha256sum "$FILE1")
FILE2_HASH=$(get_sha256sum "$FILE2")
[[ $FILE1_HASH = "" ]] && {
msg_err "Could not get hash for file 1 ($FILE1)" && return 1;
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 1 ($FILE1)"
return 0;
}
[[ $FILE2_HASH = "" ]] && {
msg_err "Could not get hash for file 2 ($FILE2)" && return 1;
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 2 ($FILE2), replacable"
return 1;
}
[[ "$FILE1_HASH" == "$FILE2_HASH" ]] && {
msg_ok "Files match, not replacable" && return 0;
[[ $VERBOSE -eq 1 ]] && msg_ok "Files match, not replacable: $FILE1"
return 0;
}
[[ $VERBOSE -eq 1 ]] && msg_warn "Files do not match ($FILE1_HASH != $FILE2_HASH), replacable"
return 1;
}

View File

@@ -1,10 +1,5 @@
Host github.com
User git
Host lakka
User viir
HostName lakka.kapsi.fi
IdentityFile ~/.ssh/id_rsa
Include shared.d/*
Include local.d/*
Host *
# IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"

0
ssh/local.d/.gitkeep Normal file
View File

3
ssh/shared.d/github Normal file
View File

@@ -0,0 +1,3 @@
Host github.com
User git

5
ssh/shared.d/lakka Normal file
View File

@@ -0,0 +1,5 @@
Host lakka
User viir
HostName lakka.kapsi.fi
IdentityFile ~/.ssh/id_rsa