Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • reform/mnt-reform-setup-wizard
  • josch/mnt-reform-setup-wizard
2 results
Show changes
Commits on Source (7)
#!/bin/sh
# This script is run after the setup wizard has completed successfully.
#
# This script is run by the setup wizard after the setup wizard has completed successfully.
# 1. Remove autostart of reform-setup
rm /etc/profile.d/reform-setup
rm /etc/profile.d/reform-setup.sh
# 2. Remove root autologin
rm /etc/systemd/system/getty@tty1.service.d/override.conf
systemctl daemon-reload
# 3. Enable and start greetd
systemctl enable greetd
systemctl start greetd
# 4. Exit
pkill sway
exit
# SPDX-License-Identifier: GPL-3.0+
# Copyright 2024 MNT Research GmbH
#
# This is a special configuration file for sway so we can
# use sway as a minimal compositor for running the
# MNT Reform Setup Wizard (a GTK4 application).
# We use sway as it ships with Reform and is much more
# customizable than cage, while still being lightweight.
#
# import variables into system-user enviroment
# based on the instructions in the sway wiki
# see also https://github.com/swaywm/sway/issues/5732
# and https://github.com/systemd/systemd/blob/dfc637d0ff756889e8e5b7cb4ec991eb06069aa1/xorg/50-systemd-user.sh
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
# emergency/debug terminal
set $mod Mod4
bindsym $mod+Return exec foot
# reload the configuration file
bindsym $mod+Shift+c reload
# workaround for RK3588, to be removed
output HDMI-A-2 disable
# display config for MNT Pocket Reform
output DSI-1 transform 270
output DSI-1 scale 2
# background image
exec swaybg -i /usr/share/backgrounds/reform-mountains.jpg
# start gnome xsettings daemon
exec /usr/libexec/gsd-xsettings
# default theme settings
exec gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark'
exec gsettings set org.gnome.desktop.interface font-name 'Inter Medium 11'
exec gsettings set org.gnome.desktop.interface monospace-font-name 'Iosevka Term 11'
exec gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'
exec gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
# remove sway's decorations
default_border pixel 0
hide_edge_borders both
# ADW_DISABLE_PORTAL so that dark theme works
exec ADW_DISABLE_PORTAL=1 reform-setup
......@@ -304,7 +304,7 @@ fn build_keyboard_page(stack: &Stack) -> StackPage {
let search_exp = gtk::PropertyExpression::new(gtk::StringObject::static_type(), None::<gtk::Expression>, "string");
dropdown.set_expression(Some(search_exp));
dropdown.set_search_match_mode(gtk::StringFilterMatchMode::Substring);
let default_index = layout_vals.iter().position(|v| v.layout == "us" && v.variant == "").unwrap();
let default_index = layout_vals.iter().position(|v| v.layout == "eu" && v.variant == "").unwrap();
dropdown.set_selected(default_index as u32);
let layout_label = &Label::new(Some("Please select your keyboard layout:"));
......@@ -409,7 +409,6 @@ fn build_time_page(stack: &Stack) -> StackPage {
button_next.connect_clicked(
clone!(@weak stack => move |_| {
// in a non-chroot environment we might want to use timedatectl instead
let tz = match list.string(dropdown.selected()) {
Some(s) => s,
_ => {
......@@ -431,6 +430,16 @@ fn build_time_page(stack: &Stack) -> StackPage {
return
}
};
match std::env::var("CHROOT_MODE") {
Ok(_) => (),
_ => match run_command("set timezone", "timedatectl", ["set-timezone", &tz].to_vec()) {
Ok(_) => (),
Err(e) => {
error_label.set_label(&e);
return
}
}
};
stack.set_visible_child_full("desktop", gtk::StackTransitionType::SlideLeft);
})
);
......@@ -636,6 +645,13 @@ fn build_hostname_page(stack: &Stack) -> StackPage {
return
}
}
match run_command("run hostname", "hostname", ["--file", PATH_ETC_HOSTNAME].to_vec()) {
Ok(_) => (),
Err(e) => {
error_label.set_label(&e);
return
}
};
stack.set_visible_child_full("account", gtk::StackTransitionType::SlideLeft);
})
);
......
......@@ -36,7 +36,7 @@ sudo chroot "${CHROOT_PATH}" dpkg-reconfigure --frontend noninteractive locales
# xhost +/- allows the Wizard to access the X Server for display
xhost +
sudo chroot "${CHROOT_PATH}" "${chroot_path_wizard}"
sudo chroot "${CHROOT_PATH}" /bin/bash -c "CHROOT_MODE=1 ${chroot_path_wizard}"
xhost -
exit 0