Giter Club home page Giter Club logo

talon_community'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_community'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 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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

talon_community's Issues

`new terminal tab`

  • launch iterm if it isn't already running
  • create new window if not already on this space
  • create a new tab if that window is already there

Create a global configuration file

two issues here:

  1. I want to set what will be enabled and disabled at a central location
  2. I want to disable some modules but keep the repo in such a state that I can commit my changes immediately without undoing all of my personal tweaks. Perhaps loading configuration through environment variables would be the way to go?

browser bookmarks

webs [github] talon community issues
webs new talon community issue
google <dgndictation>
webs new google doc

URL based browser context

Contexts should be able to match on browser URL, preferably in a unified, cross-browser interface.

std file should be refactored

std.py file is rather hard to understand, and could do with some refactoring. Here are some points/ideas that I am thinking about

  • There is stuff there, like git commands that is crammed into this file. Ideally files should have a single responsibility so the git stuff should be moved into a separate file.
  • the formatters could be refactored to turn lines like this
    "snake": (True, lambda i, word, _: word if i == 0 else "_" + word) into something nicer like this with a easier to understand and use API
    ”snake": Formatter(delimiter=‘_’),
  • the FormatText function is rather hard to understand, especially for beginners, so should be refactored to be easier to understand

For more details about the format text (local) API, there could be other options like prefix=‘“‘, suffix=‘”’] and something to do with upper and lower casing which I haven't thought of a good solution for you

I would actually like to do some of this refactoring, so let me know if this is an idea you would like, and what things above you agree/disagree with

use a more comprehensive git grammar

I wrote a fairly comprehensive git grammar for Aenea, and I've been using it for past months and it has been working great. it is broken up into two parts: the git command definitions which uses the rule builder defined here. The first file could be ported across and the rule builder can be rewritten to use the new Talon API once its out

would be a shame to let that grammar definition with the nice abstraction go to waste!

This is something I would like to port over as well, let me know if you're interested and your thoughts on this idea

youtube mode

  • add youtube specific commands as defined on the keyboard shortcuts page while watching a video on youtube

`new {name} terminal tab`

shortcut for creating new terminal tab and running a predefined command setting up the context. For example:

{
    'titan': 'mosh titan',
    'coach': 'cd ~/src/coach && source venv/bin/activate',
}

browser plug-in

define simply: url regex, jquery selector, command name
send(jquery selector)

`trail` often misses words

if the line contains: hello world hello world end of the cursor is at the end, trail world highlights the first world and not the last one.

numbers mixed with dot don't work well

one nine two dot one six eight dot one dot one almost never gets actually recognized. if it does, it gets recognized by the dot formatter which inserts underscores.

filenames

bin bash -> /bin/bash

a few options:

  • auto populated from local file system
  • auto populated from local ~/.bash_history
  • hardcoded

add vocab file?

What you think about adding some sort of vocab file? There are things like this in std.py,

    "word queue": "queue",
    "word eye": "eye",
    "word bson": "bson",
    "word iter": "iter",
    "word cmd": "cmd",
    "word dup": "dup",
    "word (dickt | dictionary)": "dict",
    "word shell": "shell",
    "word talon": "talon",

It also looks like there are random words defined in utils.py

In my personal set up, I sort of have a similar thing (https://github.com/dylan-chong/examples/blob/master/programming.py#L35), although my preferred way is to just add the word to the Dragon vocabulary so you can train the word with Dragon to improve its accuracy. This doesn't work when there are Dragon commands/words that are very similar, such as trying to get Dragon to recognise Python instead of -.

Sentence the examples repository also has a way of dealing with vocabulary https://github.com/talonvoice/examples/blob/master/vocab.py

add pep8 + ci checks

This is a minor suggestion, but it would be nice if our code followed some kind of linting standard, although it is more of a prettiness thing rather than a practical thing.

quickly create new vocabulary

  • new vocabulary opens up a text box where a word can be typed in.
  • enter/submit can be used to submit the new vocabulary word.
  • the word is added to a json file containing vocabulary words

this might be best added after the new api is ready

Duplicate keys in navigation file

Just from a quick look, there are duplicate keys. pep8 says which ones

/Users/Dylan/.talon/user_talon_community/misc/navigation.py:3:1: F811 redefinition of unused 'Context' from line 1
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:3:1: F811 redefinition of unused 'Key' from line 1
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:12:5: F601 dictionary key 'swick' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:14:5: F601 dictionary key '(next window | gibby)' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:15:5: F601 dictionary key '(last window | shibby)' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:23:5: F601 dictionary key 'kite' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:26:5: F601 dictionary key 'slurp' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:29:5: F601 dictionary key 'tarp' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:30:5: F601 dictionary key 'tarsh' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:36:5: F601 dictionary key 'ricky' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:37:5: F601 dictionary key 'lefty' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:39:5: F601 dictionary key 'chris' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:40:5: F601 dictionary key 'jeep' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:47:5: F601 dictionary key 'shreepway' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:48:5: F601 dictionary key 'shroomway' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:49:5: F601 dictionary key 'shreep' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:50:5: F601 dictionary key 'shroom' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:57:5: F601 dictionary key 'swick' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:63:5: F601 dictionary key '(next window | gibby)' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:64:5: F601 dictionary key '(last window | shibby)' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:76:5: F601 dictionary key 'kite' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:79:5: F601 dictionary key 'slurp' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:83:5: F601 dictionary key 'tarp' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:84:5: F601 dictionary key 'tarsh' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:88:5: F601 dictionary key 'ricky' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:90:5: F601 dictionary key 'lefty' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:91:5: F601 dictionary key 'jeep' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:93:5: F601 dictionary key 'chris' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:107:5: F601 dictionary key 'shreepway' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:108:5: F601 dictionary key 'shroomway' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:109:5: F601 dictionary key 'shreep' repeated with different values
/Users/Dylan/.talon/user_talon_community/misc/navigation.py:110:5: F601 dictionary key 'shroom' repeated with different values

ricky is also duplicated in std

atom: a faster method for executing custom commands

right now, it is easiest in many cases to open the command pallet and type the name of a command followed by an enter. This is slow and sometimes doesn't work. It would be nice if there was a better method for this.

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.