Skip to content

Instantly share code, notes, and snippets.

; For faster switching with standard method needs to disable "Animate windows when minimizing and maximizing"
; in SystemPropertiesAdvanced.exe -> Advanced -> Performance -> Settings -> Visual Effects
; Globals
DesktopCount := 4 ; Windows starts with 2 desktops at boot
CurrentDesktop := 1 ; Desktop count is 1-indexed (Microsoft numbers them this way)
PreviousDesktop := 1 ; Number of previous desktop
UseAltSwitchAfter := 2 ; Use alternative (TaskView) switch method if distance is more than this variable
KeyDelayStandartSwitch := 100 ; Delay between switching each desktop in standard mode.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; This should be replaced by whatever your native language is. See
; http://msdn.microsoft.com/en-us/library/dd318693%28v=vs.85%29.aspx
; for the language identifiers list.
ru := DllCall("LoadKeyboardLayout", "Str", "00000419", "Int", 1)
@strayge
strayge / shortcuts.ahk
Last active March 18, 2018 10:19
windows shortcuts
; # - win, ! - alt, ^ - ctrl, + - shift
#MaxHotkeysPerInterval 200
global en := DllCall("LoadKeyboardLayout", "Str", "00000409", "Int", 1)
ChangeActiveLayoutToEng()
{
WinGet, window_id, ID, A
pid := DllCall("GetWindowThreadProcessId", "UInt", window_id, "Ptr", 0)
@strayge
strayge / find_sectors.py
Last active December 11, 2018 07:24
Recover files from damaged disk using The Sleuth Kit and ddrescue (GNU)
#!/usr/bin/python3
# Script for combine The Sleuth Kit and ddrescue (GNU)
# It's allowed to restore from damaged drive only needed files
import argparse
import json
import os
import subprocess
import time