windows-desktop-switcher icon indicating copy to clipboard operation
windows-desktop-switcher copied to clipboard

Separate function definitions from general script settings

Open grpawel opened this issue 5 years ago • 2 comments

I would like to include functions from this script in my other scripts, but I do not want to include user_config file.

grpawel avatar Nov 24 '19 23:11 grpawel

That would be really nice, as it would allow the repository to be used as a submodule and people would just have their own file with hotkeys. Currently, as desktop_switcher.ahk includes user_config.ahk, it's not possible to load the desktop_switcher.ahk with custom config without changing the user_config.ahk contents.

After the change, it would look like this:

+- windows-desktop-switcher  (submodule)
|  |
|  +- functions.ahk
|  +- desktop-switcher.ahk   
|  +- user_config.ahk
|
+- my-desktop-switcher.ahk   (loads my-user-config.ahk and functions.ahk)
+- my-user-config.ahk        (contains my hotkeys)

ftvkyo avatar Jan 14 '21 11:01 ftvkyo

@grpawel VD.ahk is a class you #Include it had no #Include inside, no .dll dependencies

example usage:

#Include path\to\VD.ahk

VD.createUntil(3) ;3 virtual desktops

VD.PinWindow("ahk_exe explorer.exe")
Numpad0::VD.TogglePinWindow("A") ;active window

modded example from : https://github.com/pmb6tz/windows-desktop-switcher/issues/73#issuecomment-1006921377

FuPeiJiang avatar Jan 06 '22 20:01 FuPeiJiang