Skip to content

Conversation

JonasWischeropp
Copy link
Contributor

This PR addresses #650 and #646
I added two config entries that allow easy execution of commands at shutdown and restart similar to general.startup_commands.

Config entry Execution time
general.shutdown_commands just before shutdown
general.reload_commands after config has reloaded

These are then used in the sample config to shutdown and reload Zebar.

general:
  startup_commands: ['shell-exec %userprofile%/.glzr/zebar/start.bat']
  shutdown_commands: ['shell-exec taskkill /IM zebar.exe /F']
  reload_commands: [
    'shell-exec taskkill /IM zebar.exe /F',
    'shell-exec %userprofile%/.glzr/zebar/start.bat'
  ]

@vlad420
Copy link

vlad420 commented Sep 7, 2024

Good One! This is necessary.

@lars-berger
Copy link
Member

Really well written, thanks for taking care of this 🙌

Just a couple nitpicks, otherwise good to go

@JonasWischeropp
Copy link
Contributor Author

I have refactored the code.

@lars-berger
Copy link
Member

Sweet looks great 👌

@lars-berger lars-berger merged commit 2a63d1c into glzr-io:main Sep 16, 2024
1 check passed
@lars-berger
Copy link
Member

Hey @JonasWischeropp quick heads up - did some minor fixups in a follow-up pr at #742

didn't manage to get the Zebar config reload command to work (could be a change in Zebar v1 -> v2 that changed the behavior), so i'll remove that for now until a CLI command is added to Zebar for reloading

@lars-berger
Copy link
Member

BTW will get around to reviewing your new PR shortly 👌 Sorry about the wait

Copy link

🎉 This PR is included in version 3.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@AfzGit
Copy link

AfzGit commented Feb 8, 2025

This PR addresses #650 and #646 I added two config entries that allow easy execution of commands at shutdown and restart similar to general.startup_commands.

Config entry Execution time
general.shutdown_commands just before shutdown
general.reload_commands after config has reloaded
These are then used in the sample config to shutdown and reload Zebar.

general:
  startup_commands: ['shell-exec %userprofile%/.glzr/zebar/start.bat']
  shutdown_commands: ['shell-exec taskkill /IM zebar.exe /F']
  reload_commands: [
    'shell-exec taskkill /IM zebar.exe /F',
    'shell-exec %userprofile%/.glzr/zebar/start.bat'
  ]

The shutdown and startup commands for Zebar are run in parallel so sometimes Zebar is closed down when it starts. This solution works: #646 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

4 participants