Skip to content

Separate function definitions from general script settings#47

Open
grpawel wants to merge 1 commit into
pmb6tz:masterfrom
grpawel:master
Open

Separate function definitions from general script settings#47
grpawel wants to merge 1 commit into
pmb6tz:masterfrom
grpawel:master

Conversation

@grpawel
Copy link
Copy Markdown

@grpawel grpawel commented Nov 24, 2019

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

@ftvkyo
Copy link
Copy Markdown

ftvkyo commented Jan 14, 2021

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)

@FuPeiJiang
Copy link
Copy Markdown

@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 : #73 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants