Code Monkey home page Code Monkey logo

Comments (9)

UnsignedArduino avatar UnsignedArduino commented on August 29, 2024

If we are gonna do JSON files, maybe something like this:

{
  // Don't include / have empty list to use all keyboards
  "use_keyboards": [
    "/dev/input8"
  ]
  // All combos we should look for
  "combos": [
    {
      "keys": ["SUPER", "m"],
      "action": {
        "working_dir": "~",
        "environment_vars": [
          {
            "name": "DEBUG",
            "value": "1"
          }
        ]
        "command": "mousepad"
      }
    }
  ]
}

(Obviously, this is trying to show off every setting you can use)

from swhkd.

Shinyzenith avatar Shinyzenith commented on August 29, 2024

Have you seen the config file of sxhkd? I plan to clone it exactly as is.

from swhkd.

UnsignedArduino avatar UnsignedArduino commented on August 29, 2024

That's probably a better idea :)

from swhkd.

rv178 avatar rv178 commented on August 29, 2024

I think making the config file of sxhkd and swhkd cross compatible will be the better idea rather than using something like TOML or JSON

mod edit:
#8 (comment)

from swhkd.

Shinyzenith avatar Shinyzenith commented on August 29, 2024

@angelofallars Hi angelo, you can go ahead and make a config-devel branch for your work.

Please do send a PR if possible and mark it as a draft if you do 🥰

from swhkd.

angelofallars avatar angelofallars commented on August 29, 2024

Will do!

from swhkd.

Shinyzenith avatar Shinyzenith commented on August 29, 2024

https://github.com/baskerville/sxhkd/blob/master/src/parse.c I believe this can help you @angelofallars

from swhkd.

Shinyzenith avatar Shinyzenith commented on August 29, 2024

any updates on this?

from swhkd.

angelofallars avatar angelofallars commented on August 29, 2024

I finally added a basic config parser: see commit on config 252ce9f . I also wrote some unit tests to test the config parser, as it was the only way to test it. It is still not complete, however.

As an example, here's a config file that "works":

r
    alacritty

w
    kitty

t
    /bin/firefox

TODO:

  • Add more supported key presses (alphabetical, numerical, insert, home, delete, end, super, etc)
  • Add chained keybindings (super + g, shift + 1, shift + ctrl + o)
  • Add error handling for config errors (example: keybinding without command, invalid/unrecognizable keybind combination)

from swhkd.

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.