So I figured I would start posting some as I create them and share here. I only have a couple small ones currently, but looking to do a lot more and though maybe someone could find these useful.
Note: I have push2run set to run with admin privileges which is needed for the ps script to run. I tried creating a scheduled task to give push2run highest elevation, but that didn't seem to work for me as push2run was getting an error. Going to circle back to that later.
-------
Restart Plex
Useful when I'm not around my computer or if I'm being lazy. Plex can be run as a service, but it's nice to be able to restart with voice commands.
Card The Restart Plex.p2r card calls this powershell script "C:\GoogleHome\scripts\Plex\Restart.ps1".
Code: Select all
TASKKILL /f /im "Plex Media Server.exe"
TASKKILL /f /im "PlexScriptHost.exe"
Start-Sleep -s 5
& 'C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe'
Run CCleaner
Runs CCleaner silently in Auto mode which uses the saved cleaning settings.
Card -------
New Text Notification
Now this one is a little tricky as it relies on tasker to use the $SMSRN variable along with the keyboard input to enter a command into google assistant. My reason for creating this: I've been working from home since COVID-19 and have a routine in tasker to keep my phone silent when connected to my home wifi because I get bombarded by spam calls and just find the phone annoying in general. The main goal is to get it to notify me when I get texts from important contacts.
Tasker will send a command to google assistant with the contact name that sent me a text message and that will kick off the below card. The card will then call a small vbs script that will create a pop-up on my computer telling me I received a text from ContactName and close after 15 seconds. It's very basic right now, but will eventually make it more robust for other operations.
Card The "New Text Message" card calls the vbs script "C:\GoogleHome\popups\newText.vbs"
Code: Select all
Dim objShell, intButton
set objShell = CreateObject("Wscript.Shell")
intButton = objShell.Popup("Text from " + UCase(WScript.Arguments.Item(0)), 15, "New Message", 0+64)