Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Dec 29, 2020
0 parents commit 70b4c0e
Show file tree
Hide file tree
Showing 44 changed files with 1,815 additions and 0 deletions.
7 changes: 7 additions & 0 deletions configure-parts/05-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

echo "Updating system"

if [[ -n "$LINUXCONFIG_PACMAN" ]]; then
sudo pacman -Syu --noconfirm
fi
7 changes: 7 additions & 0 deletions configure-parts/10-required-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

source "${LINUXCONFIG_BASEPATH}/utils/pacman"

if [[ -n "$LINUXCONFIG_PACMAN" ]]; then
pacman_sinstall gettext vim
fi
13 changes: 13 additions & 0 deletions configure-parts/15-yay
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

source "${LINUXCONFIG_BASEPATH}/utils/git_clone_or_pull"
source "${LINUXCONFIG_BASEPATH}/utils/which_silent"
source "${LINUXCONFIG_BASEPATH}/utils/pacman"

if [[ -n "$LINUXCONFIG_PACMAN" ]]; then
pacman_sinstall git base-devel
git_clone_or_pull_shallow https://aur.archlinux.org/yay.git /tmp/yay-aur
cd /tmp/yay-aur
makepkg -si --noconfirm
cd -
fi
15 changes: 15 additions & 0 deletions configure-parts/30-dotfiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

echo "Copying dotfiles"
cd "${LINUXCONFIG_BASEPATH}/dotfiles/copies/"
cp -r -n . "$HOME"
cd -

echo "Linking dotfiles"
cd "${LINUXCONFIG_BASEPATH}/dotfiles/links/"

links_dir=$(pwd)
find . -type d -printf "%P\n" | awk 'NF' | xargs -n1 -I{} mkdir -p "${HOME}/{}"
find . -type f -printf "%P\n" | xargs -n1 -I{} ln -sf "${links_dir}/{}" "${HOME}/{}"
cd -

11 changes: 11 additions & 0 deletions configure-parts/50-gui
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if [[ -z "$LINUXCONFIG_GUI" ]]; then
echo "Skipping gui config because LINUXCONFIG_GUI not set"
exit
fi

if [[ -n "$LINUXCONFIG_PACMAN" ]]; then
source "${LINUXCONFIG_BASEPATH}/utils/pacman"
pacman_sinstall sway gdm alacritty wofi waybar
fi
13 changes: 13 additions & 0 deletions configure-parts/55-fonts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if [[ -z "$LINUXCONFIG_GUI" ]]; then
echo "Skipping font config because LINUXCONFIG_GUI not set"
exit
fi

if [[ -n "$LINUXCONFIG_PACMAN" ]]; then
yay -S --noconfirm --needed tex-gyre-fonts otf-libertinus noto-fonts-emoji otf-font-awesome ttf-dejavu ttf-liberation noto-fonts
sudo ln -sf /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d
sudo ln -sf /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d
sudo ln -sf /etc/fonts/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d
fi
17 changes: 17 additions & 0 deletions configure-parts/60-systemconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

echo "Copying system-configs"
cd "${LINUXCONFIG_BASEPATH}/system-configs/"

staging_dir=~/.cache/systemconfigs
rm -rf $staging_dir
mkdir -p $staging_dir

find . -type d -printf "%P\n" | awk 'NF' | envsubst | xargs -n1 -I{} mkdir -p "${staging_dir}/{}"
find . -type f -printf "%P\n" | xargs -n1 -I{} bash -c "cat '{}' | envsubst > ${staging_dir}/$(echo '{}' | envsubst )"

cd -

cd $staging_dir
find . -type f -printf "%P\n" | sudo xargs -n1 -I{} install -m 644 ./{} /{}
cd -
30 changes: 30 additions & 0 deletions configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -e

cd "$(dirname "$0")"
export LINUXCONFIG_BASEPATH="$(pwd)"

source "${LINUXCONFIG_BASEPATH}/utils/which_silent"

export LINUXCONFIG_USER=$USER

# detect gui
if [[ -n "$DISPLAY" || -n "$WAYLAND_DISPLAY" ]]; then
LINUXCONFIG_GUI='yes'
fi
export LINUXCONFIG_GUI

# detect package manager
if which_silent pacman; then
export LINUXCONFIG_PACMAN='yes'
elif which_silent apt; then
export LINUXCONFIG_APT='yes'
elif which_silent yum; then
export LINUXCONFIG_YUM='yes'
fi

# configure overrides here
unset LINUXCONFIG_GUI

run-parts configure-parts
3 changes: 3 additions & 0 deletions dotfiles/copies/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "$HOME/.linux-config/files/zsh.sh"


Loading

0 comments on commit 70b4c0e

Please sign in to comment.