Add check-month.ps1

This commit is contained in:
Markus Fleschutz 2021-12-13 08:11:12 +01:00
parent d15a5e5af3
commit 877cdab36e
3 changed files with 26 additions and 3 deletions

View File

@ -32,7 +32,7 @@ When finished say: *"Computer, close [app]"* to close the application.
*"Computer, check [item]."*
--------------------------
Lets the computer check something, replace [item] by: `Bitcoin rate`, `Christmas`, `CPU`, `date`, `dawn`, `day`, `DNS`, `drives`, `dusk`, `Easter Sunday`, `Earth` (fun), `Ether rate`, `headlines`, `Independence Day`, `ISS position`, `midnight`, `moon phase`, `New Year`, `noon`, `operating system`, `ping`, `Santa`, `sunrise`, `sunset`, `swap space`, `tea time`, `Tether rate`, `time`, `time zone`, `up-time`, `VPN`, `weather`, `week`, `year`, or `zenith`.
Lets the computer check something, replace [item] by: `Bitcoin rate`, `Christmas`, `CPU`, `date`, `dawn`, `day`, `DNS`, `drives`, `dusk`, `Easter Sunday`, `Earth` (fun), `Ether rate`, `headlines`, `Independence Day`, `ISS position`, `midnight`, `moon phase`, `month`, `New Year`, `noon`, `operating system`, `ping`, `Santa`, `sunrise`, `sunset`, `swap space`, `tea time`, `Tether rate`, `time`, `time zone`, `up-time`, `VPN`, `weather`, `week`, `year`, or `zenith`.
*"Computer, open [letter] drive."*

23
Scripts/check-month.ps1 Normal file
View File

@ -0,0 +1,23 @@
<#
.SYNOPSIS
Gets the current month name
.DESCRIPTION
This script determines and speaks the current month name by text-to-speech (TTS).
.EXAMPLE
PS> ./check-month
It's December.
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
try {
[system.threading.thread]::currentthread.currentculture=[system.globalization.cultureinfo]"en-US"
$MonthName = (Get-Date -UFormat %B)
& "$PSScriptRoot/give-reply.ps1" "It's $MonthName."
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}

View File

@ -2,7 +2,7 @@
.SYNOPSIS
Switches to a random wallpaper
.DESCRIPTION
This script downloads a random photo and sets it as desktop wallpaper.
This script downloads a random photo from Unsplash and sets it as desktop wallpaper.
.PARAMETER Category
Specifies the photo category (beach, city, ...)
.EXAMPLE
@ -23,7 +23,7 @@ function GetTempDir {
}
try {
& "$PSScriptRoot/give-reply.ps1" "Loading from Unsplash..."
& "$PSScriptRoot/give-reply.ps1" "Just a second..."
$Path = "$(GetTempDir)/next_wallpaper.jpg"
& wget -O $Path "https://source.unsplash.com/3840x2160?$Category"