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: added @pend internal command #220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

EdenQwQ
Copy link
Member

@EdenQwQ EdenQwQ commented Aug 14, 2023

This could fix #219 @tsankuanglee

Usage

Use @pend mode_name to enter a mode, and the remaining commands will not run until the mode is escaped with @escape or oneoff.

Example

swhkdrc:

super + r
  notify-send "entering resize mode" && @pend resize && notify-send "exiting resize mode"

mode resize
{h, l, j, k}
  hyprctl dispatch resizeactive {\-5 0, 5 0, 0 5, 0 \-5}
ctrl + c
  notify-send "entering move-canvas mode" && @pend move-canvas && notify-send "exiting move-canvas mode"
q
  @escape
endmode

mode move-canvas
{h, l, j, k}
  /home/eden/.config/hypr/scripts/move-canvas {5 0, \-5 0, 0 \-5, 0 5}
q
  @escape
endmode

When super + r is pressed, the notification "entering resize mode" would show up, and we will enter resize mode.

In resize mode, when ctrl + c is pressed, notification "entering move-canvas mode" would show up, and we will enter the move-canvas mode.

After that, when q is pressed, we will escape from move-canvas mode, and notification "leaving move-canvas mode" would show up. Now we are still in resize mode.

Finally, when q is pressed, we will escape from resize mode and notification "exiting resize mode" would show up.

@EdenQwQ EdenQwQ marked this pull request as ready for review August 14, 2023 05:14
@Shinyzenith
Copy link
Member

@EdenQwQ Apologies for being so late, the pr looks good to me but it's not documented. Would you mind adding some documentation?

@Shinyzenith Shinyzenith removed the request for review from ajanon February 27, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Bug / Feature] stack for commands
2 participants