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

Events, part 1 #123

Closed
20 tasks done
Taitava opened this issue Dec 12, 2021 Discussed in #60 · 3 comments
Closed
20 tasks done

Events, part 1 #123

Taitava opened this issue Dec 12, 2021 Discussed in #60 · 3 comments
Projects
Milestone

Comments

@Taitava
Copy link
Owner

@Taitava Taitava commented Dec 12, 2021

Discussed in #60

Events that will be implemented now:

  • When Obsidian is opened (more specifically, this would actually be: when the plugin is loaded). This would allow a user to open a set of tool applications every time they open a certain Obsidian vault, e.g. GIMP for manipulating note related images.
  • When Obsidian is closed.
  • Every n seconds (seconds could be later changed to a decimal number, allowing executing something e.g. every 0.5 seconds if needed)
  • Command palette: Currently this is the only action that can launch shell commands. It's included in this list to mark that a user can also turn it off, if they use other launchers for a shell command. Turn off = means that a shell command would not appear in command palette.
  • When a user switches the active panel. Example: Execute a shell command that reads the current file's last modification time and outputs the information to status bar (the status bar output feature is still under planning, see #16 ). The event helps to automatically give information for the file that is currently actively viewed in Obsidian.
  • Context menus: This would allow a user to define a new item in context menus (editor context menu, file navigation context menu, what else are there?). By clicking that context menu item, a shell command is executed, with possible event related variables like to what file was the context menu related to, or to what position in the editor.

New variables:

  • {{event_file_extension}}
  • {{event_file_name}}
  • {{event_file_path}}
  • {{event_folder_name}}
  • {{event_folder_path}}
  • {{event_tags}}
  • {{event_title}}
  • {{event_yaml_value}}

Other things:

  • Write documentation for the new events.
  • Write documentation for the new variables.
  • Add See also sections to variable documentation, will contain links to similar variables.
  • Write example events to documentation.
  • Add links to each event's documentation page in settings.
  • Create tests for events.
@Taitava Taitava added this to Actively working on in Roadmap Dec 12, 2021
@Taitava Taitava added this to the 0.10.0 milestone Dec 12, 2021
Taitava added a commit that referenced this issue Dec 12, 2021
Taitava added a commit that referenced this issue Dec 12, 2021
Taitava added a commit that referenced this issue Dec 12, 2021
Taitava added a commit that referenced this issue Dec 13, 2021
Taitava added a commit that referenced this issue Dec 13, 2021
Taitava added a commit that referenced this issue Dec 13, 2021
Taitava added a commit that referenced this issue Dec 13, 2021
… by extending the classes.

Will be used for SC_AbstractFileMenuEvent related variables.
Taitava added a commit that referenced this issue Dec 13, 2021
And show them in ShellCommandExtraOptionsModal, too.
Taitava added a commit that referenced this issue Dec 13, 2021
FolderMenu still lacks extra variables.
Taitava added a commit that referenced this issue Dec 14, 2021
Taitava added a commit that referenced this issue Dec 14, 2021
Taitava added a commit that referenced this issue Dec 19, 2021
Taitava added a commit that referenced this issue Dec 19, 2021
Taitava added a commit that referenced this issue Dec 19, 2021
Taitava added a commit that referenced this issue Dec 31, 2021
- Register them the same way as normal variables.
- Show error messages if they are tried to be accessed outside an event, or in a wrong event.
- {{event_*}} variables are not inherited from their normal counterpart variables anymore (e.g. {{event_file_name}} is not inherited from {{file_name}} anymore).
Taitava added a commit that referenced this issue Jan 1, 2022
During an SC_Event_FileMenu event, a file is always available.
Taitava added a commit that referenced this issue Jan 2, 2022
…the event.

Before this, the notification was only shown when changing the interval value (seconds).
@DaveyUS
Copy link

@DaveyUS DaveyUS commented Jan 3, 2022

What are the chances we could get an event that triggers when a link is clicked with a {{event_link_text}} variable?

A usage example would be when clicking [[audiofile.mp3]] the event would trigger allowing me pass the mp3 name to a python script.

Amazing plugin btw!

@Taitava
Copy link
Owner Author

@Taitava Taitava commented Jan 4, 2022

What are the chances we could get an event that triggers when a link is clicked with a {{event_link_text}} variable?

A usage example would be when clicking [[audiofile.mp3]] the event would trigger allowing me pass the mp3 name to a python script.

Thanks for the question! 🙂 To keep idea discussions separate from implementation issues, I answered your question in this events related discussion: #60 (comment)

Amazing plugin btw!

Thank you! 😎

Taitava added a commit that referenced this issue Jan 25, 2022
This lists all events that are enabled, and shell commands for which they are enabled.
Taitava added a commit that referenced this issue Jan 25, 2022
Taitava added a commit that referenced this issue Jan 29, 2022
Taitava added a commit that referenced this issue Jan 29, 2022
The commit's message was:
#123: Events: Do not try to update an alias in the command palette if a shell command is excluded from it.

The changes were lost when I merged #123 to #134.
Taitava added a commit that referenced this issue Jan 30, 2022
Reflects new settings fields "events" and "command_palette_availability".
@Taitava Taitava moved this from Actively working on to Released lately in Roadmap Feb 6, 2022
@Taitava
Copy link
Owner Author

@Taitava Taitava commented Feb 6, 2022

Released.

@Taitava Taitava closed this Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Roadmap
Released lately
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants