mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-06-07 21:13:44 +02:00
refactor: setup script
This commit is contained in:
parent
e8ec398c9e
commit
d567f45628
10 changed files with 59 additions and 47 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source ../utils/main.sh
|
source ../utils/init.sh
|
||||||
|
|
||||||
DOWNLOAD_URL="https://github.com/MatsuriDayo/nekoray/releases/download/3.26/nekoray-3.26-2023-12-09-linux64.zip"
|
DOWNLOAD_URL="https://github.com/MatsuriDayo/nekoray/releases/download/3.26/nekoray-3.26-2023-12-09-linux64.zip"
|
||||||
FILE_NAME="nekoray.zip"
|
FILE_NAME="nekoray.zip"
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source ../utils/main.sh
|
|
||||||
|
|
||||||
FONTS_DIR="../configs/host/ui/fonts"
|
|
||||||
|
|
||||||
install_ttf_fonts() {
|
|
||||||
sudo cp *.ttf /usr/share/fonts/TTF
|
|
||||||
sudo fc-cache -f -v
|
|
||||||
|
|
||||||
log "Fonts installed successfully!"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_sudo
|
|
||||||
|
|
||||||
cd $FONTS_DIR
|
|
||||||
install_ttf_fonts
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
create_symlinks() {
|
create_links() {
|
||||||
local source_dir=$1
|
local source_dir=$1
|
||||||
local target_dir=$2
|
local target_dir=$2
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ create_symlinks() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_symlinks() {
|
delete_links() {
|
||||||
local source_dir=$1
|
local source_dir=$1
|
||||||
local target_dir=$2
|
local target_dir=$2
|
||||||
|
|
|
@ -1,10 +1,17 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source ../utils/main.sh
|
source ./.scripts/utils/init.sh
|
||||||
|
|
||||||
UPDATE_PKGS=false
|
UPDATE_PKGS=false
|
||||||
CLEAR_CACHE=false
|
CLEAR_CACHE=false
|
||||||
DISABLE_GRUB_MENU=false
|
DISABLE_GRUB_MENU=false
|
||||||
|
TTF_FONTS_DIR="./host/ui/fonts/TTF"
|
||||||
|
|
||||||
|
display_help() {
|
||||||
|
echo "Usage: [-i | -f] [-h]"
|
||||||
|
echo " -i Full install"
|
||||||
|
echo " -f Install host fonts"
|
||||||
|
}
|
||||||
|
|
||||||
declare -A PACKAGES=(
|
declare -A PACKAGES=(
|
||||||
["VOID_REPOS"]="void-repo-multilib void-repo-nonfree"
|
["VOID_REPOS"]="void-repo-multilib void-repo-nonfree"
|
||||||
|
@ -110,6 +117,16 @@ disable_grub_menu() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_ttf_fonts() {
|
||||||
|
sudo cp $TTF_FONTS_DIR/* /usr/share/fonts/TTF
|
||||||
|
sudo fc-cache -f -v
|
||||||
|
|
||||||
|
log "Fonts installed successfully!"
|
||||||
|
}
|
||||||
|
|
||||||
|
while getopts "sfh" opt; do
|
||||||
|
case $opt in
|
||||||
|
s)
|
||||||
check_sudo
|
check_sudo
|
||||||
|
|
||||||
update_system
|
update_system
|
||||||
|
@ -120,3 +137,19 @@ enable_services
|
||||||
disable_grub_menu
|
disable_grub_menu
|
||||||
|
|
||||||
log "Setup is done, please log out and log in"
|
log "Setup is done, please log out and log in"
|
||||||
|
;;
|
||||||
|
f)
|
||||||
|
check_sudo
|
||||||
|
|
||||||
|
install_ttf_fonts
|
||||||
|
;;
|
||||||
|
h)
|
||||||
|
display_help
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
display_help
|
||||||
|
fi
|
32
stow.sh
32
stow.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source ./.scripts/utils/main.sh
|
source ./.scripts/utils/init.sh
|
||||||
source ./.scripts/utils/helpers.sh
|
source ./.scripts/utils/_links.sh
|
||||||
|
|
||||||
DOTS_CONFIG_DIR="$(pwd)/linux-configs"
|
DOTS_CONFIG_DIR="$(pwd)/linux-configs"
|
||||||
DOTFILES_DIR="$DOTS_CONFIG_DIR/dotfiles"
|
DOTFILES_DIR="$DOTS_CONFIG_DIR/dotfiles"
|
||||||
|
@ -31,36 +31,36 @@ create_target_dir() {
|
||||||
stow() {
|
stow() {
|
||||||
create_target_dir
|
create_target_dir
|
||||||
|
|
||||||
create_symlinks $SHELL_DIR ~
|
create_links $SHELL_DIR ~
|
||||||
log "Shell stowed successfully!"
|
log "Shell stowed successfully!"
|
||||||
|
|
||||||
create_symlinks $EDITOR_DIR ~
|
create_links $EDITOR_DIR ~
|
||||||
log "Editor stowed successfully!"
|
log "Editor stowed successfully!"
|
||||||
|
|
||||||
create_symlinks $DOTFILES_DIR ~/.config
|
create_links $DOTFILES_DIR ~/.config
|
||||||
log "Dotfiles stowed successfully!"
|
log "Dotfiles stowed successfully!"
|
||||||
|
|
||||||
create_symlinks $HYPRLAND_DIR ~/.config
|
create_links $HYPRLAND_DIR ~/.config
|
||||||
log "Hyprland stowed successfully!"
|
log "Hyprland stowed successfully!"
|
||||||
|
|
||||||
create_symlinks $SHORTCUTS_DIR ~/.local/share/applications
|
create_links $SHORTCUTS_DIR ~/.local/share/applications
|
||||||
log "Shortcuts stowed successfully!"
|
log "Shortcuts stowed successfully!"
|
||||||
|
|
||||||
create_symlinks $UTILS_DIR ~
|
create_links $UTILS_DIR ~
|
||||||
log "Utilities stowed successfully!"
|
log "Utilities stowed successfully!"
|
||||||
}
|
}
|
||||||
|
|
||||||
unstow() {
|
unstow() {
|
||||||
delete_symlinks $SHELL_DIR ~
|
delete_links $SHELL_DIR ~
|
||||||
delete_symlinks $DOTFILES_DIR ~/.config
|
delete_links $DOTFILES_DIR ~/.config
|
||||||
delete_symlinks $HYPRLAND_DIR ~/.config
|
delete_links $HYPRLAND_DIR ~/.config
|
||||||
delete_symlinks $SHORTCUTS_DIR ~/.local/share/applications
|
delete_links $SHORTCUTS_DIR ~/.local/share/applications
|
||||||
delete_symlinks $UTILS_DIR ~
|
delete_links $UTILS_DIR ~
|
||||||
|
|
||||||
log "All configs ustowed successfully !"
|
log "All configs ustowed successfully !"
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts "ps" opt; do
|
while getopts "ush" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
s)
|
s)
|
||||||
stow
|
stow
|
||||||
|
@ -72,10 +72,6 @@ while getopts "ps" opt; do
|
||||||
display_help
|
display_help
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
\?)
|
|
||||||
display_help
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue