mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Change how Linux session display is determined.
This commit is contained in:
parent
d1858aaf8b
commit
c84328e1a5
@ -90,7 +90,7 @@ namespace Remotely.Agent.Services
|
||||
var xauthority = GetXorgAuth();
|
||||
|
||||
var display = ":0";
|
||||
var whoString = EnvironmentHelper.StartProcessWithResults("w", "-h")?.Trim();
|
||||
var whoString = EnvironmentHelper.StartProcessWithResults("who", "")?.Trim();
|
||||
var username = "";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(whoString))
|
||||
@ -103,7 +103,7 @@ namespace Remotely.Agent.Services
|
||||
|
||||
var whoSplit = whoLine.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
username = whoSplit[0];
|
||||
display = whoSplit[2];
|
||||
display = whoSplit.Last().TrimStart('(').TrimEnd(')');
|
||||
xauthority = $"/home/{username}/.Xauthority";
|
||||
args = $"-u {username} {args}";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user