Skip to content

Feature/configuration - #45

Merged
AdamWagner merged 15 commits into
masterfrom
feature/configuration
Oct 10, 2020
Merged

AdamWagner merged 15 commits into
masterfrom
feature/configuration

Conversation

@AdamWagner

@AdamWagner AdamWagner commented Oct 4, 2020 •

Copy link
Copy Markdown
Owner

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'

@AdamWagner
AdamWagner force-pushed the feature/configuration branch from b55e85d to 51936f9 Compare October 4, 2020 17:56
… 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 force-pushed the feature/configuration branch 2 times, most recently from dc13dbd to 2e11d6d Compare October 4, 2020 19:53
@AdamWagner
AdamWagner force-pushed the feature/configuration branch from 83b240b to 2138182 Compare October 10, 2020 17:21
@AdamWagner
AdamWagner force-pushed the feature/configuration branch from 2b03bb3 to 0bfc763 Compare October 10, 2020 17:32
@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.

1 participant