Merge branch 'add-user' into 'master'
Add user to groups in install.sh Closes #3 See merge request severinkaderli/dotfiles!2
This commit is contained in:
commit
2167a322b7
3 changed files with 22 additions and 2 deletions
17
install.sh
17
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
|
||||
|
|
BIN
system/.config/dconf/user
Normal file
BIN
system/.config/dconf/user
Normal file
Binary file not shown.
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue