-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync-dots
executable file
·56 lines (44 loc) · 1.61 KB
/
sync-dots
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /usr/bin/env bash
echo " "
echo "=========Updating Linux Notes in Obsidian========="
echo " "
# Put nala history into file and trim the output to different file and then remove the original
# nala history | cut -c 45- --complement | cut -c -6 --complement > "$HOME"/Obsidian/Vault/Linux/NalaHistory.md
# grep the zsh_history file for install keyword and put it in dotfiles/installed.md
# cut -b 1-15 --complement "$HOME"/.zsh_history | grep -e 'install' -e 'git clone' -e 'wget' > "$HOME"/Obsidian/Vault/Linux/Installed.md
#Clean up NalaHistory and Installed with AWK
# awk -i inplace '!seen[$0]++' "$HOME"/Obsidian/Vault/Linux/NalaHistory.md
# awk -i inplace '!seen[$0]++' "$HOME"/Obsidian/Vault/Linux/Installed.md
paru -Qeq >"$HOME"/Obsidian/Vault/Linux/AurHistory.md
cp "$HOME"/Obsidian/Vault/Linux\ Journal/Hyprland.md "$HOME"/dotfiles/hypr/README.md
# No Need to put the Notes in the dotfiles directory, directly put it in the obsidian directory
# # Needs to be rsynced, symlinks don't work
# rsync -avP "$HOME"/dotfiles/Installed.md "$HOME"/Obsidian/Vault/Linux
# rsync -avP "$HOME"/dotfiles/NalaHistory.md "$HOME"/Obsidian/Vault/Linux
echo " "
echo "=========Updating git repository========="
echo " "
# Push the dotfiles folder
commit=$(date)
cd "$HOME"/dotfiles || exit
pwd
git add .
read -r -p "Enter a Commit: " temp
if [ "$temp" != "" ]; then
commit=$temp
fi
echo "$commit"
git commit -m "$commit"
git push
# Push the Scripts Folder
commit=$(date)
cd "$HOME"/scripts || exit
pwd
git add .
read -r -p "Enter a Commit: " temp
if [ "$temp" != "" ]; then
commit=$temp
fi
echo "$commit"
git commit -m "$commit"
git push