From 341b1f2dff74c36e6e28cfdde284d21abb9bac17 Mon Sep 17 00:00:00 2001
From: justinz <justin@1707.io>
Date: Wed, 17 May 2023 05:48:32 +0000
Subject: [PATCH] Move files out of Containerfile and into files sub-directory.
 Clean up comments and general tidying

---
 Containerfile         | 52 +++++++++++++++++--------------------------
 files/autologin.conf  |  3 +++
 files/kdeglobals      |  8 +++++++
 files/kscreenlockerrc |  5 +++++
 files/kwinrc          |  3 +++
 5 files changed, 39 insertions(+), 32 deletions(-)
 create mode 100644 files/autologin.conf
 create mode 100644 files/kdeglobals
 create mode 100644 files/kscreenlockerrc
 create mode 100644 files/kwinrc

diff --git a/Containerfile b/Containerfile
index 604d3bd..fc146f3 100644
--- a/Containerfile
+++ b/Containerfile
@@ -1,21 +1,21 @@
-# Get Fedora Base Image
+# Use Fedora Base Image
 FROM registry.fedoraproject.org/fedora:latest
 
-# Get DNF5 as it's faster
+# Instal DNF5 as it is much more performant
 RUN dnf install -y dnf5 dnf5-plugins
 RUN dnf5 install -y dnf5 dnf5-plugins 
 
-# Need a few bits from Copr
+# Enable justinz/op6 Copr
 RUN dnf install -y 'dnf-command(copr)'
 RUN dnf copr enable -y justinz/op6
 
-# Install Plasma Mobile
+# Install Plasma Mobile Packages
 RUN dnf5 install -y kscreen \
                     maliit-keyboard \
                     plasma-mobile \
                     sddm
 
-# Install Apps
+# Install Plasma Mobile Apps Packages
 RUN dnf5 install -y \
                            angelfish \
                            bluedevil \
@@ -33,19 +33,19 @@ RUN dnf5 install -y \
                            qmlkonsole \
                            spacebar
 
-# Install Tools
+# Install Tool Packages
 RUN dnf5 install -y nano \
                     openssh-server \
                     util-linux \
                     util-linux-user
 
-# Install SDM845 packages
+# Install SDM845 Packages
 RUN dnf5 instal -y pd-mapper \
                    qbootctl \
                    rmtfs \
                    tqftpserv
 
-# Install Network
+# Install Network Packages
 RUN dnf5 install -y iproute \
                     iputils \
                     NetworkManager-bluetooth \
@@ -60,39 +60,27 @@ RUN groupadd -g 1000 user && \
   useradd -g 1000 -G wheel -m -u 1000 user && \
   echo 'user:147147' | chpasswd
 
-# Set boot device
+# Set Boot Device
 RUN echo '/dev/mapper/sda17p2 / ext4 rw,relatime 0 0' > /etc/fstab
 
-# Enable Systemd Service
-RUN systemctl enable sshd
-RUN systemctl enable pd-mapper
-RUN systemctl enable tqftpserv
-RUN systemctl enable rmtfs
-RUN systemctl enable qbootctl-mark-boot-successful
-RUN systemctl enable sddm
+# Enable Systemd Services
+RUN systemctl enable pd-mapper \
+                     qbootctl-mark-boot-successful \
+                     rmtfs \
+                     sddm \
+                     sshd \
+                     tqftpserv
 
 # Setup Autologin in SDDM
-RUN echo '[Autologin]' > /etc/sddm.conf.d/autologin.conf
-RUN echo 'User=user' >> /etc/sddm.conf.d/autologin.conf
-RUN echo 'Session=plasma-mobile' >> /etc/sddm.conf.d/autologin.conf
+RUN cp files/autologin.conf /etc/sddm.conf.d/autologin.conf
 
 # Setup Default Browser and Look and Feel
-RUN echo '# SPDX-FileCopyrightText: None' > /etc/xdg/kdeglobals
-RUN echo '# SPDX-License-Identifier: CC0-1.0' >> /etc/xdg/kdeglobals
-RUN echo '[General]' >> /etc/xdg/kdeglobals
-RUN echo 'BrowserApplication[$e]=!angelfish' >> /etc/xdg/kdeglobals
-RUN echo '[KDE]' >> /etc/xdg/kdeglobals
-RUN echo 'LookAndFeelPackage=org.kde.plasma.phone' >> /etc/xdg/kdeglobals
+RUN cp files/kdeglobals /etc/xdg/kdeglobals
 
 # Setup Auto Screen Lock on Login
-RUN echo '# SPDX-FileCopyrightText: None' > /etc/xdg/kscreenlockerrc
-RUN echo '# SPDX-License-Identifier: CC0-1.0' >> /etc/xdg/kscreenlockerrc
-RUN echo '[Daemon]' >> /etc/xdg/kscreenlockerrc
-RUN echo 'LockOnStart=true' >> /etc/xdg/kscreenlockerrc
+RUN cp files/kscreenlockerrc /etc/xdg/kscreenlockerrc
 
 # Set Virtual Keyboard to Maliit
-RUN echo '[Wayland]' > /etc/xdg/kwinrc
-RUN echo 'InputMethod[$e]=/usr/share/applications/com.github.maliit.keyboard.desktop' >> /etc/xdg/kwinrc
-RUN echo 'VirtualKeyboardEnabled=true' >> /etc/xdg/kwinrc
+RUN cp files/kwinrc /etc/xdg/kwinrc
 
 ENTRYPOINT ["/bin/bash", "-l", "-i"]
diff --git a/files/autologin.conf b/files/autologin.conf
new file mode 100644
index 0000000..5380156
--- /dev/null
+++ b/files/autologin.conf
@@ -0,0 +1,3 @@
+[Autologin]
+User=user
+Session=plasma-mobile
\ No newline at end of file
diff --git a/files/kdeglobals b/files/kdeglobals
new file mode 100644
index 0000000..dbceef6
--- /dev/null
+++ b/files/kdeglobals
@@ -0,0 +1,8 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+[General]
+BrowserApplication[$e]=!angelfish
+
+[KDE]
+LookAndFeelPackage=org.kde.plasma.phone
\ No newline at end of file
diff --git a/files/kscreenlockerrc b/files/kscreenlockerrc
new file mode 100644
index 0000000..70170e4
--- /dev/null
+++ b/files/kscreenlockerrc
@@ -0,0 +1,5 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+[Daemon]
+LockOnStart=true
\ No newline at end of file
diff --git a/files/kwinrc b/files/kwinrc
new file mode 100644
index 0000000..698bd0a
--- /dev/null
+++ b/files/kwinrc
@@ -0,0 +1,3 @@
+[Wayland]
+InputMethod[$e]=/usr/share/applications/com.github.maliit.keyboard.desktop
+VirtualKeyboardEnabled=true
\ No newline at end of file
-- 
GitLab