all repos — dotfiles-extra @ d8e4339a351e8556ffe76d3c79be8c8fafa9cd66

extra configs that may be extraneous and/or may be platform specific

place-dotfiles-extra.sh

 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
#!/bin/sh

# place-dotfiles-extra.sh: simple script to symlink many of my extra dotfiles
# TODO: currently doesn't work, needs updating
# by x1phosura

dotfiles_root="$HOME"/73h4x/dotfiles/dotfiles-extra  # where dotfiles live
#dotfiles_root="$PWD"                                # alternative (for testing)
dest="$HOME"                                         # usually $HOME

# TODO: detect if X11/Wayland from system
#display_server=x11
display_server=wayland


die() {
    echo "$@"; exit 1
}

[ ! -d "$dotfiles_root" ] && \
    die "ERROR: $dotfiles_root doesn't exist. Aborting..."

# TODO: change '[[' to '[', test...
#[[ "$(realpath $dotfiles_root)" = "$(realpath $dest)" ]] && \
#    die " ERROR: dotfiles_root and dest are the same directory! Aborting..."


#dotfiles_extra_list=".config/nano \
#.config/neofetch \
#.config/radare2 \
#.config/ranger \
#.config/systemd"
dotfiles_extra_list=".config/nano \
.config/radare2 \
.config/ranger"

dotfiles_wayland_list=""

dotfiles_x_list="i3/.config/alacritty \
i3/.config/compton \
i3/.config/i3 \
i3/.config/i3status \
i3/.config/picom \
i3/.config/polybar \
i3/.config/redshift \
i3/.config/rofi \
i3/.xinitrc \
i3/.Xresources \
i3/.Xresources-manjaro"

# Note: directly symlink items to .config instead of symlinking .config itself
# because I don't want to preserve everything that programs create there
mkdir -p "$dest"/.config

for file in $dotfiles_extra_list; do
    # TODO: only link after checking file's existence in config_dir_list
    ln -svfn "$dotfiles_root/$file" "$dest"/"$file"
done

# TODO: link X11 dotfiles
# TODO: link wayland dotfiles

# link personal /bin directory (ex. contains scripts and such...)
ln -svfn "$dotfiles_root"/bin "$dest"/bin

# link /etc dotfiles (some of these HAVE to be in /etc)
#sudo ln -svf "$dotfiles_root"/etc/default/tlp /etc/default/tlp  # tlp dir
# TODO: /etc/pacman.conf
# TODO: backup old files, copy instead of linking