mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 01:48:20 +02:00
Add check-month.ps1
This commit is contained in:
parent
d15a5e5af3
commit
877cdab36e
@ -32,7 +32,7 @@ When finished say: *"Computer, close [app]"* to close the application.
|
|||||||
|
|
||||||
*"Computer, check [item]."*
|
*"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."*
|
*"Computer, open [letter] drive."*
|
||||||
|
23
Scripts/check-month.ps1
Normal file
23
Scripts/check-month.ps1
Normal 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
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Switches to a random wallpaper
|
Switches to a random wallpaper
|
||||||
.DESCRIPTION
|
.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
|
.PARAMETER Category
|
||||||
Specifies the photo category (beach, city, ...)
|
Specifies the photo category (beach, city, ...)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -23,7 +23,7 @@ function GetTempDir {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
& "$PSScriptRoot/give-reply.ps1" "Loading from Unsplash..."
|
& "$PSScriptRoot/give-reply.ps1" "Just a second..."
|
||||||
|
|
||||||
$Path = "$(GetTempDir)/next_wallpaper.jpg"
|
$Path = "$(GetTempDir)/next_wallpaper.jpg"
|
||||||
& wget -O $Path "https://source.unsplash.com/3840x2160?$Category"
|
& wget -O $Path "https://source.unsplash.com/3840x2160?$Category"
|
||||||
|
Loading…
Reference in New Issue
Block a user