diff --git a/install.sh b/install.sh index b1d87b9..e4aecad 100755 --- a/install.sh +++ b/install.sh @@ -18,6 +18,8 @@ ####################################### # Configuration variables ####################################### +USER="severin" + # Array of directories which should be created DIRECTORIES=( ".logs" @@ -58,6 +60,11 @@ LINKED_FILES_HOME=( "bin" ) +# Groups the user should be added to +ADD_GROUPS=( + "bumblebee" +) + # Array of systemd services which should be enabled SYSTEMD_SERVICES=( "bumblebeed" @@ -86,8 +93,8 @@ print_header "Installing packages" #rm -rf yay # Install packages -#aurman -S --noconfirm $(cat "${PACKAGES_DIR}/packages.list") -#aurman -S --noconfirm $(cat "${PACKAGES_DIR}/packages2.list") +#yay -S --noconfirm $(cat "${PACKAGES_DIR}/packages.list") +#yay -S --noconfirm $(cat "${PACKAGES_DIR}/packages2.list") print_header "Creating symlinks" for file in "${LINKED_FILES_HOME[@]}"; @@ -98,6 +105,12 @@ done print_header "Give permissions" set_permission severin 744 "${HOME}/bin" +print_header "Add user to groups" +for group in "${ADD_GROUPS[@]}" +do + add_to_group "${USER}" "${group}" +done + print_header "Enabling systemd services" for service in "${SYSTEMD_SERVICES[@]}" do diff --git a/system/.config/dconf/user b/system/.config/dconf/user new file mode 100644 index 0000000..f07e771 Binary files /dev/null and b/system/.config/dconf/user differ diff --git a/system/bin/utils.sh b/system/bin/utils.sh index 2af64db..0569455 100755 --- a/system/bin/utils.sh +++ b/system/bin/utils.sh @@ -83,6 +83,13 @@ function set_permission() { sudo chmod -R "${2}" "${3}" } +# Function to add a user to a group +# USAGE add_to_group USER GROUP +function add_to_group() { + print_log "Add user ${YELLOW}${1}${RESET} to group ${YELLOW}${2}${RESET} " + sudo gpasswd -a "${1}" "${2}" > /dev/null 2>&1 +} + # Function to enable a service # USAGE: enable_service SERVICE function enable_service() {