Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Specific keybinds per an app? #5

Open
rbreaves opened this issue Apr 28, 2021 · 2 comments
Open

Specific keybinds per an app? #5

rbreaves opened this issue Apr 28, 2021 · 2 comments

Comments

@rbreaves
Copy link

rbreaves commented Apr 28, 2021

Do you think you'd be able to do something similar to xkeysnail? It uses x11 to figure out the active window though, something wayland is not likely to support vs communicating to the DE imo, but I would interested to know your thoughts.

https://github.com/mooz/xkeysnail

@rbreaves
Copy link
Author

I also brought this up here https://github.com/snyball/Hawck/issues/6.

@arnarg
Copy link
Owner

arnarg commented Apr 30, 2021

This wouldn't be impossible but would require us to support every single different method of getting the focused window (limited to wayland WMs).

For example in sway I can get it simply using swaymsg:

>> swaymsg -t get_tree | jq '.nodes[].nodes[].nodes[] | select(.focused)'
{
  "id": 1024,
  "name": "swaymsg -t get_tree | jq '.nodes[].nodes[].nodes[] | select(.focused)'",
  "rect": {
    "x": 1283,
    "y": 36,
    "width": 1271,
    "height": 1398
  },
  "focused": true,
  "focus": [],
  "border": "pixel",
  "current_border_width": 2,
  "layout": "none",
  "orientation": "none",
  "percent": 0.49882260596546313,
  "window_rect": {
    "x": 2,
    "y": 2,
    "width": 1267,
    "height": 1394
  },
  "deco_rect": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "geometry": {
    "x": 0,
    "y": 0,
    "width": 800,
    "height": 600
  },
  "window": null,
  "urgent": false,
  "marks": [],
  "fullscreen_mode": 0,
  "nodes": [],
  "floating_nodes": [],
  "sticky": false,
  "type": "con",
  "pid": 23757,
  "app_id": "Alacritty", <- Looks useful
  "visible": true,
  "max_render_time": 0,
  "shell": "xdg_shell",
  "inhibit_idle": false,
  "idle_inhibitors": {
    "user": "none",
    "application": "none"
  }
}

I don't have much use for this myself and I'm a bit reluctant of complicating this app too much. But I'll keep this open for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants