untoldwind / alfred2-layout

Alfred 2 Layout workflow
http://untoldwind.github.io/projects/alfred2-layout.html
199 stars 16 forks source link

How can I remove 'toggle full screen' as one of the options in the script filter? #17

Open nikitavoloboev opened 7 years ago

nikitavoloboev commented 7 years ago

I am talking about this option :

2017-02-12 at 01 45

Can't quite figure it out from the code. Thank you.

untoldwind commented 7 years ago

All options are configured in this file: https://github.com/untoldwind/alfred2-layout/blob/master/src/default_layouts.yaml

The full-screen toggle is actually the first line there. Just remove that line and it won't appear in Alfred any more

nikitavoloboev commented 7 years ago

I just did that. It is still there in the options though.

untoldwind commented 7 years ago

Just realized that there might be a "bug".

The options are rendered by the "layout_select.pl" script. Which first reads:

~/Library/Application Support/Alfred 2/Workflow Data/de.leanovate.alfred.layout/layouts.yaml

(which is hardcoded atm and should be fixed) and only if that doesn't exists:

~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.F213A19A-E45D-4010-82BF-4FEFB3D33AE5/default_layout.yaml

resp.

~/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.F213A19A-E45D-4010-82BF-4FEFB3D33AE5/default_layout.yaml

untoldwind commented 7 years ago

The current version: https://github.com/untoldwind/alfred2-layout/raw/master/Layout.alfredworkflow

Now supports an environment variable LAYOUTS_FILE (this can be set in the Preference via "Configure workflow variables") The workflow will first try to load the options from there and then fallback to the defaults

nikitavoloboev commented 7 years ago

Hey @untoldwind

If I understood correctly, I just need to delete this line here :

2017-02-18 at 15 03

However I removed it and I still have it shown in Alfred :

2017-02-18 at 15 03

untoldwind commented 7 years ago

I fear I need some more information why this is not working for you as indended.

If you are using Alfred 3 you can toggle a debug log on the workflow page: grafik

When using the workflow with this window open the current version (https://github.com/untoldwind/alfred2-layout/raw/master/Layout.alfredworkflow) should print out what file is read. E.g. when moving a window you should see an output like this:

[2017-02-19 22:05:43][STDERR: input.scriptfilter] Reading layout options from: /Users/untoldwind/Library/Application Support/Alfred 3/Workflow Data/de.leanovate.alfred.layout/layouts.yaml

or

[2017-02-19 22:13:12][STDERR: input.scriptfilter] Using default layout options

If it's the latter the default_layout.yaml is read.

Also: You can test the script inside a regular terminal like this:

cd ~/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.F213A19A-E45D-4010-82BF-4FEFB3D33AE5
perl layout_select.pl

This will produce a lot of xml which is actually read by Alfred to display the available options.