Setup Project

This commit is contained in:
Ward from fusion-voyager-3 2024-02-24 00:28:26 +03:00
parent ff3e94e31d
commit 1222b00218
19 changed files with 874 additions and 879 deletions

2
Cargo.lock generated
View File

@ -815,7 +815,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
[[package]] [[package]]
name = "pika-first-setup-gtk4" name = "pika-welcome"
version = "1.0.1" version = "1.0.1"
dependencies = [ dependencies = [
"async-channel", "async-channel",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "pika-first-setup-gtk4" name = "pika-welcome"
version = "1.0.1" version = "5.0.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -7,15 +7,15 @@ install:
mkdir -p $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/usr/bin/
cargo fetch cargo fetch
cargo build --release cargo build --release
cp -vf target/release/pika-first-setup-gtk4 $(DESTDIR)/usr/bin/ cp -vf target/release/pika-welcome $(DESTDIR)/usr/bin/
chmod 755 $(DESTDIR)/usr/bin/pika-first-setup-gtk4 chmod 755 $(DESTDIR)/usr/bin/pika-welcome
mkdir -p $(DESTDIR)/usr/share/glib-2.0/schemas/ mkdir -p $(DESTDIR)/usr/share/glib-2.0/schemas/
mkdir -p $(DESTDIR)/usr/lib/pika/pika-first-setup-gtk4/scripts/ mkdir -p $(DESTDIR)/usr/lib/pika/pika-welcome/scripts/
cp -rvf data/scripts/*.sh $(DESTDIR)/usr/lib/pika/pika-first-setup-gtk4/scripts/ cp -rvf data/scripts/*.sh $(DESTDIR)/usr/lib/pika/pika-welcome/scripts/
chmod 755 $(DESTDIR)/usr/lib/pika/pika-first-setup-gtk4/scripts/*.sh chmod 755 $(DESTDIR)/usr/lib/pika/pika-welcome/scripts/*.sh
cp data/com.github.pikaos-linux.pikafirstsetup.gschema.xml $(DESTDIR)/usr/share/glib-2.0/schemas/ cp data/com.github.pikaos-linux.pikawelcome.gschema.xml $(DESTDIR)/usr/share/glib-2.0/schemas/
mkdir -p $(DESTDIR)/usr/share/applications mkdir -p $(DESTDIR)/usr/share/applications
cp -vf data/com.github.pikaos-linux.pikafirstsetup.desktop $(DESTDIR)/usr/share/applications/ cp -vf data/com.github.pikaos-linux.pikawelcome.desktop $(DESTDIR)/usr/share/applications/
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/scalable/apps mkdir -p $(DESTDIR)/usr/share/icons/hicolor/scalable/apps
cp -vf data/com.github.pikaos-linux.pikafirstsetup.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/ cp -vf data/com.github.pikaos-linux.pikawelcome.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
#makepot $(DESTDIR)/usr/share/locale #makepot $(DESTDIR)/usr/share/locale

View File

@ -5,4 +5,4 @@ for handling initial user setup on PikaOS.
### Help Us ### Help Us
#### You can help by translating the app #### You can help by translating the app
[Weblate](https://hosted.weblate.org/projects/pikaos/pika-first-setup/) [Weblate](https://hosted.weblate.org/projects/pikaos/pika-welcome/)

View File

@ -1,10 +1,10 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=PikaOS Initial User Setup Name=PikaOS Initial User Setup
Exec=pika-first-setup-gtk4 Exec=pika-welcome
Hidden=false Hidden=false
NoDisplay=true NoDisplay=true
Icon=com.github.pikaos-linux.pikafirstsetup Icon=com.github.pikaos-linux.pikawelcome
X-GNOME-Autostart-enabled=true X-GNOME-Autostart-enabled=true
X-KDE-AutostartScript=true X-KDE-AutostartScript=true
Categories=GNOME;GTK;Utility; Categories=GNOME;GTK;Utility;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<schemalist> <schemalist>
<schema id="com.github.pikaos-linux.pikafirstsetup" path="/com/github/pikaos-linux/pikafirstsetup/"> <schema id="com.github.pikaos-linux.pikawelcome" path="/com/github/pikaos-linux/pikafirstsetup/">
<key name="window-width" type="i"> <key name="window-width" type="i">
<default>700</default> <default>700</default>
<summary>Default window width</summary> <summary>Default window width</summary>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 105 KiB

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
pika-first-setup (1.0.1-100pika3) pikauwu; urgency=low pika-welcome (5.0.0-100pika1) pikauwu; urgency=low
* First release * First release

4
debian/control vendored
View File

@ -1,4 +1,4 @@
Source: pika-first-setup Source: pika-welcome
Section: utils Section: utils
Priority: optional Priority: optional
Maintainer: International Arms dealers <chipichipi@chapachapa.com> Maintainer: International Arms dealers <chipichipi@chapachapa.com>
@ -12,7 +12,7 @@ Build-Depends: build-essential,
libvte-2.91-gtk4-dev libvte-2.91-gtk4-dev
Rules-Requires-Root: no Rules-Requires-Root: no
Package: pika-first-setup-gtk4 Package: pika-welcome
Architecture: any Architecture: any
Depends: ${shlibs:Depends} Depends: ${shlibs:Depends}
Description: A frontend in GTK 4 and Libadwaita for initial user setup in pika. Description: A frontend in GTK 4 and Libadwaita for initial user setup in pika.

24
debian/rules vendored
View File

@ -10,17 +10,17 @@ export PATH := "/root/.cargo/bin:$(PWD):$(PATH)"
dh $@ dh $@
override_dh_auto_install: override_dh_auto_install:
mkdir -p debian/pika-first-setup-gtk4/usr/bin/ mkdir -p debian/pika-welcome/usr/bin/
/root/.cargo/bin/cargo fetch /root/.cargo/bin/cargo fetch
/root/.cargo/bin/cargo build --release /root/.cargo/bin/cargo build --release
cp -vf target/release/pika-first-setup-gtk4 debian/pika-first-setup-gtk4/usr/bin/ cp -vf target/release/pika-welcome debian/pika-welcome/usr/bin/
chmod 755 debian/pika-first-setup-gtk4/usr/bin/pika-first-setup-gtk4 chmod 755 debian/pika-welcome/usr/bin/pika-welcome
mkdir -p debian/pika-first-setup-gtk4/usr/share/glib-2.0/schemas/ mkdir -p debian/pika-welcome/usr/share/glib-2.0/schemas/
mkdir -p debian/pika-first-setup-gtk4/usr/lib/pika/pika-first-setup-gtk4/scripts/ mkdir -p debian/pika-welcome/usr/lib/pika/pika-welcome/scripts/
cp -rvf data/scripts/*.sh debian/pika-first-setup-gtk4/usr/lib/pika/pika-first-setup-gtk4/scripts/ cp -rvf data/scripts/*.sh debian/pika-welcome/usr/lib/pika/pika-welcome/scripts/
chmod 755 debian/pika-first-setup-gtk4/usr/lib/pika/pika-first-setup-gtk4/scripts/*.sh chmod 755 debian/pika-welcome/usr/lib/pika/pika-welcome/scripts/*.sh
cp data/com.github.pikaos-linux.pikafirstsetup.gschema.xml debian/pika-first-setup-gtk4/usr/share/glib-2.0/schemas/ cp data/com.github.pikaos-linux.pikawelcome.gschema.xml debian/pika-welcome/usr/share/glib-2.0/schemas/
mkdir -p debian/pika-first-setup-gtk4/usr/share/applications mkdir -p debian/pika-welcome/usr/share/applications
cp -vf data/com.github.pikaos-linux.pikafirstsetup.desktop debian/pika-first-setup-gtk4/usr/share/applications/ cp -vf data/com.github.pikaos-linux.pikawelcome.desktop debian/pika-welcome/usr/share/applications/
mkdir -p debian/pika-first-setup-gtk4/usr/share/icons/hicolor/scalable/apps mkdir -p debian/pika-welcome/usr/share/icons/hicolor/scalable/apps
cp -vf data/com.github.pikaos-linux.pikafirstsetup.svg debian/pika-first-setup-gtk4/usr/share/icons/hicolor/scalable/apps/ cp -vf data/com.github.pikaos-linux.pikawelcome.svg debian/pika-welcome/usr/share/icons/hicolor/scalable/apps/

View File

@ -1,7 +1,7 @@
# Clone Upstream # Clone Upstream
mkdir -p ./pika-first-setup mkdir -p ./pika-welcome
rsync -av --progress ./* ./pika-first-setup --exclude ./pika-first-setup rsync -av --progress ./* ./pika-welcome --exclude ./pika-welcome
cd ./pika-first-setup cd ./pika-welcome
# Get build deps # Get build deps
apt-get build-dep ./ -y apt-get build-dep ./ -y

View File

@ -5,5 +5,5 @@ set -e
for i in po/*.po for i in po/*.po
do do
mkdir -p "$1"/"$(echo $i | cut -d"/" -f2 | cut -d"." -f1)"/LC_MESSAGES mkdir -p "$1"/"$(echo $i | cut -d"/" -f2 | cut -d"." -f1)"/LC_MESSAGES
msgfmt -v $i -o "$1"/"$(echo $i | cut -d"/" -f2 | cut -d"." -f1)"/LC_MESSAGES/pika-first-setup-gtk4.mo msgfmt -v $i -o "$1"/"$(echo $i | cut -d"/" -f2 | cut -d"." -f1)"/LC_MESSAGES/pika-welcome.mo
done done

View File

@ -21,7 +21,7 @@ pub fn build_ui(app: &adw::Application) {
.application(app) .application(app)
// Add the box called "window_box" to it // Add the box called "window_box" to it
// Application icon // Application icon
.icon_name("com.github.pikaos-linux.pikafirstsetup") .icon_name("com.github.pikaos-linux.pikawelcome")
// Minimum Size/Default // Minimum Size/Default
.width_request(700) .width_request(700)
.height_request(500) .height_request(500)
@ -29,7 +29,7 @@ pub fn build_ui(app: &adw::Application) {
.hide_on_close(true) .hide_on_close(true)
.deletable(false) .deletable(false)
// Startup // Startup
.startup_id("com.github.pikaos-linux.pikafirstsetup") .startup_id("com.github.pikaos-linux.pikawelcome")
// build the window // build the window
.build(); .build();

View File

@ -1,7 +1,2 @@
pub const APP_ID: &str = "com.github.pikaos-linux.pikafirstsetup"; pub const APP_ID: &str = "com.github.pikaos-linux.pikawelcome";
//pub const GETTEXT_PACKAGE: &str = env!("CARGO_PKG_NAME");
//pub const LOCALEDIR: &str = "/usr/share/locale";
//pub const PKGDATADIR: &str = " /usr/share";
//pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource");
//pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const DISTRO_ICON: &str = "pika-logo"; pub const DISTRO_ICON: &str = "pika-logo";

View File

@ -23,7 +23,7 @@ use std::io::BufReader;
const CODEC_INSTALL_PROG: &str = " const CODEC_INSTALL_PROG: &str = "
#! /bin/bash #! /bin/bash
set -e set -e
/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt install pika-codecs-meta -y /usr/lib/pika/pika-welcome/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-welcome/scripts/pika-sudo.sh apt install pika-codecs-meta -y
"; ";
fn codec_install( fn codec_install(

View File

@ -46,6 +46,6 @@ pub fn final_carousel(first_setup_carousel: &adw::Carousel) {
first_setup_carousel.append(&first_setup_final_box); first_setup_carousel.append(&first_setup_final_box);
first_setup_start_button.connect_clicked( move |_| { first_setup_start_button.connect_clicked( move |_| {
let _ = cmd!("/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh", "bash", "-c", REBOOT_PROG).read(); let _ = cmd!("/usr/lib/pika/pika-welcome/scripts/pika-sudo.sh", "bash", "-c", REBOOT_PROG).read();
}); });
} }

View File

@ -23,7 +23,7 @@ use std::io::BufReader;
const GAMEUTILS_INSTALL_PROG: &str = " const GAMEUTILS_INSTALL_PROG: &str = "
#! /bin/bash #! /bin/bash
set -e set -e
/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt install pika-gameutils-meta -y /usr/lib/pika/pika-welcome/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-welcome/scripts/pika-sudo.sh apt install pika-gameutils-meta -y
"; ";
fn gameutils_install( fn gameutils_install(

View File

@ -23,7 +23,7 @@ use std::io::BufReader;
const APT_UPDATE_PROG: &str = " const APT_UPDATE_PROG: &str = "
#! /bin/bash #! /bin/bash
set -e set -e
/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh apt full-upgrade -y /usr/lib/pika/pika-welcome/scripts/pika-sudo.sh apt update -y && /usr/lib/pika/pika-welcome/scripts/pika-sudo.sh apt full-upgrade -y
"; ";
fn apt_update( fn apt_update(

View File

@ -317,7 +317,7 @@ pub fn user_carousel(first_setup_carousel: &adw::Carousel) {
})); }));
user_next_button.connect_clicked(clone!(@weak first_setup_carousel, @weak user_info_username, @weak user_info_hostname, @weak user_info_password, @weak user_info_full_name, @weak user_info_hostname_valid => move |_| { user_next_button.connect_clicked(clone!(@weak first_setup_carousel, @weak user_info_username, @weak user_info_hostname, @weak user_info_password, @weak user_info_full_name, @weak user_info_hostname_valid => move |_| {
let result = cmd!("/usr/lib/pika/pika-first-setup-gtk4/scripts/pika-sudo.sh", "bash", "-c", USER_CREATE_PROG, &user_info_username.text(), &user_info_password.text(), &user_info_full_name.text(), &user_info_hostname.text()).read(); let result = cmd!("/usr/lib/pika/pika-welcome/scripts/pika-sudo.sh", "bash", "-c", USER_CREATE_PROG, &user_info_username.text(), &user_info_password.text(), &user_info_full_name.text(), &user_info_hostname.text()).read();
assert!(result.is_ok()); assert!(result.is_ok());
first_setup_carousel.scroll_to(&first_setup_carousel.nth_page(3), true); first_setup_carousel.scroll_to(&first_setup_carousel.nth_page(3), true);
})); }));