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

Is there are support meta or leader key? #49

Closed
seyar opened this issue Sep 10, 2018 · 5 comments
Closed

Is there are support meta or leader key? #49

seyar opened this issue Sep 10, 2018 · 5 comments

Comments

@seyar
Copy link

seyar commented Sep 10, 2018

I using skhd and I really like it.
But some hotkey mappings are conflicts with mapping in other applications.

Is there a config for meta key?

For example, I press Ctrl+a and then d like in tmux
or ctrl+w then left arrow like vim.

@dominiklohmann
Copy link

dominiklohmann commented Sep 10, 2018

You can use modes for that. Make ctrla activate your mode, then make d trigger your desired action when in that mode. The example configuration has lots of bits that you can piece together to do this.

@seyar
Copy link
Author

seyar commented Sep 11, 2018

@dominiklohmann thank you

@seyar seyar closed this as completed Sep 11, 2018
@seyar
Copy link
Author

seyar commented Sep 13, 2018

@dominiklohmann
Ok. I tried your setup. Works as well. But I not sure that its working similar to tmux or vim etc.

How I can define action in some test mode with executing command and immediately exit to default mode?

# from 'default' mode, activate mode 'test'
alt - d ; test
# from 'test' mode, activate mode 'default'
test < alt - d ; default # there is exit to default without executing command

test < j : chunkc tiling::window --focus south; default # executing command only. We are stay in test mode still

according docs

@ = capture keypresses regardless of being bound to an action

but action has not sample exec command and exit mode

## action   = <keysym> ':' <command> | <keysym> '->' ':' <command>
##                                  <keysym> ';' <mode>    | <keysym> '->' ';' <mode>

@seyar seyar reopened this Sep 13, 2018
@dominiklohmann
Copy link

Your issue is in this line:

test < j : chunkc tiling::window --focus south; default # executing command only. We are stay in test mode still

Everything after the : is being executed as a shell command.

Instead what you want to have is this:

# toggle mode "test" using alt-d
alt - d ; test
test < alt - d ; default

# execute command in mode "test", then leave mode by simulating alt-d keypress
test < j : chunkc tiling::window --focus south; skhd -k "alt - d"

@seyar
Copy link
Author

seyar commented Sep 14, 2018

it works. Thank you

@seyar seyar closed this as completed Sep 14, 2018
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

No branches or pull requests

2 participants