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

Use Format replacements in action #3374

Closed
zooeywm opened this issue Jun 19, 2024 · 3 comments
Closed

Use Format replacements in action #3374

zooeywm opened this issue Jun 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@zooeywm
Copy link

zooeywm commented Jun 19, 2024

Hello maintainers, first of all, thanks for your excellent work on this project. It has been incredibly useful for me.

I am currently experiencing an issue with: When I'm trying to write a minimizer for Hyprland with wlr/taskbar's on-click-right.

The ideal action for me looks like this:

"on-click-right": "bash -c '[ '$(hyprctl clients -j | jq -r '.[] | select(.title == {title})' | jq -r '.workspace.name')' == 'special:minimized' ] && hyprctl dispatch movetoworkspace +0,title:{title} || hyprctl dispatch movetoworkspacesilent special:minimized',title:{title}",

The only thing miss for me is using the title in action

Or is there any other methods to achieve this?

@github-actions github-actions bot added the bug Something isn't working label Jun 19, 2024
@zooeywm zooeywm changed the title Add pid Format replacements for wlr/taskbar Use Format replacements in action Jun 19, 2024
@RobertMueller2
Copy link
Contributor

RobertMueller2 commented Jul 3, 2024

I might be wrong, but right now I don't really see a way to do this from within wlr/taskbar.

Here's an alternative workflow suggestion:

  • add a shortcut to your hyprland config that sends the active window to special:minimized workspace
  • add a shortcut to your hyprland config that starts a script which
    • pulls a list of windows on special:minimized workspace
    • opens dmenu/rofi/... to display them
    • runs hyprctl dispatch to get the selected window back

It might not be as pretty, but it has the advantage that it should be available right now. ;)

Regarding your feature request, I think it's a nice idea for user scripts called from wlr/taskbar to have access to certain window information, but:

  • wlr/taskbar wasn't really supposed to call user scripts, the on-clicks are really meant for module internal wayland actions as documented in the manpage
  • I would be concerned about replacements in commands, because the input is quite arbitrary. E.g. if it's a shell terminal, the title can be set via a prompt command within the shell and could contain a lot of things. A better approach would be to make the information available via environment variables

@RobertMueller2
Copy link
Contributor

BTW, title or app_id aren't necessarily unique, which limits the usefulness of setting them for use in scripts.

@zooeywm
Copy link
Author

zooeywm commented Jul 10, 2024

Sorry for the late reply, I've made some confusions on taskbar's feature. I turns to use rofi, it works great for me, thanks 💯

@zooeywm zooeywm closed this as completed Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants