summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Burgos2018-06-26 10:56:35 -0600
committerSam Burgos2018-06-26 10:56:35 -0600
commite2ed01bae7e1ecdb80100e85cd777021f447db83 (patch)
tree90a59c35e5e0d6722d5f2c350613c6d679d8981d
parent1a3967097bc7b70b30126e5680cfc09ea12874d1 (diff)
downloadaur-e2ed01bae7e1ecdb80100e85cd777021f447db83.tar.gz
updated to version 1.2.2 and added new files for easy installation (ported from manjaro settings)
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD31
-rw-r--r--add-autologin-group.install45
-rw-r--r--add-autologin-group.script39
-rw-r--r--add-autologin-group.service10
5 files changed, 126 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 819b80139f4..5cdc93a3f89 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = lightdm-settings
pkgdesc = A configuration tool for the LightDM display manager
- pkgver = 1.2.1
+ pkgver = 1.2.2
pkgrel = 1
url = https://github.com/linuxmint/lightdm-settings
+ install = add-autologin-group.install
arch = any
license = GPL3
makedepends = desktop-file-utils
@@ -13,8 +14,12 @@ pkgbase = lightdm-settings
depends = python-gobject
depends = python-setproctitle
depends = python-xapp
- source = lightdm-settings-1.2.1.tar.gz::https://github.com/linuxmint/lightdm-settings/archive/1.2.1.tar.gz
- sha256sums = d175ffa71e77f4c45697e2a69bfb7d2c9b50753bffb6b1a9ccc7dfce4e62cd21
+ source = lightdm-settings-1.2.2.tar.gz::https://github.com/linuxmint/lightdm-settings/archive/1.2.2.tar.gz
+ source = add-autologin-group.script
+ source = add-autologin-group.service
+ sha256sums = ca558b6733baeb55e614e16c3995edaa8d3a0e9afa08794a0c09830a44495d21
+ sha256sums = 475bb4805a419aca106f9f42bcb837c7dc53eeb84b5c50d8ee8d892b55d6c2b4
+ sha256sums = a356ee9dc1e876d73c49ab30fdc6417edb7a817639122fff7fe0ebff72e33190
pkgname = lightdm-settings
diff --git a/PKGBUILD b/PKGBUILD
index 9330b9323f9..114db27c8fb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,16 +1,28 @@
# Maintainer: Sam Burgos < sam dot burgos1089 at gmail dot com >
-pkgname='lightdm-settings'
-pkgver=1.2.1
+pkgname=lightdm-settings
+pkgver=1.2.2
pkgrel=1
-pkgdesc="A configuration tool for the LightDM display manager "
+pkgdesc="A configuration tool for the LightDM display manager"
+_add_group=add-autologin-group
arch=('any')
url="https://github.com/linuxmint/${pkgname}"
license=('GPL3')
-depends=('hicolor-icon-theme' 'lightdm-slick-greeter' 'polkit' 'python-gobject' 'python-setproctitle' 'python-xapp')
-makedepends=('desktop-file-utils' 'gettext')
-source=("${pkgname}-${pkgver}.tar.gz::$url/archive/${pkgver}.tar.gz")
-sha256sums=('d175ffa71e77f4c45697e2a69bfb7d2c9b50753bffb6b1a9ccc7dfce4e62cd21')
+depends=('hicolor-icon-theme'
+ 'lightdm-slick-greeter'
+ 'polkit'
+ 'python-gobject'
+ 'python-setproctitle'
+ 'python-xapp')
+makedepends=('desktop-file-utils'
+ 'gettext')
+install=$_add_group.install
+source=("${pkgname}-${pkgver}.tar.gz::$url/archive/${pkgver}.tar.gz"
+ "$_add_group.script"
+ "$_add_group.service")
+sha256sums=('ca558b6733baeb55e614e16c3995edaa8d3a0e9afa08794a0c09830a44495d21'
+ '475bb4805a419aca106f9f42bcb837c7dc53eeb84b5c50d8ee8d892b55d6c2b4'
+ 'a356ee9dc1e876d73c49ab30fdc6417edb7a817639122fff7fe0ebff72e33190')
build() {
cd $pkgname-$pkgver
@@ -20,4 +32,9 @@ build() {
package() {
cd $pkgname-$pkgver
cp -r usr $pkgdir
+
+#install systemd service
+ cd /$srcdir
+ install -Dm755 $_add_group.script $pkgdir/usr/bin/$_add_group
+ install -Dm644 $_add_group.service $pkgdir/etc/systemd/system/$_add_group.serv
}
diff --git a/add-autologin-group.install b/add-autologin-group.install
new file mode 100644
index 00000000000..c70fc5f03b7
--- /dev/null
+++ b/add-autologin-group.install
@@ -0,0 +1,45 @@
+# Colored makepkg-like functions
+msg_blue() {
+ printf "${blue}==>${bold} $1${all_off}\n"
+}
+
+note() {
+ printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
+}
+
+all_off="$(tput sgr0)"
+bold="${all_off}$(tput bold)"
+blue="${bold}$(tput setaf 4)"
+yellow="${bold}$(tput setaf 3)"
+
+post_install() {
+
+ systemctl is-active add-autologin-group >/dev/null || systemctl enable add-autologin-group
+
+ echo ""
+ note "We have enabled autologin for all users."
+ note "Reboot your system the first time, so changes will take affect."
+ echo ""
+}
+
+post_upgrade() {
+
+ post_install
+}
+
+post_remove() {
+
+ ! systemctl is-active add-autologin-group >/dev/null || systemctl disable add-autologin-group
+
+ grep autologin /etc/group
+ if [[ "$?" -eq 0 ]]; then
+ groupdel autologin >/dev/null
+ else echo ""
+ note"Autologin group already removed"
+ echo ""
+ echo ""
+ note "We have disabled autologin for all users and removed autologin group."
+ note "Reboot your system, so changes will take affect."
+ echo ""
+ fi
+}
diff --git a/add-autologin-group.script b/add-autologin-group.script
new file mode 100644
index 00000000000..c8399ec361f
--- /dev/null
+++ b/add-autologin-group.script
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+##Bash script to add autologin group into /etc/group and after creation add all users present in /etc/paswd. Systemd service
+
+#Collect users
+_users=$(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd)
+
+#Check if autologin group not exist and if not do the job
+install() {
+grep "autologin" /etc/group
+ if [ "$?" -eq 1 ]; then
+ #Add autologin group
+ groupadd -r autologin
+ #Add users
+ for i in $_users; do
+ gpasswd -a $i autologin
+ done
+ fi
+}
+
+#Check if a new user is created
+check-new-user() {
+ for i in $_users ; do
+ if groups $i | grep &>/dev/null '\bautologin\b'; then
+ : #echo "User $i ok"
+ else gpasswd -a $i autologin
+ fi
+ done
+}
+
+#Job
+grep autologin /etc/group
+ if [ "$?" -eq 1 ]; then
+ install
+ else check-new-user
+ fi
+
+
+
diff --git a/add-autologin-group.service b/add-autologin-group.service
new file mode 100644
index 00000000000..77f727de4a9
--- /dev/null
+++ b/add-autologin-group.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Check if autologin group exist and also add the users.
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/add-autologin-group
+
+[Install]
+WantedBy=multi-user.target
+