Skip to content

Commit

Permalink
Initial Commit: vim keys, powermenu dialog, programs, window basic co…
Browse files Browse the repository at this point in the history
…ntrols, workspaces (external script) and license.
  • Loading branch information
lu0 committed Nov 20, 2021
0 parents commit 5af9c54
Show file tree
Hide file tree
Showing 10 changed files with 874 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
desktop.files.json
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "workspaces"]
path = workspaces
url = https://github.com/lu0/windows-desktop-switcher
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# autohotkey-config

AutoHotKey scripts I use to mimic my Linux Keybindings on Windows 10.
81 changes: 81 additions & 0 deletions altgr-arrows-and-chars.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#NoTrayIcon

; This script maps some keyboard combinations (latam layout)
; preceded by AltGr to combinations I use on Linux:
; hjklio to navigation keys,
; <> to parenthesis,
; Special characters (caret, backtick, tilde, at sign).

; Detect if AltGr is pressed
LControl & RAlt:: AltGR = 1
LControl & RAlt Up:: AltGR = 0

#If AltGR = 1

; Standalone
h:: Send {Left}
j:: Send {Down}
k:: Send {Up}
l:: Send {Right}
i:: Send {Home}
o:: Send {End}

; Shift +
+h:: Send +{Left}
+j:: Send +{Down}
+k:: Send +{Up}
+l:: Send +{Right}
+i:: Send +{Home}
+o:: Send +{End}

; Ctrl +
^h:: Send ^{Left}
^j:: Send ^{Down}
^k:: Send ^{Up}
^l:: Send ^{Right}
^i:: Send ^{Home}
^o:: Send ^{End}

; Ctrl + Shift +
^+h:: Send ^+{Left}
^+j:: Send ^+{Down}
^+k:: Send ^+{Up}
^+l:: Send ^+{Right}
^+i:: Send ^+{Home}
^+o:: Send ^+{End}

; Ctrl + Alt +
^!h:: Send ^!{Left}
^!j:: Send ^!{Down}
^!k:: Send ^!{Up}
^!l:: Send ^!{Right}
^!i:: Send ^!{Home}
^!o:: Send ^!{End}

; Ctrl + Super +
^#h:: Send ^!{Left}
^#j:: Send ^!{Down}
^#k:: Send ^!{Up}
^#l:: Send ^!{Right}
^#i:: Send ^!{Home}
^#o:: Send ^!{End}

; Shift + Super +
+#h:: Send ^!{Left}
+#j:: Send ^!{Down}
+#k:: Send ^!{Up}
+#l:: Send ^!{Right}
+#i:: Send ^!{Home}
+#o:: Send ^!{End}

; Map altGr + <> to parenthesis
<:: Send {(}
>:: Send {)}

; Restore special characters I use frequently
{:: Send {^}
}:: Send {``}
+:: Send {~}
q:: Send {@}

#If
6 changes: 6 additions & 0 deletions caps-esc.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#NoTrayIcon

; This scripts flips the functionality of CapsLock and Escape keys

CapsLock::Esc
Esc::CapsLock
18 changes: 18 additions & 0 deletions powermenu.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#NoTrayIcon
#NoEnv

; This script shows the Shutdown Dialog when pressing Super + P,
; the same keybinding I use on Linux

#p::ShowPowermenu()

; Snippet taken and adjusted from
; https://www.autohotkey.com/boards/viewtopic.php?t=81268
ShowPowermenu(ChooseString:="") {
ComObjCreate("Shell.Application").ShutdownWindows()
WinWait, Shut Down Windows
Control, ChooseString, %ChooseString%, ComboBox1
WinSet, AlwaysOnTop, 1
WinWaitClose
Return
}
44 changes: 44 additions & 0 deletions programs.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#NoTrayIcon

; This scripts maps ctrl + alt + <letter> to the programs I use frequently.

; Files (File Manager)
; ctrl + alt + f
^!f::
Run files
return


; WSL (Terminal)
; ctrl + alt + t
^!t::
Run wsl
return


; Vivaldi (web browser)
; ctrl + alt + w
^!w::
Run vivaldi
return


; Visual Studio Code
; ctrl + alt + v
^!v::
Run code
return


; Outlook Mail
; ctrl + alt + m
^!m::
Run outlook
return


; Microsoft Teams
; ctrl + alt + shift + m
^!+m::
Run C:\Users\Lucero_Alvarado\AppData\Local\Microsoft\Teams\Update.exe --processStart "Teams.exe"
return
43 changes: 43 additions & 0 deletions window-basic-control.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#NoTrayIcon

; Keybindings I use on Linux to close, minimize, maximize and snap the active window.
; Must enable "Zone index" on FancyZones (Windows Powertoys) and use a gap greater than 0.

; Close
; ctrl + super + space
^#Space::
PostMessage, 0x112, 0xF060,,, A
return

; Minimize
; left alt + x
LAlt & x::
Send #{down}
return

; Toggle maximize/unmaximize
; left alt + space
LAlt & space::
WinGetTitle, winname, A
WinGetPos, X, Y, Width, Height, %winname%
if (Y > 0)
Send #{up}
else if (Y <= 0)
Send #{down}
return

; Snap/move to the left
; alt + a
LAlt & a::
if not GetKeyState("Shift")
Send #{left}
else
; Alt + Shift + A
Send !+{a}
return

; Snap/move to the right
; alt + d
LAlt & d::
Send #{right}
return
1 change: 1 addition & 0 deletions workspaces
Submodule workspaces added at 84cb1a

0 comments on commit 5af9c54

Please sign in to comment.