#!/bin/bash


# THIS SCRIPT RELEASED UNDER GPL-3.0 LICENSE -> https://www.gnu.org/licenses/gpl-3.0.txt
# WRITTEN BY GIORDANO BOSCHETTI FROM GEEKOS DAW, AN GEEKOS ITALIA PROJECT
# DEPENDENCIES: kdialog

export TEXTDOMAIN=usermodaudio

#CHECKPERMISSION
if [ "$EUID" -ne 0 ]
  then echo $"Please run with sudo. example: sudo usermodaudio"
  kdialog --title "GeekosDaw rt-config" --error $"Please run with administration previleges "
  exit
fi
#DIALOG
kdialog --title "GeekosDaw rt-config" --yesno $"This Script add your user '$USER' To group 'pipewire and audio'.\n\n Do you want continue? "
if [ "$?" = 1 ]; then
exit
fi

groupadd -g 200 pipewire
usermod -a -G pipewire $USER
usermod -a -G audio $USER

kdialog --title "GeekosDaw rt-config" --msgbox $"User $USER successfully added to pipewire and audio Group, restart the computer"
rm /tmp/usermodaudio
