summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorS Garnica2020-07-27 22:53:15 +0200
committerS Garnica2020-07-27 22:53:15 +0200
commit16bcb01e6f4bda501a14ec8ba5de71e5f188b61f (patch)
tree65b57c970208b4804d560f8f06e6aad85f8da458
downloadaur-16bcb01e6f4bda501a14ec8ba5de71e5f188b61f.tar.gz
Initial commit
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD27
-rw-r--r--pacgui.desktop11
-rw-r--r--pacgui.install3
-rw-r--r--pacgui.service8
-rw-r--r--pacgui.sh47
-rw-r--r--pacgui.timer10
7 files changed, 126 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..0a9ab0f6d86
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = pacgui
+ pkgdesc = System updates with a simple GUI
+ pkgver = 0.8
+ pkgrel = 1
+ install = pacgui.install
+ arch = any
+ license = GPLv3
+ depends = zenity
+ depends = pacman-contrib
+ source = pacgui.sh
+ source = pacgui.desktop
+ source = pacgui.service
+ source = pacgui.timer
+ sha256sums = adfc19b244b30437b57e45a973ee3f2e3752a077eceaf219fe9c190b12dadc81
+ sha256sums = 18bb664c2365cd9335672e8bcadf89a12a6a017941e6fd133259c52b5dbf05db
+ sha256sums = 958385268a24ae5dee8d8e963efa0ecb9f55d4e36bb30f1c5a66bd97e24d33df
+ sha256sums = 893b87984d9ae8ab9409d1800f8e75fc70ebd869d1a26b37e05598d310065023
+
+pkgname = pacgui
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..a310b3c767f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,27 @@
+# Maintainer: sg
+
+pkgname=pacgui
+pkgver=0.8
+pkgrel=1
+pkgdesc="System updates with a simple GUI"
+arch=('any')
+license=('GPLv3')
+install=${pkgname}.install
+depends=('zenity' 'pacman-contrib')
+source=(${pkgname}.sh
+ ${pkgname}.desktop
+ ${pkgname}.service
+ ${pkgname}.timer)
+sha256sums=('adfc19b244b30437b57e45a973ee3f2e3752a077eceaf219fe9c190b12dadc81'
+ '18bb664c2365cd9335672e8bcadf89a12a6a017941e6fd133259c52b5dbf05db'
+ '958385268a24ae5dee8d8e963efa0ecb9f55d4e36bb30f1c5a66bd97e24d33df'
+ '893b87984d9ae8ab9409d1800f8e75fc70ebd869d1a26b37e05598d310065023')
+
+
+package()
+{
+ install -m755 -D ${srcdir}/${pkgname}.sh ${pkgdir}/usr/bin/${pkgname}.sh
+ install -m644 -D ${srcdir}/${pkgname}.service ${pkgdir}/usr/lib/systemd/user/${pkgname}.service
+ install -m644 -D ${srcdir}/${pkgname}.timer ${pkgdir}/usr/lib/systemd/user/${pkgname}.timer
+ install -m644 -D ${srcdir}/${pkgname}.desktop ${pkgdir}/usr/share/applications/${pkgname}.desktop
+}
diff --git a/pacgui.desktop b/pacgui.desktop
new file mode 100644
index 00000000000..ed7ef34f1c6
--- /dev/null
+++ b/pacgui.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Updates
+Comment=System updates with a simple GUI
+Keywords=updates;
+Exec=/usr/bin/pacgui.sh
+Icon=system-software-update
+Terminal=false
+Categories=GNOME;GTK;System;Settings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;
+Type=Application
+StartupNotify=false
+X-GNOME-UsesNotifications=true
diff --git a/pacgui.install b/pacgui.install
new file mode 100644
index 00000000000..64ba70e852c
--- /dev/null
+++ b/pacgui.install
@@ -0,0 +1,3 @@
+post_install() {
+ echo "Run 'systemctl --user enable pacgui.timer' to get automatic updates every day"
+}
diff --git a/pacgui.service b/pacgui.service
new file mode 100644
index 00000000000..5db8239883d
--- /dev/null
+++ b/pacgui.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=PACGUI
+Wants=network-online.target graphical-session.target
+After=network-online.target graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/env bash pacgui.sh
diff --git a/pacgui.sh b/pacgui.sh
new file mode 100644
index 00000000000..725746336d1
--- /dev/null
+++ b/pacgui.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+pacman_error () {
+zenity --error --text="Error: $1"
+killall zenity
+exit
+}
+
+updates=$(checkupdates)
+if [ $? -eq 0 ]; then
+
+ zenity --info --width=400\
+ --text="Updated packages:\n$(echo "$updates" | awk '{if(FNR <= 10) {print $1} }')"
+
+ zenity --question \
+ --text="Do yout want to continue with the updates?" --width=400
+
+ if [ $? -eq 0 ]; then
+ echo "Upgrade starten!"
+ (
+ echo "10" ; sleep 1
+ echo "# Sync Databases"
+ echo "30" ; nice -15 sudo -S pacman -Syy --noconfirm || pacman_error "Sync"
+ echo "# Downloading Packages" ; sleep 1
+ echo "60" ; nice -15 sudo -S pacman -Syw --noconfirm || pacman_error "Download"
+ echo "# Installing updates" ; sleep 1
+ echo "80" ; nice -15 sudo -S pacman -Syu --noconfirm || pacman_error "Update"
+ echo "# Finished with the updates"
+ echo "100"
+ ) |
+ zenity --progress \
+ --title="System Update" \
+ --text="Databases will be updated …" \
+ --percentage=0 --width=400 || pacman_error
+
+
+ elif [ $? -eq 1 ]; then
+ echo "Upgrades stopped!"
+ else
+ echo "An unexpected error was encountered."
+ fi
+
+else
+ zenity --info --text="No updates available." --width=400
+ exit
+fi
+
diff --git a/pacgui.timer b/pacgui.timer
new file mode 100644
index 00000000000..ae2fc9844b1
--- /dev/null
+++ b/pacgui.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Runs PACGUI daily
+
+[Timer]
+OnCalendar=daily
+Persistent=true
+Unit=pacgui.service
+
+[Install]
+WantedBy=default.target