talonhub / community

Voice command set for Talon, community-supported.
MIT License
601 stars 764 forks source link

Revisit use of modes #603

Open pokey opened 2 years ago

pokey commented 2 years ago

The problem

We have had issues in the past where commands are unexpectedly active in sleep mode, eg #561. The problem is that if you put mode: in a .talon file header, you disable the implicit mode: command, which in turn allows you to enable the file during sleep accidentally.

A quick search reveals that we still have some commands active in sleep mode for this reason. See eg go.talon, which results in go commands being active if talon is sleeping while you have a go file open.

The solution

We may want to prefer using tags in many of the places that we use modes today. For example, the following modes are good candidates to become tags:

On the other hand, things like "game" or "solo" would be examples of good, general modes, because a mode should ideally be very transformative of the command set and make sense when enabled by itself.

knausj85 commented 2 years ago

related: https://github.com/talonvoice/talon/issues/239

AndreasArvidsson commented 2 years ago

@pokey @knausj85 I've created a solution where we are back to a single line header for each language. This time using a tag.

tag: user.typescript
-

https://github.com/AndreasArvidsson/andreas-talon/blob/master/langs/javascript/typescript.talon https://github.com/AndreasArvidsson/andreas-talon/blob/master/misc/language_mode/language_mode.py

AndreasArvidsson commented 2 years ago

I have now made a pr to update the programming languages to use tags instead

776