Comments (1)
Consider the following PowerShell script workaround for Windows.
# PowerShell 5.1 Win10
# @(#)baralga_reminder 211025
#--------------------------------------------------------------------------
function Notify([string]$title,[string]$text,[int]$exp_sec) {
$notif_tag="PS_script"
[Windows.UI.Notifications.ToastNotificationManager,Windows.UI.Notifications,ContentType=WindowsRuntime] > $null
$tt02tpl=[Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText02)
$toast_xml=[xml]$tt02tpl.GetXml()
($toast_xml.toast.visual.binding.text | where {$_.id -eq "1"}).AppendChild($toast_xml.CreateTextNode($title)) > $null
($toast_xml.toast.visual.binding.text | where {$_.id -eq "2"}).AppendChild($toast_xml.CreateTextNode($text)) > $null
$xmldoc=New-Object Windows.Data.Xml.Dom.XmlDocument
$xmldoc.LoadXml($toast_xml.OuterXml)
$toast=[Windows.UI.Notifications.ToastNotification]::new($xmldoc)
$toast.Tag="__"
$toast.Group="__"
$toast.ExpirationTime=[DateTimeOffset]::Now.AddSeconds($exp_sec)
$notifier=[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($notif_tag)
$notifier.Show($toast);
}
#--------------------------------------------------------------------------
$dur_sec=60
$stw=New-Object System.Diagnostics.Stopwatch
$host.ui.RawUI.WindowTitle="Baralga reminder"
$host.UI.RawUI.WindowSize=New-Object System.Management.Automation.Host.size(76,8)
$host.UI.RawUI.BufferSize=New-Object System.Management.Automation.Host.size(76,8)
$stw.Start()
while($true) {
$n=[int]($stw.Elapsed.TotalSeconds/$dur_sec*100)
if($n -ge 100) {
Notify "Baralga" "What are you doing now?" 5
$dur_sec=60*(Get-Random -Minimum 10 -Maximum 50)
$stw.Reset()
$stw.Restart()
} else {
Write-Progress -Activity "Stopwatch.Elapsed" -Status "time $n % elapsed" -PercentComplete $n
Start-Sleep -Seconds 10
}
}
# $stw.Reset()
#--------------------------------------------------------------------------
from baralga.
Related Issues (20)
- Project Search with Description
- Baralga is adding project times for idle times HOT 1
- Monthly/weekly hours by project summary does't add the hours instead shows individual entries HOT 4
- Configuration fornon-active projects does not remain after baralga restart
- link to download is 404 HOT 1
- About window - Homepage URL is obsolete
- Activities by quarter shows activities of last month only
- Installer don't work on MacOS HOT 3
- Migrate installer to new jpackage introduced with Java 16
- Issues with the installer of the 1.9.7 package under Linux (Ubuntu 20.04) HOT 3
- Please develop GUI installer for Macos version of Baralga HOT 1
- Dark mode support HOT 1
- Inconsistent behaviour when rolling past midnight
- Add undo/redo support for editing activities
- Time Zone change - Fatal Error HOT 1
- Project budget tracking
- Exception "The system tray is not supported on the current platform" on Ubuntu 22.04
- wrong behaviour when baralga is closed without stopping the running activity
- bindkeys & api HOT 1
- how to install this? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baralga.