Skip to content

Make hyprlauncher toggle when already running instead of just opening it - #42

Merged
vaxerski merged 2 commits into
hyprwm:mainfrom
ChromMob:main
Jan 30, 2026
Merged

Make hyprlauncher toggle when already running instead of just opening it#42
vaxerski merged 2 commits into
hyprwm:mainfrom
ChromMob:main

Conversation

@ChromMob

Copy link
Copy Markdown
Contributor

I noticed I always have to press Esc to close hyprlauncher which is annoying since I have it bound to keybind. So I made it toggle instead of just run open.

@omarvalentini

Copy link
Copy Markdown

Shouldn't this be under a CLI flag?

If the window is opened programmatically rather than by a user interaction, you probably don't want it to ever close the window instead.

@ChromMob

Copy link
Copy Markdown
Contributor Author

Sorry I am probably not following what you mean exactly. I mean I understand the behaviour you mean but can't imagine the situation. Also do you think it should be toggle first or open only first?

@omarvalentini

Copy link
Copy Markdown

Sorry I am probably not following what you mean exactly. I mean I understand the behaviour you mean but can't imagine the situation.

Let's say, that, if I go to workspace 7, I have a script that launches Hyprlauncher when the workspace is created. If I go to workspace 7 while Hyprlauncher is open, it will close Hyprlauncher instead, but I might not have meant to do that.

Also do you think it should be toggle first or open only first?

I think it's common sense to not change existing behavior without a good reason, so, it would be open by default, and toggle under a flag, but Vaxry should have the final say on this.

@ChromMob

ChromMob commented Nov 11, 2025

Copy link
Copy Markdown
Contributor Author

Let's say, that, if I go to workspace 7, I have a script that launches Hyprlauncher when the workspace is created. If I go to workspace 7 while Hyprlauncher is open, it will close Hyprlauncher instead, but I might not have meant to do that.

Oh I see, that makes perfect sense.

I think it's common sense to not change existing behavior without a good reason, so, it would be open by default, and toggle under a flag, but Vaxry should have the final say on this.

I mean hyprlauncher seems to be in the rapid development stage, I think potenitonally breaking changes are fine at this point.

@ChromMob

Copy link
Copy Markdown
Contributor Author

I guess we will leave the default behaviour to @vaxerski

@vaxerski

Copy link
Copy Markdown
Member

default should be open and cli flag could do the switch to toggle / close

@ChromMob

Copy link
Copy Markdown
Contributor Author

Should it be decided on the first run or every execution should have the flag?

@vaxerski

Copy link
Copy Markdown
Member

?? every execution

@TheKnightSky

TheKnightSky commented Nov 15, 2025

Copy link
Copy Markdown

Should it be decided on the first run or every execution should have the flag?

From my understanding of this if you make it a command line flag, say -t, you have 2 options for the toggle behaviour.

1 is first run, where you have something like hyprlauncher -d already somewhere, you just change it to hyprlauncher -dt for toggle behaviour. And every hyprlauncher call, toggles it.

2 is every launch, where you have something like bind, keycombination, hyprlauncher. You could change it to hyprlauncher -t. And so every call for hyprlauncher would just be open/close, but with -t it would just toggle.

But if you make this a config file setting, like general:toggle_enabled without flags entirely, all you would have to do is edit the config file and change the value from its default value of false to true. This way you won't have to deal with any errors that may arise from (1) of if you add -t after the first run in both cases of its initial state.

I would say every execution change (2) is good, but making this a config setting is better because if a user wants the toggle behaviour, they wouldn't be needing or using just a plain hyprlauncher call.

@omarvalentini

omarvalentini commented Nov 15, 2025

Copy link
Copy Markdown

Should it be decided on the first run or every execution should have the flag?

From my understanding of this if you make it a command line flag, say -t, you have 2 options for the toggle behaviour.

1 is first run, where you have something like hyprlauncher -d already somewhere, you just change it to hyprlauncher -dt for toggle behaviour. And every hyprlauncher call, toggles it.

2 is every launch, where you have something like bind, keycombination, hyprlauncher. You could change it to hyprlauncher -t. And so every call for hyprlauncher would just be open/close, but with -t it would just toggle.

But if you make this a config file setting, like general:toggle_enabled without flags entirely, all you would have to do is edit the config file and change the value from its default value of false to true. This way you won't have to deal with any errors that may arise from (1) of if you add -t after the first run in both cases of its initial state.

I would say every execution change (2) is good, but making this a config setting is better because if a user wants the toggle behaviour, they wouldn't be needing or using just a plain hyprlauncher call.

The thing is, that there are times you want the toggle behavior (ex. when Hyprlauncher is called by a keybinding) and some times you don't, (ex. when it's called by a script).

A config option or a first launch only option simply won't do, it needs to be a flag each time Hyprlauncher is invoked.

This way, if I, for example, configure super r to run hyprlauncher -t, even when Hyprlauncher is ran by a script without the -t option, the keybinding will still close it, fulfilling the whole point of this PR, but the Hyprlauncher ran by a script will never risk accidentally closing an existing Hyprlauncher window.

@TheKnightSky

Copy link
Copy Markdown

You are right. I also completely forgot about the manual entry providing capabilities, I was set on the desktop launcher mode. So yeah the flag option is best.

@ChromMob

Copy link
Copy Markdown
Contributor Author

Will implement the toggle then

@ChromMob

Copy link
Copy Markdown
Contributor Author

Sorry for disappearing for so long, had some personal stuff to deal with

@ChromMob

Copy link
Copy Markdown
Contributor Author

@vaxerski Could you please look into this, I know I went MIA for a long time so you maybe completely forgot about it.

@vaxerski vaxerski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lg tv

@vaxerski
vaxerski merged commit 964950e into hyprwm:main Jan 30, 2026
1 check passed
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.

4 participants