summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkkard2 <[email protected]>2023-07-10 11:06:11 +0200
committerkkard2 <[email protected]>2023-07-10 11:06:11 +0200
commitefa0d2fbaf917bf3cd2efd54166caa56d5fb30dc (patch)
tree1cb2114f5d844f6c58234238c9bf28d66e5bf9fd
parentdfbd247f37142efd24afe8878776562f1913a142 (diff)
parent3bae70f7ab8a430923259245844862224a49982d (diff)
Merge branch 'main' of github.com:kkard2/.dotfiles
-rw-r--r--README.md3
-rw-r--r--_windows/ahk/capslock.ahk113
-rw-r--r--_windows/ahk/discord.ahk11
-rw-r--r--_windows/ahk/media.ahk8
-rw-r--r--_windows/ahk/run.ps15
-rw-r--r--_windows/startup.ps13
6 files changed, 143 insertions, 0 deletions
diff --git a/README.md b/README.md
index 77db994..ddc5497 100644
--- a/README.md
+++ b/README.md
@@ -3,3 +3,6 @@ config stuff (i need to move everything into one place)
# links for this to work
* `~/.ideavimrc` -> `./idea/.ideavimrc`
+
+# windows
+* run `./_windows/startup.ps1` on startup (`PowerShell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File <PATH>`)
diff --git a/_windows/ahk/capslock.ahk b/_windows/ahk/capslock.ahk
new file mode 100644
index 0000000..0fb67bb
--- /dev/null
+++ b/_windows/ahk/capslock.ahk
@@ -0,0 +1,113 @@
+#Requires AutoHotkey v2
+#SingleInstance Force
+
+CapsLockState := false
+HarpoonLastWindowIndex := 0
+
+HarpoonRun(winTitle) {
+ SetTitleMatchMode 2
+ DetectHiddenWindows false
+
+ windows := WinGetList(winTitle)
+
+ if windows.Length = 0 {
+ return
+ }
+
+ if WinActive(winTitle) {
+ global HarpoonLastWindowIndex := Mod((HarpoonLastWindowIndex + 1), windows.Length)
+ } else {
+ global HarpoonLastWindowIndex := 0
+ }
+
+ WinActivate windows[HarpoonLastWindowIndex + 1]
+}
+
+#HotIf GetKeyState("CapsLock", "P")
+\::{
+ global CapsLockState := not CapsLockState
+ SetCapsLockState CapsLockState
+}
+
+; vim motion
+h::Left
+j::Down
+k::Up
+l::Right
+
+y::^Left
+u::^Down
+i::^Up
+o::^Right
+
+n::Home
+m::PgDn
+,::PgUp
+.::End
+
+; vim motion w select
++h::+Left
++j::+Down
++k::+Up
++l::+Right
+
++y::^+Left
++u::^+Down
++i::^+Up
++o::^+Right
+
++n::+Home
++m::+PgDn
++,::+PgUp
++.::+End
+
+; harpoon
+`::HarpoonRun("ahk_exe WindowsTerminal.exe")
+1::HarpoonRun("ahk_exe Discord.exe")
+2::HarpoonRun("ahk_exe rider64.exe")
+3::HarpoonRun("ahk_exe msedge.exe")
+4::HarpoonRun("ahk_exe Element.exe")
+5::HarpoonRun("ahk_exe code.exe")
+e::HarpoonRun("ahk_class CabinetWClass")
+
+Esc::Run "taskmgr"
+
+; window manipulation
+!h::#Left
+!j::#Down
+!k::#Up
+!l::#Right
+
+!y::#+Left
+!u::#+Down
+!i::#+Up
+!o::#+Right
+
+; desktop switching
+!,::^#Left
+!m::^#Right
+
+q::Esc
+#HotIf
+
+CapsLock::{
+ KeyWait "CapsLock"
+ if A_ThisHotkey = "CapsLock" {
+ Send "{Escape}"
+ }
+}
+
+!CapsLock::{
+ return
+}
+^CapsLock::{
+ return
+}
+^!CapsLock::{
+ return
+}
++CapsLock::{
+ return
+}
+
+Esc::F13
diff --git a/_windows/ahk/discord.ahk b/_windows/ahk/discord.ahk
new file mode 100644
index 0000000..9417348
--- /dev/null
+++ b/_windows/ahk/discord.ahk
@@ -0,0 +1,11 @@
+#Requires AutoHotkey v2
+#SingleInstance Force
+
+#HotIf GetKeyState("CapsLock", "P")
+^j::!Down
+^k::!Up
+^u::^!Down
+^i::^!Up
+^m::+!Down
+^,::+!Up
+#HotIf
diff --git a/_windows/ahk/media.ahk b/_windows/ahk/media.ahk
new file mode 100644
index 0000000..6e4495d
--- /dev/null
+++ b/_windows/ahk/media.ahk
@@ -0,0 +1,8 @@
+#Requires AutoHotkey v2
+#SingleInstance Force
+
+^#Space::Send "{Media_Play_Pause}"
+^#x::Send "{Media_Next}"
+^#z::Send "{Media_Prev}"
+^#Up::Send "{Volume_Up}"
+^#Down::Send "{Volume_Down}"
diff --git a/_windows/ahk/run.ps1 b/_windows/ahk/run.ps1
new file mode 100644
index 0000000..011d18c
--- /dev/null
+++ b/_windows/ahk/run.ps1
@@ -0,0 +1,5 @@
+Push-Location $PSScriptRoot
+.\capslock.ahk
+.\media.ahk
+.\discord.ahk
+Pop-Location
diff --git a/_windows/startup.ps1 b/_windows/startup.ps1
new file mode 100644
index 0000000..7c8d4f4
--- /dev/null
+++ b/_windows/startup.ps1
@@ -0,0 +1,3 @@
+Push-Location $PSScriptRoot
+.\ahk\run.ps1
+Pop-Location