first run message and don't allow running as root
This commit is contained in:
parent
3720263085
commit
db5df2cc78
|
@ -54,6 +54,14 @@ public class SparklePony {
|
||||||
Environment.Exit (0);
|
Environment.Exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't allow running as root
|
||||||
|
Process.StartInfo.FileName = "whoami";
|
||||||
|
Process.Start();
|
||||||
|
if (Process.StandardOutput.ReadToEnd().Trim ().Equals ("root")) {
|
||||||
|
Console.WriteLine ("Sorry, you shouldn't run SparklePony as root.\nThings will go utterly wrong.");
|
||||||
|
Environment.Exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
bool HideUI = false;
|
bool HideUI = false;
|
||||||
if (args.Length > 0) {
|
if (args.Length > 0) {
|
||||||
foreach (string Argument in args) {
|
foreach (string Argument in args) {
|
||||||
|
@ -155,10 +163,10 @@ public class SparklePonyStatusIcon : StatusIcon {
|
||||||
|
|
||||||
public SparklePonyStatusIcon () : base () {
|
public SparklePonyStatusIcon () : base () {
|
||||||
IconName = "folder-remote";
|
IconName = "folder-remote";
|
||||||
Notification Notification = new Notification ("herro", "");
|
// TODO: Only on first run
|
||||||
Notification.StatusIcon = this;
|
Notification Notification = new Notification ("Welcome to SparklePony!", "Click here to add some folders.");
|
||||||
Notification.Urgency = Urgency.Normal;
|
Notification.Urgency = Urgency.Normal;
|
||||||
Notification.Timeout = 3500;
|
Notification.Timeout = 10000;
|
||||||
Notification.Show ();
|
Notification.Show ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue