Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate function definitions from general script settings #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grpawel
Copy link

@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

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

@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.

None yet

4 participants