merging update and configure in one single script
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
function _template {
|
||||
source ./templates/variables
|
||||
#!/bin/bash
|
||||
|
||||
_template() {
|
||||
source ./scripts/variables
|
||||
sed -i "s|{{foreground}}|$foreground|" "$1"
|
||||
sed -i "s|{{foreground_light}}|$foreground_light|" "$1"
|
||||
sed -i "s|{{foreground_lighter}}|$foreground_lighter|" "$1"
|
||||
@@ -26,8 +28,8 @@ function _template {
|
||||
sed -i "s|{{color15}}|$color15|" "$1"
|
||||
}
|
||||
|
||||
function _kernel_colors {
|
||||
source ../templates/variables
|
||||
_kernel_colors() {
|
||||
source ./scripts/variables
|
||||
printf "\e[32m==> Generating for kernel arg\e[0m\n"
|
||||
transform_colors ()
|
||||
{
|
||||
@@ -51,3 +53,8 @@ function _kernel_colors {
|
||||
}
|
||||
printf "vt.default_red=%s vt.default_grn=%s vt.default_blu=%s" "$(transform_colors 1-2)" "$(transform_colors 3-4)" "$(transform_colors 5-6)"
|
||||
}
|
||||
|
||||
_msg() { printf " --> %s\n" "$@"; }
|
||||
_info() { printf "\e[1;34m==> Info : \e[0m%s\n" "$@"; }
|
||||
_warn() { printf "\e[1;33m==> Warning : \e[0m%s\n" "$@"; }
|
||||
_error() { printf "\e[1;31m==> Error : \e[0m%s\n" "$@"; }
|
||||
@@ -1,5 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
### Go to the script path
|
||||
set -e
|
||||
cd -- "$(dirname -- "$0")"
|
||||
cd ..
|
||||
[[ -f "./scripts/functions" ]] || { printf "\e[1;31m==> Error : \e[0mFunctions not found"; exit 1; }
|
||||
source ./scripts/functions
|
||||
|
||||
### Global variables
|
||||
_DIRNAME="$(pwd)"
|
||||
_PACKAGES=(arc-icon-theme chromium code curl discord dmenu dunst egl-wayland feh flameshot flatpak firefox htop hyprland i3lock i3-wm imagemagick lxappearance mpv nwg-look otf-comicshanns-nerd pavucontrol pipewire pipewire-jack pipewire-pulse polybar neofetch numlockx papirus-icon-theme picom plocate polybar remmina ttf-dejavu-nerd wget wireguard-tools xdg-desktop-portal xorg xorg-xinit)
|
||||
|
||||
### Configure pacman and install needeed packages
|
||||
_info "Configuring and updateing packages"
|
||||
_msg "Configuring pacman"
|
||||
sed -i "s|^#Color.*|Color|" /etc/pacman.conf
|
||||
sed -i "s|^#ParallelDownloads.*|ParallelDownloads = 10|" /etc/pacman.conf
|
||||
_msg "Updating packages"
|
||||
pacman -Syu --noconfirm
|
||||
_msg "Installing needeed packages"
|
||||
pacman -S --noconfirm --needed "${_PACKAGES[@]}"
|
||||
flatpak install com.github.IsmaelMartinez.teams_for_linux
|
||||
flatpak -y update
|
||||
|
||||
### Template files
|
||||
_info "templating config files"
|
||||
_TEMPLATES=(X11/.Xresources dunst/dunstrc polybar/config.ini rofi/colors.rasi)
|
||||
mkdir -p links/X11 links/dunst links/polybar links/rofi
|
||||
for template in "${_TEMPLATES[@]}"; do
|
||||
echo "$template";
|
||||
cp "./templates/$template" "./links/$template"
|
||||
_template "./links/$template"
|
||||
done
|
||||
|
||||
### Linking config files
|
||||
_info "Linking config files"
|
||||
_msg "tty links"
|
||||
mkdir -p /etc/systemd/system/getty@tty1.service.d
|
||||
ln -sf "$_DIRNAME/links/tty/autologin.conf" /etc/systemd/system/getty@tty1.service.d/override.conf
|
||||
ln -sf "$_DIRNAME/links/tty/issue" /etc/issue
|
||||
ln -sf "$_DIRNAME/links/tty/inputrc" /etc/inputrc
|
||||
ln -sf "$_DIRNAME/links/tty/bash.bashrc" /etc/bash.bashrc
|
||||
ln -sf "$_DIRNAME/links/tty/bash.bashaliases" /etc/bash.bashaliases
|
||||
ln -sf "$_DIRNAME/links/tty/bash.bashexports" /etc/bash.bashexports
|
||||
_msg "X11 links"
|
||||
ln -sf "$_DIRNAME/links/X11/.Xresources" /etc/X11/xinit/.Xresources
|
||||
ln -sf "$_DIRNAME/links/X11/xinitrc" /etc/X11/xinit/xinitrc
|
||||
ln -sf "$_DIRNAME/links/X11/00-keyboard.conf" /etc/X11/xorg.conf.d/00-keyboard.conf
|
||||
_msg "dunst links"
|
||||
ln -sf "$_DIRNAME/links/dunst/dunstrc" /etc/dunst/dunstrc
|
||||
_msg "i3 links"
|
||||
ln -sf "$_DIRNAME/links/i3wm/config" /etc/i3/config
|
||||
_msg "polybar links"
|
||||
ln -sf "$_DIRNAME/links/polybar/config.ini" /etc/polybar/config.ini
|
||||
_msg "rofi links"
|
||||
mkdir -p ~/.config/rofi ~/.local/share/rofi/themes
|
||||
ln -sf "$_DIRNAME/links/rofi/config.rasi" ~/.config/rofi/config.rasi
|
||||
ln -sf "$_DIRNAME/links/rofi/colors.rasi" ~/.local/share/rofi/themes/colors.rasi
|
||||
ln -sf "$_DIRNAME/links/rofi/launcher.rasi" ~/.local/share/rofi/themes/launcher.rasi
|
||||
ln -sf "$_DIRNAME/links/rofi/disconnect.rasi" ~/.local/share/rofi/themes/disconnect.rasi
|
||||
_msg "picom links"
|
||||
ln -sf "$_DIRNAME/links/picom/picom.conf" /etc/xdg/picom.conf
|
||||
_msg "apps links"
|
||||
ln -sf "${_DIRNAME}/links/applications/teams.desktop" ~/.local/share/applications/teams.desktop
|
||||
|
||||
### Sed desktop entries (--no-sandbox)
|
||||
|
||||
### Wait for user
|
||||
read -r
|
||||
|
||||
36
scripts/variables.example
Normal file
36
scripts/variables.example
Normal file
@@ -0,0 +1,36 @@
|
||||
### Globals
|
||||
# GPU : nvidia|amd
|
||||
_GPU=
|
||||
### Colors
|
||||
foreground="c6d0f5"
|
||||
foreground_light="d4d8df"
|
||||
foreground_lighter="f6f7f9"
|
||||
background="303446"
|
||||
background_light="323842"
|
||||
background_dark="21252b"
|
||||
background_darker="1e2227"
|
||||
cursor_color="98c379"
|
||||
#Black
|
||||
color0="51576d"
|
||||
color8="626880"
|
||||
#Red
|
||||
color1="e78284"
|
||||
color9="e78284"
|
||||
#Green
|
||||
color2="a6d189"
|
||||
color10="a6d189"
|
||||
#Yellow
|
||||
color3="e5c890"
|
||||
color11="e5c890"
|
||||
#Blue
|
||||
color4="8caaee"
|
||||
color12="8caaee"
|
||||
#Pink
|
||||
color5="f4b8e4"
|
||||
color13="f4b8e4"
|
||||
#Teal
|
||||
color6="81c8be"
|
||||
color14="81c8be"
|
||||
#White
|
||||
color7="b5bfe2"
|
||||
color15="a5adce"
|
||||
Reference in New Issue
Block a user