aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Program.cs15
-rw-r--r--src/GetWindows.cs5
2 files changed, 20 insertions, 0 deletions
diff --git a/Program.cs b/Program.cs
index 5cd262a..340e338 100644
--- a/Program.cs
+++ b/Program.cs
@@ -46,12 +46,27 @@ class Program
data[key] = value;
}
}
+
+ TimeSpan totalTime = TimeSpan.Zero;
+
+ foreach (var entry in data)
+ {
+ if (TimeSpan.TryParse(entry.Value, out TimeSpan time))
+ {
+ totalTime += time;
+ }
+ }
+
+ Console.WriteLine($"Today's Screen Usage\t{totalTime}");
+ Console.WriteLine($"{red}{new string('-', 60)}{reset}");
Console.WriteLine($"{yellow}{"App",-30}{"Time",30}{reset}");
Console.WriteLine($"{red}{new string('-', 60)}{reset}");
+
foreach (var entry in data)
{
Console.WriteLine($"{blue}{entry.Key,-30}{reset}{green}{entry.Value,30}{reset}");
}
+
}
}
diff --git a/src/GetWindows.cs b/src/GetWindows.cs
index eafb117..3eeb81c 100644
--- a/src/GetWindows.cs
+++ b/src/GetWindows.cs
@@ -40,6 +40,11 @@ namespace hyprwatch.Window
Console.WriteLine(ex.Message);
}
+ if(activeWindow == null)
+ {
+ activeWindow = "Home-Screen";
+ }
+
return activeWindow ?? string.Empty;
}
}