#!/bin/bash


# THIS SCRIPT IS 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
# MODIFIED FOR PIPEWIRE BY EDGAR AICHINGER
# DEPENDENCIES: kdialog

export TEXTDOMAIN=usermodpipewire

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

usermod -a -G pipewire $USER

kdialog --title "GeekosDaw RT-config" --msgbox $"User $USER successfully added to group pipewire,\n\n Re-login, or restart the computer to make this effective"
rm /tmp/usermodpipewire
