aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md30
-rw-r--r--src/Analysis.cs5
-rw-r--r--src/GetWindows.cs21
-rw-r--r--src/WatchLog.cs36
4 files changed, 8 insertions, 84 deletions
diff --git a/README.md b/README.md
index 09b9fc3..eee1455 100644
--- a/README.md
+++ b/README.md
@@ -10,19 +10,14 @@
paru -S hypr-wellbeing-bin
```
-### Windows
-
-Make sure [Scoop](https://scoop.sh/) is installed.
-
-```sh
-scoop bucket add demon-apps https://github.com/DemonKingSwarn/flix-cli-bucket.git
-scoop install hypr-wellbeing
-```
-
### Github Releases
You can download it from [Releases](https://github.com/DemonKingSwarn/hypr-wellbeing/releases)
+### Configuration
+
+It is located in `~/.config/hypr-wellbeing/config.json`
+
## Usage
### Monitor Mode
@@ -32,23 +27,6 @@ You can download it from [Releases](https://github.com/DemonKingSwarn/hypr-wellb
```sh
hypr-wellbeing -d &> /dev/null &
```
-
-**Windows**:
-
-```sh
-hypr-wellbeing.exe -d > $null 2>&1
-```
-
-**NOTE**: For windows you have to explicitly mention that its running on windows by adding in the config file:
-
-```json
-{
- "os": "Windows"
-}
-```
-
-Config file is located in `C:/Users/your username/hypr-wellbeing/config.json`
-
### Show Stats
```sh
diff --git a/src/Analysis.cs b/src/Analysis.cs
index 95a8236..c99d85d 100644
--- a/src/Analysis.cs
+++ b/src/Analysis.cs
@@ -11,7 +11,8 @@ namespace hyprwatch.Report
{
public static Dictionary<string, string> FinalReport(string date)
{
- string path = Environment.GetEnvironmentVariable("HOME") + "/.cache/hyprwatch/daily_data/";
+ string homeDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
+ string path = homeDir + "/.cache/hyprwatch/daily_data/";
string filename = Path.Combine(path, date + ".csv");
var report = new Dictionary<string, string>();
@@ -81,7 +82,7 @@ namespace hyprwatch.Report
public static void WeeklyLogs(string week)
{
- string user = Environment.GetEnvironmentVariable("HOME");
+ string user = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string filename = Path.Combine(user, ".cache/Watcher/Analysis/", week + ".csv");
using (var writer = new StreamWriter(filename))
diff --git a/src/GetWindows.cs b/src/GetWindows.cs
index 336f8b1..0508a88 100644
--- a/src/GetWindows.cs
+++ b/src/GetWindows.cs
@@ -9,13 +9,6 @@ namespace hyprwatch.Window
public partial class GetWindows
{
-
- [DllImport("user32.dll")]
- static extern IntPtr GetForegroundWindow();
-
- [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
-
public static string ActiveWindow()
{
string desktopEnv = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP");
@@ -92,20 +85,6 @@ namespace hyprwatch.Window
}
}
- else if (os == "Windows")
- {
-
- IntPtr handle = GetForegroundWindow();
- if(handle != IntPtr.Zero)
- {
- StringBuilder className = new StringBuilder(256);
- if(GetClassName(handle, className, className.Capacity) > 0)
- {
- activeWindow = className.ToString();
- }
- }
- }
-
if(activeWindow == null)
{
activeWindow = "Home-Screen";
diff --git a/src/WatchLog.cs b/src/WatchLog.cs
index 4a029d9..9340822 100644
--- a/src/WatchLog.cs
+++ b/src/WatchLog.cs
@@ -60,11 +60,6 @@ namespace hyprwatch.Logger
}
}
- else if(os == "Windows")
- {
- t = DateTime.Now.ToString("HH:mm:ss");
- }
-
return t ?? string.Empty;
}
@@ -117,35 +112,6 @@ namespace hyprwatch.Logger
}
}
- else if(os == "Windows")
- {
- try
- {
- Process process = new Process
- {
- StartInfo = new ProcessStartInfo
- {
- FileName = "powershell",
- Arguments = "-Command \"Get-Date -Format dd-MM-yyyy\"",
- RedirectStandardOutput = true,
- UseShellExecute = false,
- CreateNoWindow = true,
- }
- };
-
- process.Start();
-
- string output = process.StandardOutput.ReadToEnd();
- process.WaitForExit();
-
- d = output.Substring(0, output.Length - 1);
- }
- catch(Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
- }
-
return d ?? string.Empty;
}
@@ -207,7 +173,7 @@ namespace hyprwatch.Logger
string filename = Path.Combine($"{homeDir}", ".cache", "hyprwatch", "daily_data", $"{currentDate}.csv");
if(!File.Exists(filename))
{
- string directoryPath = Path.Combine($"{homeDir}", ".cache", "Watcher", "daily_data");
+ string directoryPath = Path.Combine($"{homeDir}", ".cache", "hyprwatch", "daily_data");
Directory.CreateDirectory(directoryPath);