diff --git a/KIOSK setup/kiosk-session.sh b/KIOSK setup/kiosk-session.sh new file mode 100644 index 0000000..556fa48 --- /dev/null +++ b/KIOSK setup/kiosk-session.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Kiosk session. Exits when the app exits. + +APP_DIR="/home/ears/Desktop/Kazi/v3/linux/" +APP_CMD="mono program.exe" +DISPLAY_SETUP="/home/ears/rotate.sh" + +LOG_DIR="$HOME/kiosk/logs" +mkdir -p "$LOG_DIR" +SESSION_LOG="$LOG_DIR/session-$(date +%Y%m%d-%H%M%S).log" +ln -sfn "$SESSION_LOG" "$LOG_DIR/current.log" +ls -1t "$LOG_DIR"/session-*.log 2>/dev/null | tail -n +21 | xargs -r rm -f + +exec > >(tee -a "$SESSION_LOG") 2>&1 +echo "=== session start $(date -Is) ===" + +# no blanking, no screensaver, no pointer +cd "$APP_DIR" || { echo "FATAL: $APP_DIR not found"; sleep 20; exit 1; } + +# --- hardware setup, shared with the Xubuntu session --- +if [[ -x "$DISPLAY_SETUP" ]]; then + echo "--- running display-setup.sh ---" + "$DISPLAY_SETUP" +else + echo "WARNING: $DISPLAY_SETUP missing, using fallback" + xset s off; xset s noblank; xset -dpms +fi + +unclutter -idle 0 -root & +matchbox-window-manager -use_titlebar no -use_cursor no & + +cd "$APP_DIR" || { echo "FATAL: $APP_DIR not found"; sleep 20; exit 1; } + +recovery_console() { + echo "=== crash loop, opening recovery console ===" + xterm -fa Monospace -fs 14 -geometry 130x42 -T "kiosk recovery" -e bash -c " + echo 'The app failed to start 3 times in a row.' + echo 'Last 60 lines of $SESSION_LOG:' + echo '--------------------------------------------------' + tail -n 60 '$SESSION_LOG' + echo '--------------------------------------------------' + echo + echo 'Shell below. Type exit to retry the app.' + exec bash + " +} + +fails=0 +while true; do + started=$SECONDS + $APP_CMD + code=$? + ran=$(( SECONDS - started )) + echo "=== app exited $code after ${ran}s ===" + + # Clean exit (the Close button) ends the kiosk session. + if (( code == 0 )); then + echo "=== clean exit, leaving kiosk ===" + exit 0 + fi + + if (( ran < 20 )); then (( fails++ )); else fails=1; fi + if (( fails >= 3 )); then + fails=0 + recovery_console + fi + sleep 2 +done diff --git a/KIOSK setup/kiosk-start.sh b/KIOSK setup/kiosk-start.sh new file mode 100644 index 0000000..76628da --- /dev/null +++ b/KIOSK setup/kiosk-start.sh @@ -0,0 +1,16 @@ +#!/bin/bash +LOG_DIR="$HOME/kiosk/logs" +mkdir -p "$LOG_DIR" + +VT=$(fgconsole 2>/dev/null) || { + echo "Not on a text console. Press Ctrl+Alt+F3, log in there, and run this again." + exit 1 +} + +echo "Starting kiosk on VT $VT. Ctrl+Alt+F7 returns to the desktop." +sleep 1 + +startx "$HOME/kiosk/kiosk-session.sh" -- :1 "vt${VT}" -keeptty -nocursor \ + >> "$LOG_DIR/startx.log" 2>&1 + +echo "Kiosk session ended." diff --git a/KIOSK setup/rotate.sh b/KIOSK setup/rotate.sh new file mode 100644 index 0000000..670afc5 --- /dev/null +++ b/KIOSK setup/rotate.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +sleep 3 + +MATRIX="0 1 0 -1 0 1 0 0 1" +ROTATION="right" + +OUT=$(xrandr | awk '/ connected/{print $1; exit}') +TOUCH="SIS0457:00 0457:11ED" + +#DISPLAY +[ -n "$OUT" ] && xrandr --output "$OUT" --rotate "$ROTATION" + +#Touchscreen +xinput list --name-only | grep -qxF "$TOUCH" && xinput set-prop "$TOUCH" "Coordinate Transformation Matrix" $MATRIX + +# Disable Blanking and screensaver +xset s off +xset s noblank +xset -dpms diff --git a/Readme.md b/Readme.md index 402d96e..6981827 100644 --- a/Readme.md +++ b/Readme.md @@ -1,356 +1,274 @@ -# Mono + GTK# + Glade — WSL Setup Guide +# EARS Kiosk Mode -## Table of Contents -- [1. Prerequisites](#1-prerequisites) -- [2. Install Mono](#2-install-mono) -- [3. Install GTK# (GTK# 3.0, for Ubuntu 24.04)](#3-install-gtk-gtk-30-for-ubuntu-2404) -- [4. Install Glade (visual UI designer)](#4-install-glade-visual-ui-designer) -- [5. Optional: libgdiplus (only if using System.Drawing)](#5-optional-libgdiplus-only-if-using-systemdrawing) -- [6. Compiling & Running](#6-compiling--running) -- [7. Minimal Working Examples](#7-minimal-working-examples) -- [8. Custom Output Names, Targets & Exporting DLLs](#8-custom-output-names-targets--exporting-dlls) -- [9. Common Errors & Fixes](#9-common-errors--fixes) -- [10. Notes on Alternatives](#10-notes-on-alternatives) +Runs the EARS application fullscreen on tty3 at boot, with no desktop +environment around it. The normal Xubuntu desktop remains available on +tty7 for development and troubleshooting. + +**Status: semi-permanent.** Nothing here replaces the Xubuntu desktop. +lightdm still runs, the default systemd target is unchanged, and GRUB is +untouched. Removing two files returns the machine to stock. --- -## 1. Prerequisites -- Windows 11 (or updated Windows 10) with WSL2 and **WSLg** enabled for GUI support -- Ubuntu 24.04 (noble) or similar WSL distro +## Quick reference -Check WSLg is active: -```bash -echo $DISPLAY -``` -Should return something like `:0`. If empty, GUI apps won't display. +| Action | How | +|---|---| +| Switch to kiosk | `Ctrl+Alt+F3` | +| Switch to desktop | `Ctrl+Alt+F7` | +| Exit kiosk to a shell | Press **Close** in the app | +| Start kiosk manually | `~/kiosk/kiosk-start.sh` (from a text console) | +| Disable kiosk at next boot | `rm ~/kiosk/enabled` | +| Re-enable | `touch ~/kiosk/enabled` | +| Live log | `tail -f ~/kiosk/logs/current.log` | +| Kill the app | `pkill -f program.exe` (relaunches automatically) | --- -## 2. Install Mono +## Layout -```bash -sudo apt update -sudo apt install mono-complete +``` +~/kiosk/ +├── kiosk-start.sh launches the X server on the current VT +├── kiosk-session.sh the session: hardware setup, WM, app loop +├── display-setup.sh symlink to the rotation/touch script +├── enabled presence of this file enables boot autostart +├── README.md this file +└── logs/ + ├── current.log symlink to the newest session log + ├── session-*.log one per session, 20 kept + └── startx.log X server output (appended, never rotated) ``` -Verify: +Application: `/home/ears/Desktop/Kazi/v3/linux/program.exe` + +--- + +## How it boots + +``` +power on + → GRUB → systemd → graphical.target + ├── lightdm on vt7 (normal Xubuntu, untouched) + └── getty@tty3 autologin as `ears` + → ~/.bash_profile sees tty3 + ~/kiosk/enabled + → exec kiosk-start.sh + → startx on vt3 + → kiosk-session.sh + → display-setup.sh, matchbox, unclutter + → loop: mono program.exe +``` + +`kiosk-start.sh` calls `fgconsole` to find the VT it was launched from, +so it works whether started at boot on tty3 or by hand from any console. + +### Exit codes + +| Code | Meaning | +|---|---| +| 0 | Clean exit (Close button) — session ends, shell on tty3 | +| other | Crash — relaunched after 2s | +| 3 crashes in <20s each | Recovery console (xterm) opens with the log | + +--- + +## Dependencies + ```bash -mono --version -mcs --version +sudo apt install --no-install-recommends \ + xinit matchbox-window-manager unclutter xterm x11-xserver-utils +``` + +Plus `mono-complete` for the application itself. + +--- + +## Installation from scratch + +### 1. Scripts + +Place `kiosk-start.sh` and `kiosk-session.sh` in `~/kiosk/`, then: + +```bash +chmod +x ~/kiosk/kiosk-start.sh ~/kiosk/kiosk-session.sh +mkdir -p ~/kiosk/logs +``` + +Confirm the app path at the top of `kiosk-session.sh`: + +```bash +APP_DIR="/home/ears/Desktop/Kazi/v3/linux" +APP_CMD="mono program.exe" +``` + +No `$` before the path, no trailing slash. + +### 2. Display and touch + +The rotation script is shared with the Xubuntu session +(`~/.config/autostart/Rotate Display.desktop`). Symlink it: + +```bash +ln -s /path/to/rotate-display.sh ~/kiosk/display-setup.sh +``` + +It handles: 90° right rotation, the matching touch coordinate matrix +for `SIS0457:00 0457:11ED`, and disabling blanking/DPMS. + +### 3. Autologin on tty3 + +```bash +sudo systemctl edit getty@tty3 +``` + +```ini +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin ears --noclear %I $TERM +``` + +```bash +sudo systemctl enable getty@tty3.service +``` + +### 4. Boot hook + +Append to `~/.bash_profile` (or `~/.profile` if that's the one bash reads): + +```bash +# --- kiosk autostart on tty3 only --- +if [[ -z $DISPLAY && $(tty) == /dev/tty3 && -f $HOME/kiosk/enabled ]]; then + sleep 3 # let lightdm claim vt7 first + exec "$HOME/kiosk/kiosk-start.sh" +fi +``` + +### 5. Enable and reboot + +```bash +touch ~/kiosk/enabled +sudo reboot ``` --- -## 3. Install GTK# (GTK# 3.0, for Ubuntu 24.04) +## Troubleshooting -> Note: `gtk-sharp2` is **not available** on Ubuntu 24.04 (noble). Use `gtk-sharp3` instead. +Always start here: ```bash -sudo add-apt-repository universe -sudo apt update -sudo apt install gtk-sharp3 +tail -60 ~/kiosk/logs/current.log # app + session errors +tail -40 ~/kiosk/logs/startx.log # X server failed to start +grep -E '\(EE\)' ~/.local/share/xorg/Xorg.1.log ``` -Verify the package is registered: -```bash -pkg-config --list-all | grep gtk-sharp -``` -Expected output: -gtk-sharp-3.0 Gtk - Gtk ---- +| Symptom | Cause / fix | +|---|---| +| `Only console users are allowed to run the X server` | Launched from a terminal inside Xfce. Use `Ctrl+Alt+F3` and run from the text console. | +| `Cannot open virtual console N (Permission denied)` | Asking for a VT you don't own. `kiosk-start.sh` uses `fgconsole` to avoid this — check it wasn't edited to a hardcoded `vt8`. | +| `Server is already active for display 1` | Stale lock: `sudo rm -f /tmp/.X1-lock /tmp/.X11-unix/X1` | +| `cd: $/home/... No such file` | Stray `$` in `APP_DIR`. Path must be literal. | +| Black screen, then "session ended" | X started, session script exited. Read `current.log`. | +| App runs but not fullscreen | `matchbox-window-manager` missing. | +| Rotation right, touch wrong | `display-setup.sh` not executable, or `xinput` device name changed. Check with `xinput list --name-only`. | +| Boot lands on vt7 not vt3 | lightdm won the race. Increase `sleep 3` to `sleep 6`. | +| No sound | See below. | -## 4. Install Glade (visual UI designer) +`xf86EnableIO: failed to enable I/O ports` in the Xorg log is normal and +can be ignored — rootless X doesn't need legacy port access. + +### Getting a shell inside the kiosk + +Add temporarily to `kiosk-session.sh`, before the `while true` loop: ```bash -sudo apt install glade +xterm -fa Monospace -fs 14 -geometry 100x30 & ``` -Launch it: +### Audio + +The kiosk session does not start an audio server; on the desktop that's +done by Xfce's autostart. Check from inside the kiosk: + ```bash -glade +pactl info # "Connection refused" = no server +aplay /usr/share/sounds/alsa/Front_Center.wav ``` -Design your UI visually, then save as `yourfile.glade` (XML format). + +If a server is needed, add to `kiosk-session.sh` before `matchbox`: + +```bash +if command -v pipewire >/dev/null && ! pactl info &>/dev/null; then + pipewire & pipewire-pulse & wireplumber & + sleep 2 +elif command -v pulseaudio >/dev/null && ! pactl info &>/dev/null; then + pulseaudio --start + sleep 2 +fi +``` + +**Test with the Xfce session logged out**, not merely switched away. +Both sessions run as `ears`, so an audio server started by the desktop +will serve the kiosk too — giving a false pass that breaks later when +lightdm is removed. --- -## 5. Optional: libgdiplus (only if using System.Drawing) +## Updating the application -Only needed if your code uses `System.Drawing.Bitmap`, `Graphics`, etc. (not required for plain GTK#/Glade apps): +Replace files in `/home/ears/Desktop/Kazi/v3/linux/`, then from a shell: ```bash -sudo apt install libgdiplus +pkill -f program.exe ``` +The session loop treats this as a crash and relaunches within 2 seconds +with the new build. No reboot needed. + --- -## 6. Compiling & Running +## Removal -### Plain console C# program +Temporary (next boot only): + ```bash -mcs myprogram.cs -mono myprogram.exe +rm ~/kiosk/enabled ``` -### GTK# 3.0 program (no Glade) +Complete: + ```bash -mcs -pkg:gtk-sharp-3.0 myapp.cs -mono myapp.exe +sudo systemctl disable getty@tty3.service +sudo rm -rf /etc/systemd/system/getty@tty3.service.d/ +# remove the kiosk block from ~/.bash_profile +rm -rf ~/kiosk ``` -### GTK# 3.0 program using a Glade file -```bash -mcs -pkg:gtk-sharp-3.0 -pkg:glade-sharp-3.0 myapp.cs -mono myapp.exe -``` -Make sure the `.glade` file referenced in code sits in the same folder (or update the path in `new Builder("...")`). +Nothing else was modified. lightdm, the default target, GRUB, and +`~/.config/xfce4/` are all untouched. --- -## 7. Minimal Working Examples +## Known limitations -### Hello World (console) -```csharp -using System; - -class Hello { - static void Main() { - Console.WriteLine("Hello from Mono in WSL!"); - } -} -``` -```bash -mcs hello.cs -mono hello.exe -``` - -### Hello World (GTK# window, no Glade) -```csharp -using System; -using Gtk; - -class GtkCheck { - static void Main() { - Application.Init(); - var win = new Window("Hello GTK#3"); - win.SetDefaultSize(300, 200); - win.DeleteEvent += (o, args) => Application.Quit(); - - var button = new Button("Click me"); - button.Clicked += (o, args) => Console.WriteLine("Clicked!"); - win.Add(button); - - win.ShowAll(); - Application.Run(); - } -} -``` -```bash -mcs -pkg:gtk-sharp-3.0 gtkcheck.cs -mono gtkcheck.exe -``` - -### Loading a UI built in Glade -```csharp -using System; -using Gtk; - -class Program { - static void Main() { - Application.Init(); - var builder = new Builder("myui.glade"); - builder.Autoconnect(new Program()); - - var win = (Window)builder.GetObject("window1"); - win.DeleteEvent += (o, args) => Application.Quit(); - win.ShowAll(); - - Application.Run(); - } -} -``` -```bash -mcs -pkg:gtk-sharp-3.0 -pkg:glade-sharp-3.0 program.cs -mono program.exe -``` +- Both lightdm and the kiosk X server run simultaneously — roughly 200MB + of RAM that will be freed when lightdm is eventually dropped. +- No lockdown yet: VT switching, GRUB editing, and USB boot are all open. +- No in-app power control; shutdown is done from the desktop or a shell. +- `startx.log` grows without bound; truncate occasionally. --- -## 8. Custom Output Names, Targets & Exporting DLLs +## Next steps toward a permanent kiosk -By default, `mcs file.cs` names the output after the source file (`file.exe`). You can control this with `-out:` and change what kind of binary is produced with `-target:`. +In this order, testing each before moving on: -### 8.1 Custom output name -```bash -mcs -pkg:gtk-sharp-3.0 Program.cs -out:MyCustomApp.exe -``` -Run it the same way: -```bash -mono MyCustomApp.exe -``` +1. `systemctl set-default multi-user.target`, disable lightdm +2. Move autologin from tty3 to tty1 +3. In-app power menu (sleep/shutdown/restart) with a polkit rule +4. Developer unlock: PIN pad, `exit 42` → Xfce session +5. Lockdown: GRUB password, `DontVTSwitch`, mask tty4–6, BIOS password +6. Move the app out of `Desktop/` to `/opt/ears/` -### 8.2 `-target` options -| Target | Produces | Notes | -|---|---|---| -| `exe` (default) | Console executable | Shows a console window when run on Windows | -| `winexe` | Windows GUI executable | No console window — correct choice for GTK#/Glade GUI apps distributed on Windows | -| `library` | `.dll` class library | No `Main` entry point required to run directly; used by other programs | -| `module` | `.netmodule` | Rarely used; for combining into a single assembly later | - -Your example, building a windowed GUI executable with a custom name: -```bash -mcs -target:winexe -pkg:gtk-sharp-3.0 Program.cs -out:programwin.exe -``` -This produces `programwin.exe`, which on Windows will run without popping up a console window alongside your GTK window. - -### 8.3 Exporting a DLL - -If you want to package reusable code (helper classes, business logic, etc.) as a library instead of a standalone app: - -```bash -mcs -target:library Program.cs -out:MyLibrary.dll -``` - -- No `Main()` method is required in a `library` target (though it's fine if one class in your project has one — it just won't be used as an entry point for the DLL itself). -- This creates `MyLibrary.dll`, a Mono/.NET assembly that other C# programs can reference. - -### 8.4 Using a DLL in another program - -Suppose `MyLibrary.dll` contains: -```csharp -// MyLibrary.cs -namespace MyLib { - public class Greeter { - public string Greet(string name) => $"Hello, {name}!"; - } -} -``` -Compiled with: -```bash -mcs -target:library MyLibrary.cs -out:MyLibrary.dll -``` - -Then in a separate consumer program: -```csharp -// ConsumerApp.cs -using System; -using MyLib; - -class ConsumerApp { - static void Main() { - var greeter = new Greeter(); - Console.WriteLine(greeter.Greet("World")); - } -} -``` - -Compile it while referencing the DLL with `-r:`: -```bash -mcs ConsumerApp.cs -r:MyLibrary.dll -out:ConsumerApp.exe -``` - -Run it (make sure `MyLibrary.dll` is in the same folder as `ConsumerApp.exe`, or on Mono's library search path): -```bash -mono ConsumerApp.exe -``` - -### 8.5 Combining `-target:library` with GTK# packages -If your DLL itself uses GTK# types (e.g., a shared custom widget), include the package flag when building the library too: -```bash -mcs -target:library -pkg:gtk-sharp-3.0 MyGtkWidgets.cs -out:MyGtkWidgets.dll -``` -And reference both the package and the DLL when compiling the consumer: -```bash -mcs -pkg:gtk-sharp-3.0 ConsumerApp.cs -r:MyGtkWidgets.dll -out:ConsumerApp.exe -``` - -### 8.6 Quick reference -```bash -# Console exe, custom name -mcs Program.cs -out:myapp.exe - -# Windowed (no console) exe, custom name -mcs -target:winexe -pkg:gtk-sharp-3.0 Program.cs -out:programwin.exe - -# Class library (DLL) -mcs -target:library Library.cs -out:MyLibrary.dll - -# Program referencing that DLL -mcs Consumer.cs -r:MyLibrary.dll -out:Consumer.exe -``` - -### 8.7 Running the compiled .exe on Windows (outside WSL) - -Compiling in WSL produces a `.exe` that targets the .NET/Mono runtime — it is **not** a native Windows binary, and it will not run on Windows by itself. Two things are needed: - -**1. Install a runtime on the Windows machine** - -Pick one: -- **Mono runtime for Windows** — install the [Mono for Windows](https://www.mono-project.com/download/stable/) package so `.exe` files built with `mcs` can run via the Mono runtime. After install, you can either double-click the `.exe` (Mono associates itself with `.exe` files) or run it explicitly: -```powershell - mono programwin.exe -``` -- **.NET Framework / .NET runtime** — for simple GTK#-free console apps, the .exe may also run under an installed .NET runtime, but GTK# apps specifically require Mono's GTK# libraries, so the Mono for Windows install is the reliable option. - -**2. Copy the required DLLs alongside the .exe** - -Your compiled `.exe` references managed DLLs at runtime (not just at compile time). Anything you referenced with `-r:` or `-pkg:` must physically travel with the `.exe`: - -- Any custom library you built, e.g. `MyLibrary.dll` or `MyGtkWidgets.dll` -- GTK# binding assemblies your app depends on (typically already provided by installing Mono for Windows, since it bundles the GTK# runtime — but if you used a nonstandard package, copy its DLL too) -- Your `.glade` file, if the app loads one via `Builder("myui.glade")` — this isn't a DLL but is just as required; it must sit next to the `.exe` at the same relative path your code expects - -Minimum folder layout to copy over to Windows: -programwin.exe -MyLibrary.dll (any custom DLLs you referenced with -r:) -myui.glade (if using Glade) - -**Common pitfall:** a program that runs fine in WSL but fails on Windows with `FileNotFoundException` or `Could not load file or assembly` almost always means a referenced DLL (or the `.glade` file) wasn't copied over, or Mono for Windows isn't installed. - ---- - -## 9. Common Errors & Fixes - -| Error | Cause | Fix | -|---|---|---| -| `File does not contain a valid CIL image` | Ran `mono` on `.cs` source instead of compiled `.exe` | Compile first: `mcs file.cs`, then `mono file.exe` | -| `CS0246: type or namespace 'Gtk' could not be found` | Missing package reference during compile | Add `-pkg:gtk-sharp-3.0` to `mcs` command | -| `CS0103: name 'Console' does not exist` | Missing `using System;` | Add `using System;` at top of file | -| `Unable to locate package gtk-sharp2` | Package dropped in Ubuntu 24.04 | Use `gtk-sharp3` instead | -| `DllNotFoundException: libgdiplus` | Code uses `System.Drawing` without the lib installed | `sudo apt install libgdiplus` | -| `Could not load file or assembly 'MyLibrary.dll'` | DLL not in same folder / not found | Place DLL next to the `.exe`, or set `MONO_PATH` | -| `FileNotFoundException` / `Could not load file or assembly` (on Windows) | Runtime not installed, or referenced DLL/.glade not copied alongside the .exe | Install Mono for Windows; copy all `-r:` DLLs and `.glade` files into the same folder as the `.exe` | - ---- - -## 10. Notes on Alternatives - -GTK# is a legacy, lightly-maintained binding. For new projects, consider: -- **Avalonia UI** — modern, XAML-based, cross-platform, actively maintained -```bash - sudo apt install dotnet-sdk-8.0 - dotnet new install Avalonia.Templates - dotnet new avalonia.app -o MyApp -``` - -Use GTK#/Mono/Glade for legacy projects or learning; use Avalonia + `dotnet` for anything new and long-term. - - -Personal note: - -Compile note: - to compile the cs file - mcs NAME_OF_THE_FILE.cs - for GTK appilcation - mcs -pkg:gtk-sharp-3.0 NAME_OF_THE_FILE.cs - custom output name / windowed exe - mcs -target:winexe -pkg:gtk-sharp-3.0 NAME_OF_THE_FILE.cs -out:CUSTOM_NAME.exe - export as DLL - mcs -target:library NAME_OF_THE_FILE.cs -out:CUSTOM_NAME.dll - use a DLL in another program - mcs Consumer.cs -r:CUSTOM_NAME.dll -out:Consumer.exe - - - -to run note: - same for all cases - mono NAME_OF_THE_FILE.exe \ No newline at end of file +Keep a transcript (`script -a ~/kiosk/setup-transcript.txt`) through each +stage — it becomes the provisioning script for the remaining tablets. \ No newline at end of file diff --git a/ReadmeQuick.md b/ReadmeQuick.md deleted file mode 100644 index f227bb0..0000000 --- a/ReadmeQuick.md +++ /dev/null @@ -1,17 +0,0 @@ -### 8.6 Quick reference -```bash -# Console exe, custom name -mcs Program.cs -out:myapp.exe - -# Console exe, custom name -mcs -pkg:gtk-sharp-3.0 Program.cs -out:programwin.exe - -# Windowed (no console) exe, custom name -mcs -target:winexe -pkg:gtk-sharp-3.0 Program.cs -out:programwin.exe - -# Class library (DLL) -mcs -target:library Library.cs -out:MyLibrary.dll - -# Program referencing that DLL -mcs Consumer.cs -r:MyLibrary.dll -out:Consumer.exe -``` diff --git a/boot/earsSplash.plymouth b/boot/earsSplash.plymouth new file mode 100644 index 0000000..6085f4e --- /dev/null +++ b/boot/earsSplash.plymouth @@ -0,0 +1,8 @@ +[Plymouth Theme] +Name=Ears Splash +Description=EARS boot/shutdown splash with stethoscope logo and spinner +ModuleName=script + +[script] +ImageDir=/usr/share/plymouth/themes/earsSplash +ScriptFile=/usr/share/plymouth/themes/earsSplash/earsSplash.script \ No newline at end of file diff --git a/boot/earsSplash.script b/boot/earsSplash.script new file mode 100644 index 0000000..bfc7f76 --- /dev/null +++ b/boot/earsSplash.script @@ -0,0 +1,72 @@ +Window.SetBackgroundTopColor(0, 0, 0); +Window.SetBackgroundBottomColor(0, 0, 0); + +mode = Plymouth.GetMode(); + +if (mode == "shutdown" || mode == "reboot") { + bg.image = Image("splashEndSet.png"); + spinner.box_x = 440; + spinner.box_y = 458.1; + spinner.scale = 400; +} else { + bg.image = Image("splashBoot.png"); + spinner.box_x = 449; + spinner.box_y = 464.3; + spinner.scale = 400; + /* + bg.image = Image("splashEndSet.png"); + spinner.box_x = 440; + spinner.box_y = 458.1; + spinner.scale = 400; + */ + +} + +bg.sprite = Sprite(bg.image); +bg.sprite.SetX(0); +bg.sprite.SetY(0); +bg.sprite.SetZ(-100); + +spinner.sprite = Sprite(); +spinner.sprite.SetZ(2); + + +spinner.frame_count = 60; +spinner.frames = []; +for (i = 0; i < spinner.frame_count; i++) { + spinner.frames[i] = Image("spinner/frame_" + i + ".png").Scale(spinner.scale,spinner.scale); +} + +spinner.current_frame = 0; +spinner.frame_delay = 1; +spinner.tick = 0; + +fun spinner_refresh_callback() { + spinner.tick++; + if (spinner.tick >= spinner.frame_delay) { + spinner.tick = 0; + spinner.current_frame++; + if (spinner.current_frame >= spinner.frame_count) spinner.current_frame = 0; + + img = spinner.frames[spinner.current_frame]; + spinner.sprite.SetImage(img); + spinner.sprite.SetX(spinner.box_x); + spinner.sprite.SetY(spinner.box_y); + } +} +Plymouth.SetRefreshFunction(spinner_refresh_callback); + +fun display_normal_callback() {} + +fun display_password_callback(prompt, bullets) { + prompt_image = Image.Text(prompt, 1, 1, 1, 1, "Sans 14"); + prompt_sprite = Sprite(prompt_image); + prompt_sprite.SetZ(2); + prompt_sprite.SetX(spinner.center_x - prompt_image.GetWidth() / 2); + prompt_sprite.SetY(spinner.center_y + 60); +} +Plymouth.SetDisplayPasswordFunction(display_password_callback); +Plymouth.SetDisplayNormalFunction(display_normal_callback); + +fun quit_callback() {} +Plymouth.SetQuitFunction(quit_callback); \ No newline at end of file diff --git a/boot/instruction.md b/boot/instruction.md new file mode 100644 index 0000000..36ad4aa --- /dev/null +++ b/boot/instruction.md @@ -0,0 +1,9 @@ +sudo mkdir -p /usr/share/plymouth/themes/earsSplash +sudo cp -r earsSplash/* /usr/share/plymouth/themes/earsSplash/ + +sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth \ + default.plymouth /usr/share/plymouth/themes/earsSplash/earsSplash.plymouth 100 +sudo update-alternatives --config default.plymouth + +sudo update-initramfs -u # Debian/Ubuntu +# or: sudo dracut -f # Fedora/RHEL \ No newline at end of file diff --git a/boot/spinner/frame_0.png b/boot/spinner/frame_0.png new file mode 100644 index 0000000..140b06f --- /dev/null +++ b/boot/spinner/frame_0.png Binary files differ diff --git a/boot/spinner/frame_1.png b/boot/spinner/frame_1.png new file mode 100644 index 0000000..26a09ca --- /dev/null +++ b/boot/spinner/frame_1.png Binary files differ diff --git a/boot/spinner/frame_10.png b/boot/spinner/frame_10.png new file mode 100644 index 0000000..97e182b --- /dev/null +++ b/boot/spinner/frame_10.png Binary files differ diff --git a/boot/spinner/frame_11.png b/boot/spinner/frame_11.png new file mode 100644 index 0000000..1acfb25 --- /dev/null +++ b/boot/spinner/frame_11.png Binary files differ diff --git a/boot/spinner/frame_12.png b/boot/spinner/frame_12.png new file mode 100644 index 0000000..c4962b8 --- /dev/null +++ b/boot/spinner/frame_12.png Binary files differ diff --git a/boot/spinner/frame_13.png b/boot/spinner/frame_13.png new file mode 100644 index 0000000..0200b33 --- /dev/null +++ b/boot/spinner/frame_13.png Binary files differ diff --git a/boot/spinner/frame_14.png b/boot/spinner/frame_14.png new file mode 100644 index 0000000..eeb00a1 --- /dev/null +++ b/boot/spinner/frame_14.png Binary files differ diff --git a/boot/spinner/frame_15.png b/boot/spinner/frame_15.png new file mode 100644 index 0000000..a51cf96 --- /dev/null +++ b/boot/spinner/frame_15.png Binary files differ diff --git a/boot/spinner/frame_16.png b/boot/spinner/frame_16.png new file mode 100644 index 0000000..626a07e --- /dev/null +++ b/boot/spinner/frame_16.png Binary files differ diff --git a/boot/spinner/frame_17.png b/boot/spinner/frame_17.png new file mode 100644 index 0000000..18f38a7 --- /dev/null +++ b/boot/spinner/frame_17.png Binary files differ diff --git a/boot/spinner/frame_18.png b/boot/spinner/frame_18.png new file mode 100644 index 0000000..a450ff7 --- /dev/null +++ b/boot/spinner/frame_18.png Binary files differ diff --git a/boot/spinner/frame_19.png b/boot/spinner/frame_19.png new file mode 100644 index 0000000..a9cc8ef --- /dev/null +++ b/boot/spinner/frame_19.png Binary files differ diff --git a/boot/spinner/frame_2.png b/boot/spinner/frame_2.png new file mode 100644 index 0000000..2c9c9d6 --- /dev/null +++ b/boot/spinner/frame_2.png Binary files differ diff --git a/boot/spinner/frame_20.png b/boot/spinner/frame_20.png new file mode 100644 index 0000000..a1bf6c6 --- /dev/null +++ b/boot/spinner/frame_20.png Binary files differ diff --git a/boot/spinner/frame_21.png b/boot/spinner/frame_21.png new file mode 100644 index 0000000..d296fd9 --- /dev/null +++ b/boot/spinner/frame_21.png Binary files differ diff --git a/boot/spinner/frame_22.png b/boot/spinner/frame_22.png new file mode 100644 index 0000000..a4cfe16 --- /dev/null +++ b/boot/spinner/frame_22.png Binary files differ diff --git a/boot/spinner/frame_23.png b/boot/spinner/frame_23.png new file mode 100644 index 0000000..4872ac4 --- /dev/null +++ b/boot/spinner/frame_23.png Binary files differ diff --git a/boot/spinner/frame_24.png b/boot/spinner/frame_24.png new file mode 100644 index 0000000..7e58103 --- /dev/null +++ b/boot/spinner/frame_24.png Binary files differ diff --git a/boot/spinner/frame_25.png b/boot/spinner/frame_25.png new file mode 100644 index 0000000..c0a69f8 --- /dev/null +++ b/boot/spinner/frame_25.png Binary files differ diff --git a/boot/spinner/frame_26.png b/boot/spinner/frame_26.png new file mode 100644 index 0000000..0c2e3ed --- /dev/null +++ b/boot/spinner/frame_26.png Binary files differ diff --git a/boot/spinner/frame_27.png b/boot/spinner/frame_27.png new file mode 100644 index 0000000..ab7554f --- /dev/null +++ b/boot/spinner/frame_27.png Binary files differ diff --git a/boot/spinner/frame_28.png b/boot/spinner/frame_28.png new file mode 100644 index 0000000..4df8c91 --- /dev/null +++ b/boot/spinner/frame_28.png Binary files differ diff --git a/boot/spinner/frame_29.png b/boot/spinner/frame_29.png new file mode 100644 index 0000000..6c0818a --- /dev/null +++ b/boot/spinner/frame_29.png Binary files differ diff --git a/boot/spinner/frame_3.png b/boot/spinner/frame_3.png new file mode 100644 index 0000000..d0eb7c8 --- /dev/null +++ b/boot/spinner/frame_3.png Binary files differ diff --git a/boot/spinner/frame_30.png b/boot/spinner/frame_30.png new file mode 100644 index 0000000..ba478bc --- /dev/null +++ b/boot/spinner/frame_30.png Binary files differ diff --git a/boot/spinner/frame_31.png b/boot/spinner/frame_31.png new file mode 100644 index 0000000..651bebb --- /dev/null +++ b/boot/spinner/frame_31.png Binary files differ diff --git a/boot/spinner/frame_32.png b/boot/spinner/frame_32.png new file mode 100644 index 0000000..e8f751b --- /dev/null +++ b/boot/spinner/frame_32.png Binary files differ diff --git a/boot/spinner/frame_33.png b/boot/spinner/frame_33.png new file mode 100644 index 0000000..1e5cea8 --- /dev/null +++ b/boot/spinner/frame_33.png Binary files differ diff --git a/boot/spinner/frame_34.png b/boot/spinner/frame_34.png new file mode 100644 index 0000000..fdeb94e --- /dev/null +++ b/boot/spinner/frame_34.png Binary files differ diff --git a/boot/spinner/frame_35.png b/boot/spinner/frame_35.png new file mode 100644 index 0000000..86b1d1b --- /dev/null +++ b/boot/spinner/frame_35.png Binary files differ diff --git a/boot/spinner/frame_36.png b/boot/spinner/frame_36.png new file mode 100644 index 0000000..8f91b3a --- /dev/null +++ b/boot/spinner/frame_36.png Binary files differ diff --git a/boot/spinner/frame_37.png b/boot/spinner/frame_37.png new file mode 100644 index 0000000..e511dcd --- /dev/null +++ b/boot/spinner/frame_37.png Binary files differ diff --git a/boot/spinner/frame_38.png b/boot/spinner/frame_38.png new file mode 100644 index 0000000..677613e --- /dev/null +++ b/boot/spinner/frame_38.png Binary files differ diff --git a/boot/spinner/frame_39.png b/boot/spinner/frame_39.png new file mode 100644 index 0000000..0189b96 --- /dev/null +++ b/boot/spinner/frame_39.png Binary files differ diff --git a/boot/spinner/frame_4.png b/boot/spinner/frame_4.png new file mode 100644 index 0000000..7432d01 --- /dev/null +++ b/boot/spinner/frame_4.png Binary files differ diff --git a/boot/spinner/frame_40.png b/boot/spinner/frame_40.png new file mode 100644 index 0000000..e591f12 --- /dev/null +++ b/boot/spinner/frame_40.png Binary files differ diff --git a/boot/spinner/frame_41.png b/boot/spinner/frame_41.png new file mode 100644 index 0000000..51f6f40 --- /dev/null +++ b/boot/spinner/frame_41.png Binary files differ diff --git a/boot/spinner/frame_42.png b/boot/spinner/frame_42.png new file mode 100644 index 0000000..c4250c1 --- /dev/null +++ b/boot/spinner/frame_42.png Binary files differ diff --git a/boot/spinner/frame_43.png b/boot/spinner/frame_43.png new file mode 100644 index 0000000..6da9947 --- /dev/null +++ b/boot/spinner/frame_43.png Binary files differ diff --git a/boot/spinner/frame_44.png b/boot/spinner/frame_44.png new file mode 100644 index 0000000..8b6aced --- /dev/null +++ b/boot/spinner/frame_44.png Binary files differ diff --git a/boot/spinner/frame_45.png b/boot/spinner/frame_45.png new file mode 100644 index 0000000..c233a80 --- /dev/null +++ b/boot/spinner/frame_45.png Binary files differ diff --git a/boot/spinner/frame_46.png b/boot/spinner/frame_46.png new file mode 100644 index 0000000..4ce8963 --- /dev/null +++ b/boot/spinner/frame_46.png Binary files differ diff --git a/boot/spinner/frame_47.png b/boot/spinner/frame_47.png new file mode 100644 index 0000000..877a5af --- /dev/null +++ b/boot/spinner/frame_47.png Binary files differ diff --git a/boot/spinner/frame_48.png b/boot/spinner/frame_48.png new file mode 100644 index 0000000..7f6cf4a --- /dev/null +++ b/boot/spinner/frame_48.png Binary files differ diff --git a/boot/spinner/frame_49.png b/boot/spinner/frame_49.png new file mode 100644 index 0000000..40bf002 --- /dev/null +++ b/boot/spinner/frame_49.png Binary files differ diff --git a/boot/spinner/frame_5.png b/boot/spinner/frame_5.png new file mode 100644 index 0000000..0f19f7e --- /dev/null +++ b/boot/spinner/frame_5.png Binary files differ diff --git a/boot/spinner/frame_50.png b/boot/spinner/frame_50.png new file mode 100644 index 0000000..9fd2f90 --- /dev/null +++ b/boot/spinner/frame_50.png Binary files differ diff --git a/boot/spinner/frame_51.png b/boot/spinner/frame_51.png new file mode 100644 index 0000000..63fc0c2 --- /dev/null +++ b/boot/spinner/frame_51.png Binary files differ diff --git a/boot/spinner/frame_52.png b/boot/spinner/frame_52.png new file mode 100644 index 0000000..6406732 --- /dev/null +++ b/boot/spinner/frame_52.png Binary files differ diff --git a/boot/spinner/frame_53.png b/boot/spinner/frame_53.png new file mode 100644 index 0000000..e2da60f --- /dev/null +++ b/boot/spinner/frame_53.png Binary files differ diff --git a/boot/spinner/frame_54.png b/boot/spinner/frame_54.png new file mode 100644 index 0000000..2bd3b37 --- /dev/null +++ b/boot/spinner/frame_54.png Binary files differ diff --git a/boot/spinner/frame_55.png b/boot/spinner/frame_55.png new file mode 100644 index 0000000..75d0aaf --- /dev/null +++ b/boot/spinner/frame_55.png Binary files differ diff --git a/boot/spinner/frame_56.png b/boot/spinner/frame_56.png new file mode 100644 index 0000000..481e295 --- /dev/null +++ b/boot/spinner/frame_56.png Binary files differ diff --git a/boot/spinner/frame_57.png b/boot/spinner/frame_57.png new file mode 100644 index 0000000..abc43f0 --- /dev/null +++ b/boot/spinner/frame_57.png Binary files differ diff --git a/boot/spinner/frame_58.png b/boot/spinner/frame_58.png new file mode 100644 index 0000000..fdbf93f --- /dev/null +++ b/boot/spinner/frame_58.png Binary files differ diff --git a/boot/spinner/frame_59.png b/boot/spinner/frame_59.png new file mode 100644 index 0000000..98898d2 --- /dev/null +++ b/boot/spinner/frame_59.png Binary files differ diff --git a/boot/spinner/frame_6.png b/boot/spinner/frame_6.png new file mode 100644 index 0000000..9f7a4d0 --- /dev/null +++ b/boot/spinner/frame_6.png Binary files differ diff --git a/boot/spinner/frame_7.png b/boot/spinner/frame_7.png new file mode 100644 index 0000000..97a2bc2 --- /dev/null +++ b/boot/spinner/frame_7.png Binary files differ diff --git a/boot/spinner/frame_8.png b/boot/spinner/frame_8.png new file mode 100644 index 0000000..1f6b01b --- /dev/null +++ b/boot/spinner/frame_8.png Binary files differ diff --git a/boot/spinner/frame_9.png b/boot/spinner/frame_9.png new file mode 100644 index 0000000..2ff8033 --- /dev/null +++ b/boot/spinner/frame_9.png Binary files differ diff --git a/boot/splashBoot.png b/boot/splashBoot.png new file mode 100644 index 0000000..2e276b3 --- /dev/null +++ b/boot/splashBoot.png Binary files differ diff --git a/boot/splashBootSet.png b/boot/splashBootSet.png new file mode 100644 index 0000000..1239b0c --- /dev/null +++ b/boot/splashBootSet.png Binary files differ diff --git a/boot/splashEnd.png b/boot/splashEnd.png new file mode 100644 index 0000000..dd67141 --- /dev/null +++ b/boot/splashEnd.png Binary files differ diff --git a/boot/splashEndSet.png b/boot/splashEndSet.png new file mode 100644 index 0000000..12b4bef --- /dev/null +++ b/boot/splashEndSet.png Binary files differ diff --git a/dll/atk-sharp.dll b/dll/atk-sharp.dll deleted file mode 100644 index cb11a7b..0000000 --- a/dll/atk-sharp.dll +++ /dev/null Binary files differ diff --git a/dll/cairo-sharp.dll b/dll/cairo-sharp.dll deleted file mode 100644 index ae71a7a..0000000 --- a/dll/cairo-sharp.dll +++ /dev/null Binary files differ diff --git a/dll/gdk-sharp.dll b/dll/gdk-sharp.dll deleted file mode 100644 index 08f0654..0000000 --- a/dll/gdk-sharp.dll +++ /dev/null Binary files differ diff --git a/dll/gio-sharp.dll b/dll/gio-sharp.dll deleted file mode 100644 index 818134d..0000000 --- a/dll/gio-sharp.dll +++ /dev/null Binary files differ diff --git a/dll/glib-sharp.dll b/dll/glib-sharp.dll deleted file mode 100644 index f480530..0000000 --- a/dll/glib-sharp.dll +++ /dev/null Binary files differ diff --git a/dll/gtk-sharp.dll b/dll/gtk-sharp.dll deleted file mode 100644 index ece3ff2..0000000 --- a/dll/gtk-sharp.dll +++ /dev/null Binary files differ diff --git a/dll/pango-sharp.dll b/dll/pango-sharp.dll deleted file mode 100644 index 07fc422..0000000 --- a/dll/pango-sharp.dll +++ /dev/null Binary files differ