Prelim: Improve wsetupx based on smss

This commit is contained in:
Rory Fewell
2025-07-04 01:13:12 +01:00
parent 01485cd0b0
commit 896b8091fa
6 changed files with 82 additions and 19 deletions

View File

@@ -90,13 +90,28 @@ target_link_libraries(
#
wintc_configure_and_install_packaging()
configure_file(
res/startwsetupx.in
startwsetupx
@ONLY
)
configure_file(
res/xinitrc.in
xinitrc
@ONLY
)
install(
FILES res/wsetupx.service
DESTINATION ${WINTC_ASSETS_INSTALL_DIR}/setup
DESTINATION ${WINTC_ASSETS_INSTALL_DIR}/wsetupx
)
install(
FILES src/xinitrc
DESTINATION ${WINTC_ASSETS_INSTALL_DIR}/setup
PROGRAMS ${CMAKE_BINARY_DIR}/startwsetupx
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
FILES ${CMAKE_BINARY_DIR}/xinitrc
DESTINATION ${WINTC_ASSETS_INSTALL_DIR}/wsetupx
)
install(
TARGETS wintc-setup-gui

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env sh
#
# Based off of smss, should keep in sync somewhat
#
# FIXME: Add a check to see if we really should start setup (that it has been
# armed)
#
# Set up XDG vars
#
XDG_DATA_DIRS="/usr/local/share:/usr/share"
export XDG_DATA_DIRS
XDG_CONFIG_DIRS="/etc/xdg"
export XDG_CONFIG_DIRS
XDG_CONFIG_HOME=/root/.config
export XDG_CONFIG_HOME
XDG_CACHE_HOME=/root/.cache
export XDG_CACHE_HOME
DESKTOP_SESSION="WINTC"
XDG_CURRENT_DESKTOP="WINTC"
export DESKTOP_SESSION
export XDG_CURRENT_DESKTOP
# FIXME: This might only work on systemd due to XDG_VTNR, figure out what to
# do on other init systems
#
launch_exe="xinit"
if [ ! -z "$DISPLAY" ]
then
launch_exe="sh"
fi
$launch_exe @CMAKE_INSTALL_PREFIX@/@WINTC_ASSETS_INSTALL_DIR@/wsetupx/xinitrc -- /etc/X11/xinit/xserverrc vt$XDG_VTNR

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env sh
# FIXME: See smss about this
#
xfsettingsd --disable-wm-check --replace --daemon
# Launch setup
#
dbus-run-session -- wsetupx

View File

@@ -6,7 +6,7 @@
#include "arm.h"
#define WINTC_SETUP_ASSETS_DIR WINTC_ASSETS_DIR "/setup"
#define WINTC_SETUP_ASSETS_DIR WINTC_ASSETS_DIR "/wsetupx"
//
// PUBLIC FUNCTIONS

View File

@@ -2,6 +2,7 @@
#include <gtk/gtk.h>
#include <stdlib.h>
#include <wintc/comgtk.h>
#include <wintc/exec.h>
#include <wintc/shelldpa.h>
#include "arm.h"
@@ -91,7 +92,20 @@ int main(
if (!wintc_init_display_protocol_apis())
{
g_critical("%s", "Failed to resolve display protocol APIs.");
return 0;
return EXIT_FAILURE;
}
// Fire up xfwm4
//
if (
!wintc_launch_command(
"xfwm4 --compositor=on",
&error
)
)
{
wintc_log_error_and_clear(&error);
return EXIT_FAILURE;
}
// Set up styling

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env sh
# Must start a DBus session
#
eval `dbus-launch`
export DBUS_SESSION_BUS_ADDRESS
export DBUS_SESSION_BUS_PID
# Launch setup
#
xfwm4 --replace --compositor=on &
wsetupx