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

feat: toggle tiling direction on button click in sample config #74

Merged

Conversation

ehellman
Copy link
Collaborator

@ehellman ehellman commented Aug 6, 2024

The default config for Zebar contains an element that displays the tiling direction for glazewm. Added the toggle-tiling-direction command to the glazewm provider and made the button interactive in the sample config.

@CtByte
Copy link
Contributor

CtByte commented Aug 9, 2024

@ehellman @lars-berger This is pretty nice having click events. I would need to run a command as well for the komorebi provider and I was wondering if it's possible to make a generic way to be able to run a (powershell) command/script using perhaps the util provider so you would not need to add a new one for different things. Like util.executePowershellCommand.

Others also want to run powershell commands to open a program and such. This could be useful for that too.

@lars-berger lars-berger changed the title feat: add toggle-tiling-direction to glazewm provider feat: toggle tiling direction on button click in sample config Aug 17, 2024
@lars-berger
Copy link
Member

@ehellman @lars-berger This is pretty nice having click events. I would need to run a command as well for the komorebi provider and I was wondering if it's possible to make a generic way to be able to run a (powershell) command/script using perhaps the util provider so you would not need to add a new one for different things. Like util.executePowershellCommand.

Others also want to run powershell commands to open a program and such. This could be useful for that too.

100% agree this would be a nice feature. imo it'd best to create a separate provider for it, perhaps like:

providers:
  - type: 'shell'
    alias: 'music'
    command: 'node music_player_backend.js'
    update_method:
      invoke_immediately: false
      continuous: false
      interval: 5000
    json: false # whether to json parse the output (or maybe just call JSON.parse in the template itself?)
template: |
  {{ music.output }}
  {{ music.prevOutputs }}

There could be a shell.exec({ commandOverride?: string }) function to explicitly call run it and even override the command so that different flags could be passed. We could have an invoke_immediately option for whether it should be paused on start and require the shell.exec method to start it off. or maybe it'd make sense to have a paused_on_start option that exists on every provider config that allows for pausing/resuming a provider?

@CtByte
Copy link
Contributor

CtByte commented Aug 17, 2024

@lars-berger This sounds pretty nice! Do you think this is somewhat related to #75 and #83 ? I would not want to create a new feature request if they are.

@lars-berger
Copy link
Member

Yeah it's an idea for how #75 could be implemented - will go ahead and post it there too

@lars-berger lars-berger merged commit 6a085e0 into glzr-io:main Aug 18, 2024
6 checks passed
Copy link

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants