-
Notifications
You must be signed in to change notification settings - Fork 1
/
UnityLightDMControl.cs
45 lines (41 loc) · 1.37 KB
/
UnityLightDMControl.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// System libraries
using System;
using System.Diagnostics;
using System.Threading;
using System.IO;
namespace devunity.components
{
public class UnityLightDMControl
{
public static void LightDMStop()
{
Console.Write("Are you sure? This command assumes you are using LightDM. This operation will disrupt all running apps. To proceed, press ENTER, and to cancel, press ^C.");
Console.ReadLine();
new Process()
{
StartInfo = new ProcessStartInfo
{
FileName = "service",
Arguments = "lightdm stop",
UseShellExecute = false,
CreateNoWindow = true,
}
}.Start();
}
public static void LightDMRestart()
{
Console.Write("Are you sure? This command assumes you are using LightDM. This operation will disrupt all running apps. To proceed, press ENTER, and to cancel, press ^C.");
Console.ReadLine();
new Process()
{
StartInfo = new ProcessStartInfo
{
FileName = "service",
Arguments = "lightdm restart",
UseShellExecute = false,
CreateNoWindow = true,
}
}.Start();
}
}
}