get the user's real name from the system
This commit is contained in:
parent
f4bbe80f79
commit
80bbffa205
|
@ -15,6 +15,7 @@
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
using Mono.Unix;
|
||||||
using SparkleShare;
|
using SparkleShare;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
@ -54,10 +55,12 @@ namespace SparkleShare {
|
||||||
|
|
||||||
// Get user.name, example: "User Name"
|
// Get user.name, example: "User Name"
|
||||||
UserName = "Anonymous";
|
UserName = "Anonymous";
|
||||||
|
UnixUserInfo UnixUserInfo =
|
||||||
|
new UnixUserInfo (UnixEnvironment.UserName);
|
||||||
|
UserName = UnixUserInfo.RealName;
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "config --get user.name";
|
Process.StartInfo.Arguments = "config user.name " + UserName;
|
||||||
Process.Start ();
|
Process.Start ();
|
||||||
UserName = Process.StandardOutput.ReadToEnd ().Trim ();
|
|
||||||
|
|
||||||
// Get user.email, example: "user@github.com"
|
// Get user.email, example: "user@github.com"
|
||||||
UserEmail = "not.set@git-scm.com";
|
UserEmail = "not.set@git-scm.com";
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace SparkleShare {
|
||||||
Process.StartInfo.FileName = "gvfs-set-attribute";
|
Process.StartInfo.FileName = "gvfs-set-attribute";
|
||||||
Process.StartInfo.Arguments =
|
Process.StartInfo.Arguments =
|
||||||
Folder + " metadata::emblems [synced]";
|
Folder + " metadata::emblems [synced]";
|
||||||
Console.WriteLine (Process.StartInfo.FileName + " " + Process.StartInfo.Arguments);
|
// Console.WriteLine (Process.StartInfo.FileName + " " + Process.StartInfo.Arguments);
|
||||||
Process.Start ();
|
Process.Start ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue