diff --git a/program/MainWindow.cs b/program/MainWindow.cs index e1f6e50..51bd443 100644 --- a/program/MainWindow.cs +++ b/program/MainWindow.cs @@ -653,10 +653,19 @@ { get { - string home = System.Environment.GetEnvironmentVariable("HOME"); - if (string.IsNullOrEmpty(home)) return false; - return System.IO.File.Exists( - System.IO.Path.Combine(home, "kiosk/enabled")); + // string home = System.Environment.GetEnvironmentVariable("HOME"); + // if (string.IsNullOrEmpty(home)) return false; + // return System.IO.File.Exists( + // System.IO.Path.Combine(home, "kiosk/enabled")); + try + { + string cmdline = System.IO.File.ReadAllText("/proc/cmdline"); + foreach (string arg in cmdline.Split(new[] { ' ', '\n' }, + StringSplitOptions.RemoveEmptyEntries)) + if (arg == "kiosk") return true; + } + catch { } + return false; } } diff --git a/program/program.cs b/program/program.cs index f9db539..58b3683 100644 --- a/program/program.cs +++ b/program/program.cs @@ -11,6 +11,13 @@ var app = new MainWindow(); app.ShowAll(); + // Tell the kiosk the window is drawn, so the splash video can close + GLib.Timeout.Add(300, () => + { + try { System.IO.File.WriteAllText("/tmp/kiosk-ready", ""); } catch { } + return false; + }); + Application.Run(); } } \ No newline at end of file