From 7ac201e7268131745a8b7e029c9dd68a68f5279b Mon Sep 17 00:00:00 2001
From: langfingaz <daniel@systemli.org>
Date: Wed, 5 May 2021 16:54:51 +0200
Subject: [PATCH] xfce4, xorg work in progress (2)

---
 pkg/de-p1st-xfce4-hidpi/.install    | 14 ++++++++++++++
 pkg/de-p1st-xfce4-hidpi/99_hidpi.sh |  2 ++
 pkg/de-p1st-xfce4-hidpi/PKGBUILD    | 21 +++++++++++++++++++++
 pkg/de-p1st-xfce4/PKGBUILD          | 21 ++++++++++++++-------
 pkg/xorg-meta/PKGBUILD              |  2 +-
 5 files changed, 52 insertions(+), 8 deletions(-)
 create mode 100644 pkg/de-p1st-xfce4-hidpi/.install
 create mode 100644 pkg/de-p1st-xfce4-hidpi/99_hidpi.sh
 create mode 100644 pkg/de-p1st-xfce4-hidpi/PKGBUILD

diff --git a/pkg/de-p1st-xfce4-hidpi/.install b/pkg/de-p1st-xfce4-hidpi/.install
new file mode 100644
index 0000000..f34b029
--- /dev/null
+++ b/pkg/de-p1st-xfce4-hidpi/.install
@@ -0,0 +1,14 @@
+## arg 1:  the new package version
+post_install() {
+  # Show desktop icons on primary desktop,
+  # otherwise some of them might be invisible (as they are too far down the screen)
+  xfconf-query --create -c xfce4-desktop -p /desktop-icons/primary -t 'bool' -s 'true'
+  # Double the scaling factor
+  xfconf-query -c xsettings -p /Gdk/WindowScalingFactor -s 2
+}
+
+## arg 1:  the old package version
+post_remove() {
+  # TODO: restore previous xfconf values
+  true
+}
\ No newline at end of file
diff --git a/pkg/de-p1st-xfce4-hidpi/99_hidpi.sh b/pkg/de-p1st-xfce4-hidpi/99_hidpi.sh
new file mode 100644
index 0000000..e58035a
--- /dev/null
+++ b/pkg/de-p1st-xfce4-hidpi/99_hidpi.sh
@@ -0,0 +1,2 @@
+QT_AUTO_SCREEN_SCALE_FACTOR=1
+QT_FONT_DPI=144
diff --git a/pkg/de-p1st-xfce4-hidpi/PKGBUILD b/pkg/de-p1st-xfce4-hidpi/PKGBUILD
new file mode 100644
index 0000000..b62cb49
--- /dev/null
+++ b/pkg/de-p1st-xfce4-hidpi/PKGBUILD
@@ -0,0 +1,21 @@
+# Maintainer: Daniel Langbein <daniel@systemli.org>
+_pkgname=xfce4-hidpi
+_reponame=arch
+pkgname="de-p1st-$_pkgname"
+pkgver=0.0.1
+pkgrel=1
+pkgdesc="HiDPI for XFCE4"
+arch=('any')
+url="https://codeberg.org/privacy1st/${_reponame}"
+license=('MIT')
+install='.install'
+
+depends=(de-p1st-xfce4)
+
+package() {
+  cd "${_reponame}/pkg/${pkgname}"
+
+  # .install modifies xfconf values
+
+  install -Dm0644 99_hidpi.sh "$pkgdir"/etc/profile.d/99_hidpi.sh
+}
\ No newline at end of file
diff --git a/pkg/de-p1st-xfce4/PKGBUILD b/pkg/de-p1st-xfce4/PKGBUILD
index 90f18da..3a84d74 100644
--- a/pkg/de-p1st-xfce4/PKGBUILD
+++ b/pkg/de-p1st-xfce4/PKGBUILD
@@ -12,14 +12,12 @@ license=('MIT')
 
 depends=()
 
-# ============== DRIVERS ==============
+# ============== DRIVERS and xorg ==============
 depends+=(de-p1st-gpu)
+depends+=(xorg-meta)
 
-# ============== xorg and XFCE4 ==============
+# ============== XFCE4 ==============
 #
-
-
-
 # xfce4 group
 # pacman -Sg xfce4 | sed 's|^xfce4 |depends+=(|; s|$|)|'
 depends+=(xfce4-meta)
@@ -35,8 +33,6 @@ depends+=(mousepad thunar-archive-plugin thunar-media-tags-plugin xfce4-genmon-p
 #   - gvfs: for trash support, mounting with udisk and remote
 #           filesystems (e.g. webdav)
 depends+=(gvfs)
-# NetworkManager applet
-depends+=(network-manager-applet)
 # keyring/secrets
 # ->  https://wiki.archlinux.org/index.php/GNOME/Keyring
 depends+=(gnome-keyring libsecret)
@@ -44,6 +40,17 @@ depends+=(gnome-keyring libsecret)
 # ============== display manager ==============
 depends+=(sddm)
 
+# ============== network, theme, keyboard ==============
+#
+# NetworkManager applet
+depends+=(network-manager-applet)  # depends on networkmanager
+#
+# gtk and qt theme
+depends+=(de-p1st-theme)
+#
+# x11 keyboard layouts (TODO: move this to xorg package)
+depends+=(de-p1st-keyboard-x11)
+
 
 makedepends=('git')
 
diff --git a/pkg/xorg-meta/PKGBUILD b/pkg/xorg-meta/PKGBUILD
index 40da164..9618a2f 100644
--- a/pkg/xorg-meta/PKGBUILD
+++ b/pkg/xorg-meta/PKGBUILD
@@ -11,7 +11,7 @@ license=('MIT')
 depends=()
 # xorg group
 # pacman -Sg xorg | sed 's|^xorg |depends+=(|; s|$|)|'
-depends+=(xf86-video-vesa)  # if no specific driver is found by xorg, then this generic one is used
+depends+=(xf86-video-vesa)  # if no device specific driver (see de-p1st-gpu) is found by xorg, then this generic one is used
 depends+=(xorg-bdftopcf)
 depends+=(xorg-docs)
 depends+=(xorg-font-util)