Skip to content

Instantly share code, notes, and snippets.

@nuvious
Last active October 18, 2021 04:18
Show Gist options
  • Save nuvious/4b0f703721a4645d9d515783e9cc19ad to your computer and use it in GitHub Desktop.
Save nuvious/4b0f703721a4645d9d515783e9cc19ad to your computer and use it in GitHub Desktop.
Alarm powershell script that launches a video with VLC.
# 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