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

Feature/configuration #45

Merged
merged 15 commits into from
Oct 10, 2020
Merged

Feature/configuration #45

merged 15 commits into from
Oct 10, 2020

Conversation

AdamWagner
Copy link
Owner

@AdamWagner AdamWagner commented Oct 4, 2020

This is a big one!
Much-improved configurability is the primary new feature. There are 3 configuration themes:

Appearance
Customize indicator sizing, coloring, positioning, roundness, animation durations, form factor, etc

Features
Enable/disable fuzzy frame detection, click-to-focus, the hacky workaround for Hammerspoon/hammerspoon#2400, or – coming soon – window titles.
You'll no longer have to put up with bugs in a feature that you don't even use ;-)

Paths
An easier way to specify paths to binaries & scripts without mucking around in the stackline source.


Config validation & live-tweaking

All config values can be edited while stackline is running (this should seem familiar from yabai).

Values can be set using the hs cli tool:

hs -c "stackline.config:set('appearance.radius', 3)"

… or the ipc port:

echo ":appearance.radius:3` | hs -m stackline-config

All config fields support get(key), set(key, val), and getOrSet(key, [val]).
In addition, boolean fields support toggle()

You can get and set nested config fields via a dot-separated path, like this: features.fzyFrameDetection.enabled

Config fields are typed and validated on initialization and when live-set.
stackline will notify you If you can't remember the exact path to a config variable:

image


The default config

c = {}
c.paths = {}
c.appearance = {}
c.features = {}

-- Paths
c.paths.getStackIdxs                  = hs.configdir .. '/stackline/bin/yabai-get-stack-idx'
c.paths.jq                            = '/usr/local/bin/jq'
c.paths.yabai                         = '/usr/local/bin/yabai'

-- Appearance
c.appearance.color                    = { white = 0.90 }
c.appearance.alpha                    = 1
c.appearance.dimmer                   = 2.5                 -- larger numbers increase contrast b/n focused & unfocused state
c.appearance.iconDimmer               = 1.1                 -- custom dimmer for icon
c.appearance.showIcons                = true
c.appearance.size                     = 32
c.appearance.radius                   = 3
c.appearance.padding                  = 4
c.appearance.iconPadding              = 4
c.appearance.pillThinness             = 6

c.appearance.vertSpacing              = 1.2

c.appearance.offset                   = {}
c.appearance.offset.y                 = 2
c.appearance.offset.x                 = 4

c.appearance.shouldFade               = true
c.appearance.fadeDuration             = 0.2

-- Features
c.features.clickToFocus               = true
c.features.hsBugWorkaround            = true

c.features.fzyFrameDetect             = {}
c.features.fzyFrameDetect.enabled     = true
c.features.fzyFrameDetect.fuzzFactor  = 15                  -- window frame dimensions will be rounded to nearest fuzzFactor

c.features.winTitles                  = 'not_implemented'    -- false, true, 'when_switching', 'not_implemented'
c.features.dynamicLuminosity          = 'not_implemented'    -- false, true, 'not_implemented'

… run when value changes. Hook up features.clickT

oFocus conditionals.

Add lookup table linking config values to onChange event functions to run when value changes. Hook up features.clickT
oFocus conditionals.
@AdamWagner AdamWagner merged commit f9680db into master Oct 10, 2020
@AdamWagner AdamWagner deleted the feature/configuration branch October 10, 2020 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant