Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command to copy the url of the current page #534

Merged
merged 10 commits into from
Aug 6, 2021

Conversation

xavier630
Copy link
Contributor

@xavier630 xavier630 commented Aug 2, 2021

I was finding that this was a really common workflow and wanted to speed it up. I figured others could benefit from it.

This current implementation is just for Chrome, but is generic enough to work with all browsers once we have a shared place to put it. I just didn't want to duplicate it four times without the shared place. For context see (#532).

@@ -1,6 +1,7 @@
tag: browser
-
(address bar | go address | go url): browser.focus_address()
(address copy | url copy | copy address | copy url ): user.address_copy()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite a few different commands here as I try to stay consistent with the existing commands in the file but also meet the desired object -> verb standards

@rntz
Copy link
Collaborator

rntz commented Aug 2, 2021

This probably doesn't need to be an action; since it will have the same implementation across all browsers so far, you can put it in generic_browser.talon.

@xavier630
Copy link
Contributor Author

This probably doesn't need to be an action; since it will have the same implementation across all browsers so far, you can put it in generic_browser.talon.

Hmm is this the current stance? I was under the impression we were trying to move implementations away from .talon files.

@rntz
Copy link
Collaborator

rntz commented Aug 2, 2021

action implementations in .talon files are deprecated and eventually will stop working, those look like this:

action(edit.undo): key(ctrl-/)
# don't do this ^, use Python instead

But voice commands in .talon files aren't going away, and not every voice command needs to be implemented by a single action. This would be a fairly normal voice command:

copy address:
  browser.focus_address()
  sleep(50ms)
  edit.copy()

@xavier630
Copy link
Contributor Author

xavier630 commented Aug 2, 2021

I imagine the downside is that this becomes hard to overwrite for specific browsers or to call in another action later? But yep can do if that's preferred 👍

@xavier630
Copy link
Contributor Author

@rntz it's now all in .Talon files

@rntz rntz merged commit 2c197a9 into talonhub:master Aug 6, 2021
daanvdh pushed a commit to daanvdh/knausj_talon that referenced this pull request Sep 2, 2021
* master: (55 commits)
  Added command mode to all language headers to prevent them being active in sleep mode (talonhub#569)
  Change command client keyboard shortcut (talonhub#572)
  Make slap command work with Slack (talonhub#535)
  Add Pound Sterling (£) Sign (talonhub#523)
  `quote that` and `inside quotes` changes (talonhub#538)
  Knausj generic terminal establishment (talonhub#514)
  Add right-drag command to Talon (talonhub#498)
  Add a small delay to tab close on Chrome (talonhub#553)
  fix tab jumping for firefox on linux (talonhub#558)
  implement cancel command properly (talonhub#536)
  Add a command to copy the url of the current page (talonhub#534)
  Add fetch all to convenience mappings
  Update .gitignore
  Ignore settings directory
  Delete cancel.talon
  Fix Mac Terminal Copy-paste (talonhub#525)
  add phones word/word left/word right commands (talonhub#531)
  Update switcher.py (talonhub#529)
  jetbrains filename() quick fix
  Update switcher.py
  ...
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.

2 participants