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
SaveSetColours(set := False, liteSet := True) | |
{ | |
; Sys colours saving adapted from an approach found in Bertrand Deo's code | |
; The rest is from Michael Maltsev: https://github.com/RaMMicHaeL/Windows-10-Color-Control | |
static DWMCOLORIZATIONPARAMS, IMMERSIVE_COLOR_PREFERENCE | |
,DwmGetColorizationParameters := DllCall("GetProcAddress", "Ptr", DllCall("GetModuleHandleW", "WStr", "dwmapi.dll", "Ptr"), "Ptr", 127, "Ptr") | |
,DwmSetColorizationParameters := DllCall("GetProcAddress", "Ptr", DllCall("GetModuleHandleW", "WStr", "dwmapi.dll", "Ptr"), "Ptr", 131, "Ptr") | |
,GetUserColorPreference := DllCall("GetProcAddress", "Ptr", DllCall("GetModuleHandleW", "WStr", "uxtheme.dll", "Ptr"), "AStr", "GetUserColorPreference", "Ptr") | |
,SetUserColorPreference := DllCall("GetProcAddress", "Ptr", DllCall("GetModuleHandleW", "WStr", "uxtheme.dll", "Ptr"), "Ptr", 122, "Ptr") | |
,WM_SYSCOLORCHANGE := 0x0015, sys_colours, sav_colours, colourCount := 31, GetSysColor := DllCall("GetProcAddress", "Ptr", DllCall("GetModule |
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
; ---------------------------------------------------------------------------------------------------------------------- | |
; Name .........: TermWait library | |
; Description ..: Implement the RegisterWaitForSingleObject Windows API. | |
; AHK Version ..: AHK_L 1.1.13.01 x32/64 Unicode | |
; Author .......: Cyruz (http://ciroprincipe.info) & SKAN (http://goo.gl/EpCq0Z) | |
; License ......: WTFPL - http://www.wtfpl.net/txt/copying/ | |
; Changelog ....: Sep. 15, 2012 - v0.1 - First revision. | |
; ..............: Jan. 02, 2014 - v0.2 - AHK_L Unicode and x64 version. | |
; ---------------------------------------------------------------------------------------------------------------------- |
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
; LogonDesktop - run scripts on the Winlogon desktop | |
; 26/02/17 - qwerty12 | |
; Modified version of RunAsTask() by SKAN: https://autohotkey.com/boards/viewtopic.php?t=4334 | |
LogonDesktop_AddTask(runNow, runOnStartup) | |
{ | |
local TaskName, XML, TaskSchd, TaskRoot, RunAsTask | |
local TASK_CREATE := 0x2, TASK_LOGON_SERVICE_ACCOUNT := 5, scriptDir := A_ScriptDir | |
try |
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
#NoTrayIcon | |
#Persistent | |
#NoEnv | |
#Include *i %A_ScriptDir%\Lib\FastDefaults.ahk | |
SetKeyDelay, -1, -1 | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
#SingleInstance Off ; This same script is launched multiple times | |
#UseHook Off ; Remove if you need complex hotkeys. WM_HOTKEY suits me fine; I don't want a low-level keyboard/mouse hook installed on WinSta0\Winlogon | |
#Include %A_ScriptDir%\Lib\LogonDesktop.ahk ; Naturally, this one is needed |
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
class BrightnessSetter { | |
; qwerty12 - 27/05/17 | |
; https://github.com/qwerty12/AutoHotkeyScripts/tree/master/LaptopBrightnessSetter | |
static _WM_POWERBROADCAST := 0x218, _osdHwnd := 0, hPowrprofMod := DllCall("LoadLibrary", "Str", "powrprof.dll", "Ptr") | |
__New() { | |
if (BrightnessSetter.IsOnAc(AC)) | |
this._AC := AC | |
if ((this.pwrAcNotifyHandle := DllCall("RegisterPowerSettingNotification", "Ptr", A_ScriptHwnd, "Ptr", BrightnessSetter._GUID_ACDC_POWER_SOURCE(), "UInt", DEVICE_NOTIFY_WINDOW_HANDLE := 0x00000000, "Ptr"))) ; Sadly the callback passed to *PowerSettingRegister*Notification runs on a new threadl | |
OnMessage(this._WM_POWERBROADCAST, ((this.pwrBroadcastFunc := ObjBindMethod(this, "_On_WM_POWERBROADCAST")))) |
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
#include <sdkddkver.h> | |
#include <windows.h> | |
#include <Shellapi.h> | |
#include <Shlobj.h> | |
#include <strsafe.h> | |
#include "extlib\MinHook.h" | |
#define WM_SHELLNOTIFY WM_USER+5 | |
#define WM_TRAYCMD 0x800A |
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
#include "avrf.h" | |
typedef HKL(WINAPI *P_LOADKEYBOARDLAYOUTW)(LPCWSTR, UINT); | |
HKL WINAPI LoadKeyboardLayoutWHook(LPCWSTR, UINT); | |
//typedef BOOL(WINAPI *P_REGISTERHOTKEY)(HWND, INT, UINT, UINT); | |
BOOL WINAPI RegisterHotKeyHook(HWND, INT, UINT, UINT); | |
typedef UINT(WINAPI *P_MAPVIRTUALKEYEXW)(UINT, UINT, HKL); | |
UINT WINAPI MapVirtualKeyExWHook(UINT, UINT, HKL); |
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
##!/bin/sh | |
# Use Ubuntu because they have their heads screwed on straight and patch GRUB to STFU when starting | |
mkdir /mnt/win | |
mount -t ntfs-3g -o windows_filenames /dev/sda1 /mnt/win | |
grub-install --no-floppy --modules=ntfs --root-directory=/mnt/win --boot-directory=/mnt/win/Boot /dev/sda |
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
#!/usr/bin/env python | |
#atheros-fw.py > OS-X-Atheros-3k-Firmware/IOath3kfrmwr/ath3k-1fw.h | |
import sys | |
import binascii | |
with open("AtherosBT.bin", "rb") as f: | |
bytes = f.read() | |
size = len(bytes) | |
sys.stdout.write("\n/* ath3k-1-linux-git.h begin binary data: */\n") |
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
#!/bin/sh | |
# Install my favourite coreutils: GNU's. Sorry, BSD... | |
brew rm coreutils >/dev/null 2>&1 | |
brew update | |
# Add progress bar patch | |
patch -p0 << "EOF" | |
--- /usr/local/Library/Formula/coreutils.rb.orig 2013-09-06 15:23:52.000000000 +0100 | |
+++ /usr/local/Library/Formula/coreutils.rb 2013-09-06 15:33:35.000000000 +0100 |