diff --git a/APPEARANCE.md b/APPEARANCE.md new file mode 100644 index 0000000..b173c77 --- /dev/null +++ b/APPEARANCE.md @@ -0,0 +1,41 @@ +# Appearance and theming + +The HUD's appearance is almost fully changeable without having to dive into nitty gritty code. Depending on the widget, a number of values can be tweaked like colours, border thickness and paddings, and so on. The images are also neatly kept inside of a folder for you to change as you wish. + +All of these things are bundled in a 'theme'. The light theme is the one you see when you start up. You can find the themes inside of the themes folder. + +By default, there are two available themes - Light and dark, for a light and dark mode. These you can switch using `head up theme dark` and `head up theme light`. + +## Customizing appearance + +In order to change a theme, you only really need two things. +- A program that can open a CSV file like Excel +- A way to generate HEX color codes ( There is plenty of online tools for that, like the [duckduckgo colorpicker](https://duckduckgo.com/?q=color+picker&t=h_&ia=answer) where you can simply pick your color and copy the text next to the # ) + +Before tweaking themes, it is recommended to turn the HUD in development mode by saying `head up development start`, that way when you save the file, it will automatically update the widgets accordingly. When you are done tweaking the values, saying `head updevelopment stop` will turn the HUD back into its regular +non-autoreloading mode. + +Inside the themes.csv file inside themes/light you will find a list of values that you can change, for instance the command_mode_colour which is currently set to FFFFFF. If you change this to a different value, like 0000AA which is the color blue, it will display a blue colour on your status bar. + +You will notice that inside of the light theme folder, there are no images to be found. That is because all the themes take the images out from a single base theme inside of _base_theme. You can change the images around here and they will be used for all the available themes. As long as you use the right file names, the images should update nicely. + +If you wish to change the images around for the light theme only, you can copy the images folder inside of the _base_theme folder over to the light folder, and change the images around. The images are only reloaded whenever you change a theme, or whenever you change a file when the HUD is in the development mode. + +## Creating your own theme + +You can create your own theme by simply copying an existing theme over. If you place the copied theme inside of the themes folder and change its name while in development mode, it will be automatically registered. Lets say you have created the folder 'blue', you can then change to that theme by saying `head up theme blue`. You can tweak it as you wish up like described in the Customizing appearance part above. + +You do not necessarily need to place your theme inside of the themes folder, you can also place it somewhere else and register it manually using the action `user.hud_register_theme`. An example is shown below. + +```python +from talon import app, actions + +def register_custom_theme(): + actions.user.hud_register_theme("blue", "PATH_TO_BLUE_THEME_HERE") + +app.register("ready", register_custom_theme) +``` + +## Tweakable values for themes.csv: + +TODO - Explain every value inside themes.csv \ No newline at end of file diff --git a/CUSTOMIZATION.md b/CUSTOMIZATION.md new file mode 100644 index 0000000..9dd2ef9 --- /dev/null +++ b/CUSTOMIZATION.md @@ -0,0 +1,266 @@ +# Talon HUD Content + +The content inside of the HUD is meant to be mostly customizable and creatable by you. Stuff like available modes, programming languages and can be tweaked to match your specific needs. +Creating text content is straight forward and can be done in .talon files for the simple use cases, and in python for the more advanced usecases. +There is also other content like status bar icons, logs and screen regions, that have special requirements. + +For more advanced cases, there is also "sticky" content, which is content that can stick around in between restarts. An example of this is the mode or microphone icon on the status bar, but things like the scope debugging are sticky content as well. On the bottom of the page is an explanation on how to make your own sticky content. + +## Content customization + +### Customizing mode tracking + +You can customize three things about the mode tracking +1. The icons connected to the modes. These are stored in the themes folder as _icon.png and can be changed there. +2. The mode that should be displayed on the status bar. +3. The toggle functionality of the mode tracking button. + +Below is an example of the last two being customized, where only the command and sleep icon are displayed, instead of having the dictation icon displayed as well. + +```python +from talon import Context, actions, scope + +ctx = Context() +ctx.matches = """ +tag: user.talon_hud_available +""" + +@ctx.action_class("user") +class Actions: + + def hud_determine_mode() -> str: + """Determine the current mode used for the status bar icons and the widget states""" + active_modes = scope.get("mode") + available_modes = ["command", "sleep"] + + current_mode = "command" + for available_mode in available_modes: + if available_mode in active_modes: + current_mode = available_mode + break + + return current_mode + + def hud_toggle_mode(): + """Toggle the current mode to a new mode""" + current_mode = actions.user.hud_determine_mode() + if current_mode in ["command"]: + actions.speech.disable() + elif current_mode == "sleep": + actions.speech.enable() +``` + +### Customizing language tracking + +You can customize two things about the language tracking +1. The language icons shown in the status bar - These are images with the language names inside of the themes images folder. +2. The action that is executed when you click on the language icon + +By default, there is no action tied to the language icon, but you can add one yourself by tweaking the example below. + +```python +from talon import Context, actions, scope + +ctx = Context() +ctx.matches = """ +tag: user.talon_hud_available +""" + +@ctx.action_class("user") +class Actions: + + def hud_toggle_language(current_language: str = "en_US"): + """Toggles the current language to another language""" + actions.user.hud_add_log("warning", "Clicked the language " + current_language + " icon!") +``` + +### Customizing programming languages + +In the programming language visualisation, you can change a couple of things: + +1. The available programming languages - These are kept in preferences/programming_languages.csv. +- The first column is the programming language. +- The second column is the extension, this will be shown as text if no icon is available. +- The icon file name of the programming language. +2. The programming language icons - These are kept in the images folder inside themes. +3. The language detection code +4. The toggle functionality of the icon + +An example of the last two where only the tags and not the modes are referenced for the language are kept down below. +Also, in this example, clicking on the programming language makes the language show up in the event log with a different colour. + +```python +from talon import Context, actions, scope + +ctx = Context() +ctx.matches = """ +tag: user.talon_hud_available +""" + +@ctx.action_class("user") +class Actions: + def hud_can_toggle_programming_language() -> bool: + """Check if we should be able to toggle the programming language from the status bar""" + return True + + def hud_toggle_programming_language(): + """Toggle the programming language manually in the status bar""" + language = actions.user.hud_get_programming_language() + type = "success" if language == "python" else "error" + actions.user.hud_add_log(type, "The current language is " + actions.user.hud_get_programming_language()) + + def hud_get_programming_language() -> str: + """Get the programming language to be displayed in the status bar - By default tries to mimic knausj""" + lang = actions.code.language() + if not lang: + languages = actions.user.hud_get_available_languages() + active_tags = scope.get("tag") + if (active_tags is not None): + for index, active_tag in enumerate(active_tags): + if (active_tag.replace("user.", "") in languages.keys()): + return active_tag.replace("user.", "") + return "" + else: + return lang if lang else "" +``` + +## Creating text content + +Publishing to a single text panel is easy and can be done either through a .talon file, or in a python file +An example where a simple hello world text is published is placed below. `hello world talon` is purely inside a talon file, `hello world python` is a connection between the .talon file and the python file. + +```talon +hello world talon: user.hud_publish_content("Hello world example", "example", "Hello world") +hello world python: user.hud_example_text() +``` + +```python +from talon import Module, actions + +mod = Module() +@mod.action_class +class Actions: + + def hud_example_text(): + """This is an example action for HUD documentation purposes""" + actions.user.hud_publish_content("Hello world example", "example", "Hello world") +``` + +You can also place rich text inside of the content. + +These will apply styling to the text within them. Rich text needs to be opened with a style marker and closed with a closing marker. +Bold and italic markers can be active at the same time. For the colours, only the latest will count. + +In order to create text like this: +I want to **try out** rich text! + +You have to type this: +``` +'I want to <*try out/> rich text! +``` + +The following styling markers are available: +- <* : Bold text +- : Closing marking - ends the latest style applied + +When writing rich text containing voice commands, make sure to emphasise the voice commands with one of these markers so they stand out from the rest of the text. +This makes it easier for the user to quickly pick out the voice commands from the text you have written. +There isn't a firm styling for voice commands yet, so for now just apply a bold marker at the minimum until we maybe decide on one. + +### Publishing documentation + +In order to make your content more discoverable for other users, you can place it in the documentation portion of the Talon HUD. +For this, you need a documentation loader file, and a set of files to load in. An example of a documentation loader file that loads in a file inside of a folder as documentation can be seen below. + +```python +from talon import scope, app, actions +import os + +# Get the absolute path to the documentation directory for your package +documentation_dir = str(os.path.dirname(os.path.abspath(__file__))) + +def talon_hud_ready(): + # Check if Talon HUD is available to the user + MINIMUM_TALON_HUD_RELEASE = 6 + if "user.talon_hud_available" in scope.get("tag") and \ + scope.get("user.talon_hud_version") != None and scope.get("user.talon_hud_version") >= MINIMUM_TALON_HUD_RELEASE: + actions.user.hud_add_documentation("Example text", + "gives a short description of your available documentation.", + documentation_dir + "/example.txt") + +app.register("ready", talon_hud_ready) +``` + +When you are drafting documentation, it is advised to turn on the development mode of the Talon HUD, this will make the content reload as you update the documentation file. +Turn it on using `head up development start`, and when you are done again, turn it off with `head up development stop`. + +### Publishing walkthroughs + +Walkthroughs are a set by step guide through a process, that you can create yourself as well. Just like publishing documentation above, you need to set up a loader that can load in the walkthrough file into the HUD. +An example of a walkthrough loader that loads in a single .json file that expands upon the documentation loader above is given below. + +```python +... + MINIMUM_TALON_HUD_RELEASE = 6 + if "user.talon_hud_available" in scope.get("tag") and \ + scope.get("user.talon_hud_version") != None and scope.get("user.talon_hud_version") >= MINIMUM_TALON_HUD_RELEASE: + # Media usage + actions.user.hud_add_walkthrough("Example walkthrough", + documentation_dir + "/example walkthrough.json") + +... +``` + +A walkthrough file can either be a .json file, which allows you to add contextual hints as well, or a markdown file, which does not have any context hints. + +The .JSON file format is shown below, where the text 'Please turn on command mode' is shown if you do not have command mode turned on. The walkthrough also has a single voice command, `head up hide status bar`, inside of it. + +```json +[ + { + "content": "This is an example walkthrough step! Say to continue!", + "modes": ["command"], + "tags": [], + "context_hint": "Please turn on command mode" + } +] +``` + +When you are designing walkthroughs, it is advised to turn on the development mode of the Talon HUD, this will make the content reload as you update the walkthrough file. +Turn it on using `head up development start`, and when you are done again, turn it off with `head up development stop`. + +For more advanced usecases you can programmatically add a walkthrough as well with the actions `user.hud_create_walkthrough_step` and `user.hud_create_walkthrough` available in content/walkthrough.py. + +### Markdown(.MD) support + +Both for documentation and for walkthroughs, a subset of the markdown file format is supported. + +The current support allows: +- Bolding +- Italizing +- Quoting with backticks + +Notable things that aren't supported are: +- Headings +- Horizontal lines +- Links +- Images +- Advanced markdown ad ons like tables, flowcharts + +The markdown file format is automatically detected when a file with .md is loaded in. + +In walkthroughs, every new line starts a new walkthrough step. + +## Non-text content + +TODO - Give an explanation of every content type to publish - For now just look at actions inside content/state.py until I flesh this out again. + +## Sticky content + +TODO - Give a thorough explanation of the poller and topic system \ No newline at end of file diff --git a/README20.md b/README20.md new file mode 100644 index 0000000..37f7244 --- /dev/null +++ b/README20.md @@ -0,0 +1,233 @@ +Unofficial Talon Head Up Display +===== + +![Overview image](/docs/intro.png) + +The HUD is a user interface that helps improve your workflow. Inspired by gaming HUDs, it is meant to show just the right amount of info to your screen without getting in the way of your actual work. It is resizable, scalable and placable in whatever combination you can come up with, so only the screen space that you allow will be used, just as you left it. + +It combines voice commands with clickable buttons, allowing for seemless transitions between using your regular old controls and your voice command flow. + +On top of that, the HUD remembers where you left off. It keeps the widgets in the place you have left them for the next time you start up, and when you add or remove monitors, it will remember where you kept the widgets in those instances. +This makes the HUD excellent for switching between a single laptop screen, and connecting a monitor in the office or at home. + +By default, the HUD comes in a light and a dark mode, but you can create other themes yourself as well! + +## Table of contents +1. [Installation and fixing](#installation) +2. [Important voice commands](#important-voice-commands) +3. [Available content](#available-content) + 1. [Talon mode tracking](#talon-mode-tracking) + 2. [Speech history](#speech-history) + 3. [Microphone muting and management](#microphone-muting-management) + 4. [Language tracking](#language-tracking) + 5. [Programming language tracking](#programming-language-tracking) + 6. [Focus tracking](#focus-tracking) + 7. [Documentation](#documentation) + 8. [Walkthroughs](#walkthroughs) + 9. [Debugging](#debugging) +3. [Customizing the HUD](#customizing-the-hud) + 1. [Hiding and showing widgets](#hiding-and-showing-widgets) + 2. [Repositioning widgets](#repositioning-widgets) + 3. [Changing the size of text and widgets](#changing-the-size-of-text-and-widgets) + 4. [Changing alignment of widgets](#changing-alignment-of-widgets) + 5. [Animations](#animations) + 6. [List of available widgets](#list-of-available-widgets) +4. [Advanced usage](#advanced-usage) + 1. [Changing appearance](#changing-appearance) + 2. [Preferences folder](#preferences-folder) + 3. [Talon HUD environments](#talon-hud-environments) + 4. [Documentation and walkthrough creation](#documentation-and-walkthrough-creation) + 5. [Other content creation](#other-content-creation) + 6. [Internal workings ( TODO )](#internal-workings) +5. [Miscellaneous](#miscellaneous) + 1. [Roadmap](#roadmap) + 2. [Development philosophy and guidelines](#development-philosophy-and-guidelines) + 3. [Acknowledgements](#acknowledgements) + +## Installation + +To use the Talon HUD, you need to have Talon Voice installed on your computer. +On top of that, it is best to set it up next to a version of [knausj_talon](https://github.com/knausj85/knausj_talon/) as it gives you a lot of other voice commands to work with. +The only thing you need to do is click the 'Code' button on top of this page, download the zip and extract it inside of your Talon user folder somewhere. +After that, it should start up right away if you have Talon set up, or on your next Talon start up. A walkthrough will lead you through the next steps. + +If for some reason the HUD seems broken, you can try and see if clearing out the preferences folder helps, as that is where all your personal settings are stored. + +## Important voice commands + +`head up show` turns on the head up display. +`head up hide` hides the head up display. +`toolkit options` shows all the available content connected to the HUD toolkit, the options on the screen can be read out for navigation. + +All voice commands are available in the .talon files inside of the HUD, while some are also generated based on the titles of the widgets themselves. + +## Available content + +### Talon Mode tracking ( turned on by default ) + +Talon comes in a variety of modes, like the command mode in which you utter commands, or the sleep mode where no commands are used but the wake word. To keep track of what mode you are currently in, the Talon HUD offers a status bar icon that can be clicked. +This is added by default, and when clicked, turns Talon either in sleep mode, or from sleep mode back to your previous mode, be it command or dictation mode. +Removing the mode icon is possible as well to keep a more minimal look, by saying `status bar remove mode indicator` or by right clicking the status bar and clicking 'Remove mode indicator'. +The status bar will always show whether you are in sleep mode or not at a glance, regardless of when you have mode icon added or not, by changing the appearance of the status bar itself. + +You can change the mode detection, toggle and available modes yourself as well, if your set up requires a more personal touch. To see how, read the link below. + +(TODO!)[Customizing mode tracking] + +### Speech history ( turned on by default ) + +Taking inspiration from FPS games, the event log widget allows you to read back voice commands as you make them, as well as clearing themselves up after a few seconds to give you back that screen space. +Different options to show commands are available. You can keep the commands visible indefinitely, or temporarily freeze them to discuss them, perfect for pairing sessions. +All of these options can be shown and toggled by saying `event log options`. + +If you need are more in-depth view of the commands said, you can say `toolkit speech` or navigate from the status bar with Content toolkit -> Debugging -> Speech to find a full overview of the commands said, as well as the used engine and microphone. + +### Microphone management + +In some scenario's like conference calls, it is handy to have a way to instantly turn off the microphones input to Talon. This toggle can be placed on the status bar by saying `status bar add microphone` or right clicking on the status bar and selecting 'Add microphone'. +Switching the microphone off this way prevents accidental wake messages or commands from triggering functionality while you are talking to your friends or colleges. + +On top of that, you can also switch microphones on the fly by saying `toolkit microphones`, or right clicking the status bar and following Content toolkit -> Microphones. The microphone selected here will be used as a favorite setting, so if you toggle the microphone on and off, it will remember the selected microphone here and switch back to that microphone. +This comes in handy when you have multiple microphone set ups, like a laptop microphone and an on desk microphone. + +### Language tracking + +For the multi-lingual folks out there, switching between different languages for dictation is a necessity to keep your workflow working with voice. For that purpose, you can add a language icon indicating your language on the status bar by saying `status bar add language` or right clicking the status bar to the option Add language. + +(TODO!)[Customizing languages] + +### Programming language tracking + +A lot of programmers inhabit the Talon Voice community, and with them come many different programming languages. With those programming languages come different commands, and usually these are kept track of by the file extension available in a program, or by manually forcing a certain language to be used. +To make sure you know what programming language context you are in, you can add a language icon to your status bar by saying `status bar add code language` or right clicking the status bar and clicking 'Add code language'. +You can add and remove programming languages icons yourself, by following the instructions below. + +(TODO!)[Customizing programming languages] + +### Focus tracking + +When returning back to your computer after a while, it can be hard to see what window Talon has focused for voice commands. This only gets harder if you have multiple monitors. To alleviate this problem, you can add a focus indicator to your status bar by saying `status bar add focus indicator` or right clicking the status bar and selecting 'Add focus indicator'. +This will present an orange-red box on the top center of the currently focused window, to remind you what direction you're talking to. + +### Documentation + +Inside the HUD, there is a place where you can read out available documentation for certain voice commands, like a refresher of sorts. It is available if you say `toolkit documentation` or by navigating from right click menu in the status bar with Content toolkit -> documentation, there you will find a bunch of text that is published to the HUD. Simply say one of the titles on the screen to navigate to that content. +You can also publish your own files to the HUD documentation, to keep as a reminder, or to enhance your own packages. + +When you need to switch between pages, you can say ` next` or ` back` to go forward or backward in the current content. + +You can read about creating your own content here (TODO!)[Creating your own documentation] + +### Walkthroughs + +While having a good overview of all voice commands can be good, it is often overwhelming. To make the learning process a little less steep, the HUD offers some walkthroughs which guide you through voice commands one by one in a designed fashion, giving explanations about the voice commands as you go. You can find the walkthroughs by navigating through the status bar right click menu Content toolkit -> Walkthroughs or by saying `toolkit walkthroughs` instead. +You can also create walkthroughs for your own work flow, or for your own packages as well. You can read about how to create walkthroughs yourself in the (TODO!)[Create walkthrough section] + +### Debugging + +When you are working with, or working on, your Talon scripts, it is often hard to see what is going on in the background. In order to give a slight peek inside of the current state of your Talon set up, there is a debugging menu that can be reached with the voice command `toolkit debugging`. + +- The scope debugging option allows you to see the current app and title, the current tags and the current modes, and updates the content as they change. +- The speech debugging option allows you to see all recognized commands and their used time, with their used engine and microphone, so you can track down why recognition might have changed. +- The list debugging option gives you a look inside a single list as it changes. + +## Customizing the HUD + +While the base set up for the HUD is meant to be a good starting point, you will most likely want to tweak everything to fit your own unique needs. Below is a list of all the available changes you can make to widgets. For the explanations below, the part is used to reference to the widget name that you want to change, in the last paragraph of this chapter is a list of available widgets and their names. + +Some widgets can have alternative names too, which are the titles shown on top of them. In the case of a text box being titled 'Toolkit Options', you can say `toolkit options hide` to hide it. + +### Hiding and showing widgets + +You can hide specific widgets by saying `head up hide `. Some content, like text that gets published, might still make that widget show up again, but you can also manually show the widget by saying `head up show `. +You can also use the widget shorthand, which is ` hide` and ` show`. + +### Repositioning widgets + +Changing widgets' position can be done either by dragging them around the screen, or by saying `head up drag `, confirming the position with `head up drop` or canceling it with `head up cancel`. +If you want to change multiple widgets at the same time, you can say `head up drag `, and they will be moved simultaneously. + +For some specific widgets like the cursor tracker where the position depends on the mouse cursor itself, saying `head up drag cursor tracker` will keep the widget in place, so you can change the position relative to the mouse cursor itself. + +### Changing the size of text and widgets + +Changing the font size of a widget to make the text more readable is done using the command `head up text scale ` and by dragging the mouse around. You can confirm the changes by saying `head up confirm` or cancel the changes by saying `head up cancel`. + +Widgets have two kinds of sizes, their minimal size, and their maximum growable size. + +You can also change the minimal size that certain widgets take on by saying `head up resize `, confirming it with `head up confirm` or canceling it with `head up cancel`. Note that changing the minimal size also resets the maximum growable size. And for some widgets, changing the size can also change the alignment of the content itself, as it is calculated using the two top points of the minimum and maximum growable size. + +To change the maximum growable size of a widget, hold your mouse in the direction from the widget where you want it to grow, and say `head up expand `, with the same confirmation and cancelation commands as the other commands. + +Some widgets also have a more collapsed, minimized state, which you can activate by saying `head up minimize ` or ` minimize`. You can undo the minimization by saying `head up mazimize ` or ` maximize`. + +### Changing alignment of widgets + +You can change the alignment of widgets by saying `head up align ` where the alignment can be anything from `top`, `bottom`, `left`, `right` or in some widgets `center`. The alignment might also be connected to the minimal and maximal growth size as explained above as well. + +### Animations + +Most of the Talon HUD widgets have animations turned on by default, but you might not like those animations yourself. You can turn them off by saying `head up basic `, or turn them back on by saying `head up fancy `. + +### List of available widgets + +(*) The name of these widgets may change based on the title of the panel. + +- Status bar: The bar on the bottom right of the screen with clickable icons. +- Event log: The log that is shown above the status bar showing all the commands. +- Text panel*: The text panel on the top right part of the screen. +- Choices*: The choice panel that is shown in the center of the screen. +- Documentation*: The documentation panel on the left. +- Walkthrough: The documentation panel on the left. +- Ability bar: An optional bar left of the status bar containing non-clickable icons. +- Screen overlay: A widget that can put labels all over the screen. Only used in the focus tracker so far. +- Cursor tracker: A widget that follows your mouse around. Currently has no available content. +- Context menu: The right click menu of a widget. + +## Miscellaneous + +### Roadmap + +These are ideas that I want to implement in no specific order and with no specific timeline in mind. + +- Making the HUD screen reader friendly +- Bringing in tunable audio queues for stuff like mode switching, command registering et cetera +- An image panel with a header and a close icon which displays image content +- Splitting out or merging topics from widgets into separate widgets using voice +- Better default image, dimension and font scaling based on physical dimensions of the screen + +If any of these ideas seem cool for you to work on, give me a message on the talon slack so we can coordinate stuff. + +### Development philosophy and guidelines + +The general idea of this repository is to separate out three concepts, the users UI preferences, the content on display and the actual display logic. +These three silos are based on assumptions for three persona's. The User, the Scripter and the Themer. + +The **User** wants to have their content displayed in a way that matches their intentions. +They decide where they want to place their widgets, what dimensions the widgets should have, what theme should be on display and what size the font should be. After all, the User might be colour blind or have a reduced field of vision. This repository aims to accomodate to them. +The User preferably doesn't have to change code when changing widgets around, and really doesn't want to lose their carefully crafted preferences or change their voice workflow around. + +The **Scripter** wants to display their awesome creations in a visually appealing way without actually having to write out all the code required for that. They spent a bunch of time making an output that is useful, like an autocomplete feature or a command log, and they really don't want to spend more time fiddling around with canvas stuff. +The Scripter just sends their content over to the HUD, which knows where the user wants it and in what way. + +The **Themer** wants to make an amazing visual experience happen, but do not really want to deal with the nitty gritty details of the widgets themselves. They want to change icons, colours and other visual properties of the UI themselves. And they do not like being limited, preferably having as much freedom of expression as possible. + +These three persona's are the spirit of this repository. As such, when new content is added to this repository, it should try to adhere to the needs and wishes above. + +#### Voice command guidelines + +This repository tries to adhere to "What you see is what you say". If there is a widget with a header title, we make sure the widget can be addressed with that header name. +Likewise, if there is a button on display on the screen, just reading the text on the button should activate it. +If these options aren't available, documentation must be supplied with easily parseable voice commands so the users workflow is impacted minimally by reading large swats of text. + +### Acknowledgements + +The icons used are taken from https://icons.getbootstrap.com/. +Some of the icons like the copy icon are taken from fontawesome. + +The language icons are made by https://www.freepik.com hosted on https://www.flaticon.com/. +If your language isn't in the themes, you can download icons for free with attribution of freepik.com and change their size to 35x35 before saving them as a .png file in your theme. + +The programming language icons are taken from various icon packs, including Pictonic Icons, Material design, File by John Gardner and LibreICONS Black by DiemenDesign. Initial work for turning the programming languages into an icon was done by [@Wen Kokke](https://github.com/wenkokke). + +The walkthrough system has been expanded with help and feedback from [@Tara roys](https://github.com/tararoys) and [@Pokey Rule](https://github.com/pokey) to be more user friendly to use and to create for. \ No newline at end of file diff --git a/README20.txt b/README20.txt deleted file mode 100644 index 5954592..0000000 --- a/README20.txt +++ /dev/null @@ -1,56 +0,0 @@ - -The HUD is a user interface that helps improve your workflow. Inspired by gaming HUDs, it is meant to show just the right amount of info to your screen without getting in the way of your actual work. -It is resizable, scalable and placable in whatever combination you can come up with, so only the screen space that you allow will be used, just as you left it. -It combines voice commands with clickable buttons, allowing for seemless transitions between using your regular old controls and your voice command flow. - -On top of that, the HUD remembers where you left off. It keeps the widgets in the place you have left them for the next time you start up, and when you add or remove monitors, it will remember where you kept the widgets in those instances. -This makes the HUD excellent for switching between a single laptop screen, and connecting a monitor in the office or at home. - -By default, the HUD comes in a light and a dark mode, but you can create other themes yourself as well! - -## Available content - -### Microphone muting / management - -In some scenario's like conference calls, it is handy to have a way to instantly turn off the microphones input to Talon. This toggle can be placed on the status bar by saying `status bar add microphone` or right clicking on the status bar and selecting 'Add microphone'. -Switching the microphone off this way prevents accidental wake messages or commands from triggering functionality while you are talking to your friends or colleges. - -On top of that, you can also switch microphones on the fly by saying `toolkit microphones`, or right clicking the status bar and following Content toolkit -> Microphones. The microphone selected here will be used as a favorite setting, so if you toggle the microphone on and off, it will remember the selected microphone here and switch back to that microphone. -This comes in handy when you have multiple microphone set ups, like a laptop microphone and an on desk microphone. - -### Talon Mode tracking ( turned on by default ) - -Talon comes in a variety of modes, like the command mode in which you utter commands, or the sleep mode where no commands are used but the wake word. To keep track of what mode you are currently in, the Talon HUD offers a status bar icon that can be clicked. -This is added by default, and when clicked, turns Talon either in sleep mode, or from sleep mode back to your previous mode, be it command or dictation mode. -Removing the mode icon is possible as well to keep a more minimal look, by saying `status bar remove mode indicator` or by right clicking the status bar and clicking 'Remove mode indicator'. -The status bar will always show whether you are in sleep mode or not at a glance, regardless of when you have mode icon added or not, by changing the appearance of the status bar itself. - -You can change the mode detection, toggle and available modes yourself as well, if your set up requires a more personal touch. To see how, read the link below. - -(TODO!)[Customizing mode tracking] - -### Speech history ( turned on by default ) - -Taking inspiration from FPS games, the event log widget allows you to read back voice commands as you make them, as well as clearing themselves up after a few seconds to give you back that screen space. -Different options to show commands are available. You can keep the commands visible indefinitely, or temporarily freeze them to discuss them, perfect for pairing sessions. - -If you need are more in-depth view of the commands said, you can say `toolkit speech` or navigate from the status bar with Content toolkit -> Debugging -> Speech to find a full overview of the commands said, as well as the used engine and microphone. - -### Language tracking - -For the multi-lingual folks out there, switching between different languages for dictation is a necessity to keep your workflow working with voice. For that purpose, you can add a language icon indicating your language on the status bar by saying `status bar add language` or right clicking the status bar to the option Add language. - -(TODO!)[Customizing programming languages] - -### Programming language tracking - -A lot of programmers inhabit the Talon Voice community, and with them come many different programming languages. With those programming languages come different commands, and usually these are kept track of by the file extension available in a program, or by manually forcing a certain language to be used. -To make sure you know what programming language context you are in, you can add a language icon to your status bar by saying `status bar add code language` or right clicking the status bar and clicking 'Add code language'. -You can add and remove programming languages icons yourself, by following the instructions below. - -(TODO!)[Customizing programming languages] - -### Focus tracking - -When returning back to your computer after a while, it can be hard to see what window Talon has focused for voice commands. This only gets harder if you have multiple monitors. To alleviate this problem, you can add a focus indicator to your status bar by saying `status bar add focus indicator` or right clicking the status bar and selecting 'Add focus indicator'. -This will present an orange-red box on the top center of the currently focused window, to remind you what direction you're talking to. \ No newline at end of file diff --git a/content/programming_language_poller.py b/content/programming_language_poller.py index 0481d35..5cbe132 100644 --- a/content/programming_language_poller.py +++ b/content/programming_language_poller.py @@ -92,7 +92,7 @@ def load_languages(languages_file): "markdown,.md,programming_markdown", "yaml,.yml," ] - file_contents = "" + languages_header + file_contents = "" + languages_header + "\n" file_contents += "\n".join(language_defaults) with open(languages_file, "w") as f: f.write(file_contents) @@ -119,6 +119,11 @@ def load_languages(languages_file): @mod.action_class class Actions: + def hud_get_available_languages(): + """Get the available programming languages inside of the HUD""" + global languages + return languages + def hud_can_toggle_programming_language() -> bool: """Check if we should be able to toggle the programming language from the status bar""" return False diff --git a/content/toolkit.talon b/content/toolkit.talon index 84c02da..da887b2 100644 --- a/content/toolkit.talon +++ b/content/toolkit.talon @@ -8,7 +8,6 @@ toolkit debugging$: user.hud_toolkit_debug_options() toolkit scope$: user.hud_toolkit_scope() toolkit speech$: user.hud_toolkit_speech() toolkit lists$: user.hud_toolkit_lists() -toolkit history$: user.hud_toolkit_history() toolkit microphones$: user.show_microphone_options() toolkit documentation$: user.hud_show_documentation() -toolkit walkthroughs: user.hud_show_walkthroughs() +toolkit walkthroughs: user.hud_show_walkthroughs() \ No newline at end of file