mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 21:46:43 +01:00
Add next-*-wallpaper.ps1 scripts
This commit is contained in:
parent
49c61532f1
commit
adbc91e573
@ -89,6 +89,11 @@ Launches the default Web browser and plays the given game - replace [name] by: `
|
||||
When finished say: *"Close tab"* or: *"Computer, close [name] browser"* to close the Web browser.
|
||||
|
||||
|
||||
*"Computer, next [category] wallpaper."*
|
||||
----------------------------------------
|
||||
Replaces the desktop background by a random photo from Unsplash, just replace [category] by: `beach`, `city`, or `random`.
|
||||
|
||||
|
||||
*"Computer, open [name] settings."*
|
||||
----------------------------------
|
||||
Launches the Windows settings - replace [name] by: `activation`, `apps`, `background`, `backup`, `bluetooth`, `color`, `date`, `default apps`, `developer`, `display`, `ethernet`, `lockscreen`, `maps`, `printer`, `proxy`, `recovery`, `speech`, `start`, `system` *(the top level settings!)*, `taskbar`, `themes`, `time`, `update`, `USB`, `VPN`, or `Wifi`.
|
||||
|
15
Scripts/next-beach-wallpaper.ps1
Normal file
15
Scripts/next-beach-wallpaper.ps1
Normal file
@ -0,0 +1,15 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Switches to a beach wallpaper
|
||||
.DESCRIPTION
|
||||
This script downloads a random beach photo and sets it as desktop wallpaper.
|
||||
.EXAMPLE
|
||||
PS> ./switch-to-beach-wallpaper
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/switch-wallpaper.ps1" -Category "beach"
|
||||
exit 0 # success
|
15
Scripts/next-city-wallpaper.ps1
Normal file
15
Scripts/next-city-wallpaper.ps1
Normal file
@ -0,0 +1,15 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Switches to a city wallpaper
|
||||
.DESCRIPTION
|
||||
This script downloads a random city photo and sets it as desktop wallpaper.
|
||||
.EXAMPLE
|
||||
PS> ./switch-to-city-wallpaper
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
& "$PSScriptRoot/switch-wallpaper.ps1" -Category "city"
|
||||
exit 0 # success
|
@ -3,14 +3,18 @@
|
||||
Switches to a random wallpaper
|
||||
.DESCRIPTION
|
||||
This script downloads a random photo and sets it as desktop wallpaper.
|
||||
.PARAMETER Category
|
||||
Specifies the photo category (beach, city, ...)
|
||||
.EXAMPLE
|
||||
PS> ./switch-wallpaper
|
||||
PS> ./switch-wallpaper beach
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
param([string]$Category = "")
|
||||
|
||||
function GetTempDir {
|
||||
if ("$env:TEMP" -ne "") { return "$env:TEMP" }
|
||||
if ("$env:TMP" -ne "") { return "$env:TMP" }
|
||||
@ -19,10 +23,10 @@ function GetTempDir {
|
||||
}
|
||||
|
||||
try {
|
||||
& "$PSScriptRoot/give-reply.ps1" "Loading one from Unsplash..."
|
||||
& "$PSScriptRoot/give-reply.ps1" "Loading from Unsplash..."
|
||||
|
||||
$Path = "$(GetTempDir)/next_wallpaper.jpg"
|
||||
& wget -O $Path "https://picsum.photos/3840/2160"
|
||||
& wget -O $Path "https://source.unsplash.com/3840x2160?$Category"
|
||||
if ($lastExitCode -ne "0") { throw "Download failed" }
|
||||
|
||||
& "$PSScriptRoot/set-wallpaper.ps1" -ImageFile "$Path"
|
Loading…
Reference in New Issue
Block a user