Sublime Forum

How to disable packages in the settings file under a certain OS

#1

There is a positioning problem for some input methods under Windows so I install IMESupport to deal with it. The problem is this package is only needed and working under Windows but not under Linux/Mac. Thus, each time when I sync my settings between Windows and Linux, Package Control would prompt a window to ask me uninstall IMESupport.

Is it possible to make a package only activate under Windows but not under Linux?

0 Likes

#2

Ideally, you would use a different packages control setting file for each platform. That is what I do. I have a plugin that backs up to and restores from platform specific folders in my user folder (only files I have tagged as platform specific).

0 Likes

#3

Do you mean creating Package Control (Windows).sublime-settings and Package Control (Linux).sublime-settings manually?

0 Likes

#4

No, I don’t think that actually works, but as I said I wrote a plugin that handles everything for me. What it does is it allows me to specify certain files that when seen are OS specific. Those files, when the backup command is ran, will be copied into an OS specific folder. So for each platform, that specified file (or files) will be backed up to an OS specific folder, and when the restore command is run, it will be copied from that folder back to the root. Since I store my User folder in a bitbucket repo, I exclude the root copy, so I only store the Os specific backups.

So in this case, assuming I have a windows computer and a linux computer, my repo excludes User/Package Control.sublime-settings, but has a copy of User/OsSpecificUserFiles/windows/Package Control.sublime-settings and User/OsSpecificUserFiles/linux/Package Control.sublime-settings. So when I setup a new computer with this repo, I checkout the repo as User and run my restore command and the appropriate Package Control.sublime-settings file gets copied to the root of User. When I backup and commit, the root gets copied to its appropriate “Os Specific” location. The repo ignores the root and does not commit or track that file.

Hopefully that isn’t too confusing. The plugin (with example settings file) I use is here: https://gist.github.com/facelessuser/3797593. I would point you at my example User repo, but I recently moved it to a private repo.

1 Like

#5

Thanks for a detailed reply :slightly_smiling:

0 Likes