GithubHelp home page GithubHelp logo

Comments (5)

dominiklohmann avatar dominiklohmann commented on August 17, 2024

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.

from skhd.

seyar avatar seyar commented on August 17, 2024

@dominiklohmann thank you

from skhd.

seyar avatar seyar commented on August 17, 2024

@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>

from skhd.

dominiklohmann avatar dominiklohmann commented on August 17, 2024

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"

from skhd.

seyar avatar seyar commented on August 17, 2024

it works. Thank you

from skhd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.