Fix flatpak not using dark theme (#8964)

* Create set-dark-theme-variant.py

* Update entrypoint

* Update io.github.softfever.OrcaSlicer.yml

* Create uses-dark-theme.py

* Update MPFR to 4.2.2

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
cochcoder
2025-03-29 21:47:18 -04:00
committed by GitHub
parent 41c14281e5
commit 98be94a729
4 changed files with 147 additions and 1 deletions

View File

@@ -19,8 +19,34 @@ finish-args:
- --talk-name=io.github.softfever.OrcaSlicer.InstanceCheck.*
- --system-talk-name=org.freedesktop.UDisks2
- --env=SPNAV_SOCKET=/run/spnav.sock
# set dark theme
- --env=ORCA_SLICER_DARK_THEME=false
modules:
# xprop, xlib is needed to manipulate the X11 window and set _GTK_THEME_VARIANT dark on X11
# and paint the window dark when ORCA_SLICER_DARK_THEME is true
# see: entrypoint & set-dark-theme-variant.py (originated from Pursa Slicer flatpak which originated from spotify client flatpak)
- name: xprop
sources:
- type: archive
url: https://xorg.freedesktop.org/archive/individual/app/xprop-1.2.5.tar.gz
sha256: b7bf6b6be6cf23e7966a153fc84d5901c14f01ee952fbd9d930aa48e2385d670
- name: python-setuptools_scm
buildsystem: simple
build-commands:
- pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} .
sources:
- type: archive
url: https://files.pythonhosted.org/packages/57/38/930b1241372a9f266a7df2b184fb9d4f497c2cef2e016b014f82f541fe7c/setuptools_scm-6.0.1.tar.gz
sha256: d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92
- name: python-xlib
buildsystem: simple
build-commands:
- pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} .
sources:
- type: archive
url: https://files.pythonhosted.org/packages/86/f5/8c0653e5bb54e0cbdfe27bf32d41f27bc4e12faa8742778c17f2a71be2c0/python-xlib-0.33.tar.gz
sha256: 55af7906a2c75ce6cb280a584776080602444f75815a7aff4d287bb2d7018b32
# JPEG codec for the liveview
- name: gst-plugins-good
@@ -299,6 +325,8 @@ modules:
desktop-file-edit --set-key=Exec --set-value="entrypoint %U" /app/share/applications/${FLATPAK_ID}.desktop
install -Dm755 entrypoint /app/bin
install -Dm755 umount /app/bin
install set-dark-theme-variant.py /app/bin
install uses-dark-theme.py /app/bin
sources:
# -
@@ -316,6 +344,14 @@ modules:
- type: file
path: io.github.softfever.OrcaSlicer.metainfo.xml
# script to set dark theme variant
- type: file
path: set-dark-theme-variant.py
# script to detect if host uses dark theme
- type: file
path: uses-dark-theme.py
# start-up script
- type: file
path: entrypoint