diff --git a/win/profile.ps1 b/win/profile.ps1 new file mode 100644 index 0000000..bfd98a9 --- /dev/null +++ b/win/profile.ps1 @@ -0,0 +1,18 @@ +# adminstration powershell: +# Set-ExecutionPolicy RemoteSigned +# new-item -ItemType SymbolicLink -Target "D:\Nextcloud\klesh\config\win\profile.ps1" -Path $profile + + +Set-PSReadLineOption -EditMode Emacs + +Function dp ($Word) { + Add-Type -AssemblyName presentationCore + $tmpPath = Join-Path -Path $env:Temp -ChildPath 'sound.mp3' + Invoke-WebRequest -Uri "http://dict.youdao.com/dictvoice?audio=$Word&type=1" -OutFile $tmpPath + $mediaPlayer = New-Object system.windows.media.mediaplayer + $mediaPlayer.Open($tmpPath) + $mediaPlayer.Play() + Start-Sleep -Seconds 2 + $mediaPlayer.Close() +} + diff --git a/win/setup.ps1 b/win/setup.ps1 new file mode 100644 index 0000000..d5326e9 --- /dev/null +++ b/win/setup.ps1 @@ -0,0 +1,11 @@ +Set-ExecutionPolicy RemoteSigned + +$dotfiles=(Get-Item $PSScriptRoot).Parent.FullName +New-Item -ItemType SymbolicLink -Target $dotfiles\win\profile.ps1 -Path $profile -Force +New-Item -ItemType SymbolicLink -Target $dotfiles\config\mpv\mpv.conf -Path $Env:APPDATA\mpv\mpv.conf -Force +New-Item -ItemType SymbolicLink -Target $dotfiles\config\mpv\scripts -Path $Env:APPDATA\mpv\scripts -Force + +$sshconf="D:\Nextcloud\klesh\config\ssh\config" +if (Test-Path $sshconf -PathType Leaf) { + New-Item -ItemType SymbolicLink -Target $sshconf -Path $home\.ssh\config -Force +} \ No newline at end of file diff --git a/win/win.ahk b/win/win.ahk new file mode 100644 index 0000000..4a3662e --- /dev/null +++ b/win/win.ahk @@ -0,0 +1,76 @@ +^Esc:: Send ^{``} +*#q:: Send {LAlt down}{F4}{LAlt up} + + +^BS:: + Send ^a + Send {BS} + return + + +#=::SoundSet,+5 +#-::SoundSet,-5 + + +; Ctrl + Shift + v : paste as plain text +^!v:: + Clip0 = %ClipBoardAll% + ClipBoard = %ClipBoard% ; Convert to plain text + Send ^v + Sleep 1000 + ClipBoard = %Clip0% + VarSetCapacity(Clip0, 0) ; Free memory +Return + +^+!v:: + Clip0 = %ClipBoardAll% + ClipBoard := StrReplace(ClipBoard, "\", "/") ; Convert to plain text + Send ^v + Sleep 1000 + ClipBoard = %Clip0% + VarSetCapacity(Clip0, 0) ; Free memory +Return + + +#IfWinActive ahk_class ConsoleWindowClass + ^+v:: MouseClick, Right + ^+c:: MouseClick, Right +#IfWinActive + + +#IfWinActive ahk_class mintty + ^+v::Send +{Ins} + ^+c::Send ^{Ins} +#IfWinActive + + +#f:: WinMaximize, A +#+f:: WinRestore, A +#+l:: Send {LWinDown}{Right}{LWinUp} +#+h:: Send {LWinDown}{Left}{LWinUp} + + +Capslock & h:: Send {Left} +Capslock & j:: Send {Down} +Capslock & k:: Send {Up} +Capslock & l:: Send {Right} +Capslock & -:: Send {Volume_Down} +Capslock & =:: Send {Volume_Up} +Capslock & \:: Send {Media_Play_Pause} +Capslock & y:: Send {Browser_Back} +Capslock & u:: Send ^{PgUp} +Capslock & i:: Send ^{PgDn} +Capslock & o:: Send {Browser_Forward} +Capslock & BackSpace:: Send {Del} + +Capslock & n:: Send {Home} +Capslock & m:: Send {PgUp} +Capslock & ,:: Send {PgDn} +Capslock & .:: Send {End} + +Capslock & Space:: SetCapsLockState % !GetKeyState("CapsLock", "T") ++CapsLock:: + Send {~} + SetCapsLockState % !GetKeyState("CapsLock", "T") +Return +Capslock::return