aboutsummaryrefslogtreecommitdiffstats
path: root/aggregate.sh
blob: dab5ce6f30f1d7ba3b1f559205adf074fe899b5b (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash

# ::rsync --out-format="%n" Flags::
# -a: copy dirs
# -L: copy symlinks
# -: erbose

COMMAND=$1

function update_everything() {
  # alacritty
  rsync --out-format="%n" -La ~/.config/alacritty/* ./alacritty/

  # sway
  rsync --out-format="%n" -La ~/.config/sway/* ./sway/

  # awesome
  #rsync --out-format="%n" -La ~/.config/awesome/* ./awesome/

  # waybar
  rsync --out-format="%n" -a ~/.config/waybar/* ./waybar/

  # i3status
  rsync --out-format="%n" -La ~/.config/i3status/* ./i3status/

  # neofetch
  rsync --out-format="%n" -La ~/.config/neofetch/* ./neofetch/

  # im/neoim
  rsync --out-format="%n" -La --exclude=plug ~/.config/nvim/* ./vim/
  rsync --out-format="%n" -La ~/.vimrc ./vim/

  # zsh
  rsync --out-format="%n" -La ~/.zshrc ./zsh/
  rsync --out-format="%n" -La ~/.zprofile ./zsh/

  # fzf
  rsync --out-format="%n" -La ~/.fzf.zsh ./fzf/
  rsync --out-format="%n" -La ~/.fzf.bash ./fzf/

  # gitconfig
  rsync --out-format="%n" -La ~/.gitconfig ./git/

  # rofi
  rsync --out-format="%n" -La ~/.config/rofi/* ./rofi/

  # mako
  rsync --out-format="%n" -La ~/.config/mako/* ./mako/

  # kitty
  rsync --out-format="%n" -La ~/.config/kitty/* ./kitty/

  # mpv
  rsync --out-format="%n" -La --exclude=watch_later ~/.config/mpv/* ./mpv/

  # swappy
  rsync --out-format="%n" -La ~/.config/swappy/* ./swappy/
}

if [[ $COMMAND == "clean" ]]; then
  echo "Cleaing Workspace"
  find . -type d -not -path "./.git/*" -not -name ".git" -exec rm -vrf {} +
elif [[ $COMMAND == "update" ]]; then
  update_everything

  if [[ ! -d ".git" ]]; then
    git init
    git remote add origin git@github.com:abdus/dotfiles.git
  fi

  git add .
  git commit -m "$2" || git commit -m ":zap: automated updates"
  git push origin master
fi

# github badges: software - version number
BADGES=""

# $1 program name     $2 version number
#function gen_badges() {
#BADGES="${BADGES}<img src='https://img.shields.io/badge/$1-$2-blueviolet' alt='$1' />\n"
#}

#gen_badges alacritty "v$(alacritty --version | grep -oe '[0-9].[0-9]*');" # alacritty
#gen_badges fzf "v$(fzf --version | grep -oe '[0-9].*\S')"                 # fzf
#gen_badges git "v$(git --version | grep -ow '[0-9].*[0-9]')"              # git
#gen_badges neofetch "v$(neofetch --version | grep -oe '[0-9].*[0-9]')"    # neofetch
#gen_badges vim "v8.2"                                                     # vim
#gen_badges neovim $(nvim --version | grep -ow 'v[0-9]*.*[0-9]')           # nvim
#gen_badges waybar $(waybar --version | grep -ow 'v[0-9]*.*[0-9]')         # waybar
#gen_badges zsh "v$(zsh --version | grep -oe '[0-9]\.[0-9]')"              # zsh
#gen_badges sway "$(sway --version | grep -oe 'v[0-9].*')"                 # sway

#echo -e $BADGES | wl-copy
#echo "Badges Copied!"