Last active
October 18, 2021 04:18
-
-
Save nuvious/4b0f703721a4645d9d515783e9cc19ad to your computer and use it in GitHub Desktop.
Alarm powershell script that launches a video with VLC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modify as necessary to point to your vlc installation and alarm video file. | |
$vlc_path = "C:\Program Files\VideoLAN\VLC\vlc.exe" | |
$video_path = "Alarm_Video_1080p.mp4" | |
# Get the desired alarm time. | |
[datetime]$AlarmTime = Read-Host "Please enter at time to launch alarm; ex 6AM, 8:30AM, etc" | |
# Calculate the wait in seconds and start the wait. | |
[datetime]$CurrentTime = Get-Date | |
[int]$WaitSeconds = ( $AlarmTime - $CurrentTime ).TotalSeconds | |
Write-Host "Alarm set for $AlarmTime, sleeping $WaitSeconds s." | |
Start-Sleep -Seconds $WaitSeconds | |
# Launch the video. | |
& $vlc_path --loop $video_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment