Skip to content

Commit

Permalink
Stop tracking when work day starts
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadoySV committed Jan 27, 2024
1 parent 91987cf commit 8d83f4a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.0] - 2024-01-27

### Changed

- Tracking stops when work day starts

## [0.4.0] - 2023-10-30

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "work-break"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
description = "Work-break balancer for Windows / MacOS / Linux desktops"
license = "MIT"
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The notification contains the current phase, strain and today work time, needed

### Compatibility

Windows 8+ (requires [MS Visual C++ 2015](https://www.microsoft.com/en-us/download/details.aspx?id=52685), tested on Windows 10)
Windows 8+ (may require [MS Visual C++ 2015](https://www.microsoft.com/en-us/download/details.aspx?id=52685), tested on Windows 10/11)

MacOS 10+ (tested on MacOS 11.7)

Expand Down Expand Up @@ -114,6 +114,12 @@ Restart your system or ask the app to apply the changed configuration:
work-break reload
```

## Troubleshooting

##### Windows 11: App does not run and its notifications do not appear. "Do not disturb" mode is off.

Look at [how to restore PowerShell notifications](https://answers.microsoft.com/en-us/windows/forum/all/powershell-toast-notifcations/a8a83b7a-0a4c-4f3d-b541-7e11403955fb)

# Similar projects

[Bartib](https://github.com/nikolassv/bartib) is a simple time tracker for the command line. It saves a log of all tracked activities as a plaintext file and allows you to create flexible reports.
2 changes: 1 addition & 1 deletion extra/osx/Work-break.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.4.0</string>
<string>0.5.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
Expand Down
12 changes: 1 addition & 11 deletions src/activities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@ pub struct Activities {

impl Activities {
pub fn truncate_until(&mut self, point: SystemTime) {
self.list.retain_mut(|a| {
a.end
.map(|e| {
let retain = e > point;
if retain && a.start < point {
a.start = point
};
retain
})
.unwrap_or(true)
});
self.list.retain(|a| a.start >= point);
}

/// Returns end, strain and total work
Expand Down

0 comments on commit 8d83f4a

Please sign in to comment.