summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Xhokaxhiu2016-09-12 15:46:36 +0200
committerJulian Xhokaxhiu2016-09-12 15:46:36 +0200
commit118391e2766b6b56629fcf052a1342166411bdd4 (patch)
tree2f0a003d03008dc7828bb2026e847c2db821654b
parent31f8f88dc0356ae1e3c139d22a1823346a093039 (diff)
downloadaur-118391e2766b6b56629fcf052a1342166411bdd4.tar.gz
Refactor the script
Now we require xlogin since the simple Shell script does not work. Add also a .xinitrc file for the autostart of Chrome using xinit.
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD21
-rw-r--r--chromium-fullscreen.install8
-rw-r--r--chromium-fullscreen.xinitrc16
4 files changed, 34 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7891e497ad86..e8976b6c5060 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = chromium-fullscreen
- pkgdesc = Systemd service and user to run Chromium in fullscreen mode
+ pkgdesc = A script in order to run Chromium in fullscreen mode under the chromium user
pkgver = 1
- pkgrel = 1
+ pkgrel = 2
install = chromium-fullscreen.install
arch = x86_64
arch = i686
@@ -13,12 +13,11 @@ pkgbase = chromium-fullscreen
depends = xorg-xrandr
depends = xorg-xinit
depends = chromium
- source = chromium-fullscreen.service
+ depends = xlogin-git
source = chromium-fullscreen.sysuser
- source = chromium-fullscreen.sh
- md5sums = c1b2275b9f28359fe8742b6ed0f120e1
+ source = chromium-fullscreen.xinitrc
md5sums = 9e979fbdd1e4a5a04fd0e91ce6a9a7be
- md5sums = 9cdf91af72c57eb9e4f359942ced5ddd
+ md5sums = 9fb3d73709f7461c8381183ac93a4e79
pkgname = chromium-fullscreen
diff --git a/PKGBUILD b/PKGBUILD
index a4bfd47ad461..e3eb1e689f70 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,26 +1,21 @@
# Author: Julian Xhokaxhiu <info@julianxhokaxhiu.com>
pkgname=chromium-fullscreen
pkgver=1
-pkgrel=1
-pkgdesc="Systemd service and user to run Chromium in fullscreen mode"
+pkgrel=2
+pkgdesc="A script in order to run Chromium in fullscreen mode under the chromium user"
url=""
arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h')
license=('MIT')
-depends=('xorg-server' 'xorg-xrandr' 'xorg-xinit' 'chromium')
+depends=('xorg-server' 'xorg-xrandr' 'xorg-xinit' 'chromium' 'xlogin-git')
install='chromium-fullscreen.install'
-source=('chromium-fullscreen.service'
- 'chromium-fullscreen.sysuser'
- 'chromium-fullscreen.sh')
-md5sums=('c1b2275b9f28359fe8742b6ed0f120e1'
- '9e979fbdd1e4a5a04fd0e91ce6a9a7be'
- '9cdf91af72c57eb9e4f359942ced5ddd')
+source=('chromium-fullscreen.sysuser'
+ 'chromium-fullscreen.xinitrc')
+md5sums=('9e979fbdd1e4a5a04fd0e91ce6a9a7be'
+ '9fb3d73709f7461c8381183ac93a4e79')
package() {
# Copy autorun script
- install -Dm644 ${srcdir}/chromium-fullscreen.sh "$pkgdir/home/chromium/.systemd/chromium-fullscreen.sh"
-
- #Install service file
- install -Dm644 ${srcdir}/chromium-fullscreen.service "$pkgdir/usr/lib/systemd/system/chromium-fullscreen.service"
+ install -Dm644 ${srcdir}/chromium-fullscreen.xinitrc "$pkgdir/home/chromium/.xinitrc"
#Install sysuser config
install -Dm644 ${srcdir}/chromium-fullscreen.sysuser "$pkgdir/usr/lib/sysusers.d/chromium-fullscreen.conf"
diff --git a/chromium-fullscreen.install b/chromium-fullscreen.install
index 0e32523c5931..a0dca1e6886d 100644
--- a/chromium-fullscreen.install
+++ b/chromium-fullscreen.install
@@ -6,18 +6,20 @@ post_install() {
mkdir -p /home/chromium
# Create a first sample of Autostart Url
- echo -e "https://www.archlinux.org/\n" >> /home/chromium/chromium-autostart-url.txt
+ echo -e "https://www.archlinux.org/\n" > /home/chromium/chromium-autostart-url.txt
# Fix permissions
chown -R chromium:chromium /home/chromium
+ # Enable the xlogin service
+ systemctl enable xlogin@chromium
+
# Print additional useful informations
echo -e "==> [INFO] For comodity, the file '/home/chromium/chromium-autostart-url.txt' has been created for you. That file although can be located also on:"
echo -e "==> [INFO] - '/boot/chromium-autostart-url.txt'"
echo -e "==> [INFO] - '/home/chromium/chromium-autostart-url.txt'"
echo -e "==> [INFO] Order is mandatory! The first that matches, is the first that wins."
- echo -e "==> [INFO] To run Chromium Fullscreen everytime at boot please run ==> systemctl enable chromium-fullscreen.service"
- echo -e "==> [INFO] To simply start Chromium Fullscreen just run ==> systemctl start chromium-fullscreen.service"
+ echo -e "==> [INFO] Please restart in order to start Chromium Fullscreen."
}
post_upgrade() {
diff --git a/chromium-fullscreen.xinitrc b/chromium-fullscreen.xinitrc
new file mode 100644
index 000000000000..05b08a850e68
--- /dev/null
+++ b/chromium-fullscreen.xinitrc
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# The URL variuabile where we will store the final address to open
+URL=''
+
+# This is usually the case of a Raspberry Pi-like installation ( arm platforms )
+if [ -f "/boot/chromium-autostart-url.txt" ]; then
+ URL=`cat /boot/chromium-autostart-url.txt`
+# This is probably the case of generic setups on x86 platforms
+elif [ -f "/home/chromium/chromium-autostart-url.txt" ]; then
+ URL=`cat /home/chromium/chromium-autostart-url.txt`
+fi
+
+
+# Autostart Chromium in Fullscreen mode
+exec /usr/bin/chromium --desktop-window-1080p --kiosk "$URL"