Coder Social home page Coder Social logo

talon-configs's Introduction

CircleCI

talon_community

A single source of application-specific scripts

Clone a fork of this repository in a directory inside of your user directory, such as community.

Installation

If you wish to develop on these scripts, run in the project root:

python3 setup.py install

To install linters and formatter

General Guidelines

  • The apps/ folder is "single script per app, named by the app", nothing goes in the apps folder unless it's a script supporting exactly one app with a context properly scoped to the app (unscoped scripts are fine for now for apps like spectacle, though probably note down the app's bundle identifier in the script so we can detect if it's running later)
  • Context-specific languages (programming, spoken languages, specific config file syntax, that sort of thing) goes in lang/, generic text insertion goes in text/, anything else goes in misc/
  • Try to not duplicate existing commands/functionality. There should only be one way to do something and typically only one way to say something (symbols/operators are a notable exception).
  • If you're renaming/refactoring: the "one command" for an action should also be named to be clear about what it's doing, and err on the side of slightly verbose, ideally prefixed with a mental context. This is because it's easier for users to bolt shortcuts onto an expressive grammar than learn a non-composable compact grammar like voicecode. An example of this is tab close is more expressive than totch and is prefixed with the tab scope. voicecode's grammar can be bolted on later / as a separate set of scripts. "voicecode compatibility" is something of an opposite goal to coming up with a consistent grammar.
  • use relative imports
  • spaces for indentation
  • follow ctx = Context(), ctx.keymap({}) instead of using a separate dict unless you have a good reason

Context activation

When adding new commands, try to scope their context as narrowly as possible.

The implementation of a flexible way to determine context activtion is a work in progress. For the time being:

  • For commands that apply to a number of bundles, use the bundle groups defined in bundle_groups.py
  • For commands that apply to specific file types, use the is_filetype helper in utils.py. This helper relies on the file type appearing in the window title. If you wish to use file type specific commands in an application that does not display the file type in the window title, either remove that application's bundle id from the file type sensitive bundles group, or add something that will match the window title to the list of file types for that context.

Gotchas

  • Some users may need to change the , mapping from "comma": "," to ",": ",".
  • Context names cannot have spaces
  • If your output is missing the odd random letter, try patching Talon's default delay
  • Refactoring is in progress and currently some commands in global contexts clash with others

Script-specific notes

  • speech_toggle.py: Note the 'dictation mode', which behaves similarly to dragon mode, but keeps Talon in control. It is a workaround for the inability of Dragon in 'dragon mode' to maintain focus on the front most application in some situations.
  • keeper.py: The phrase command will only preserve literally the first part of the utterance. Anything that might be a command after the first word will be interpreted as such. keeper tries to preserve everything.

Rules of precedence

The following have been empirically determined, could change at any point, and are not to be relied on:

  • Given two definitions for "foo" in the same keymap, the second will be used.
  • Given definitions for, 1. "foo " 2. "foo" and 3. "bar", saying "foo bar" will trigger (2) then (3) and saying "foo baz" will trigger (1).

talon-configs's People

Contributors

2shea avatar christianhultin avatar drewfrd avatar dwiel avatar dylan-chong avatar g-sam avatar house9 avatar jcooper-korg avatar jenmei avatar kolemannix avatar lexjacobs avatar lunixbochs avatar mblsha avatar nhyne avatar nodonnel avatar nsaphra avatar paberline avatar rimashmohomed avatar seananderson avatar seanrhaney avatar testplan avatar thatcherervin avatar trogdoro avatar wizonesolutions avatar zach-nervana avatar zfudge avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.