ItayGarin / ktrl

A Supercharged Keyboard Programming Daemon ⌨️
GNU Lesser General Public License v3.0
338 stars 12 forks source link

Expose perform commands via cli #13

Closed brockelmore closed 4 years ago

brockelmore commented 4 years ago

It would be great to be able to activate a particular layer via a script. I.e. I use bspwm, and when I change focus between windows, I would like to be able to update what layer is active (effectively, this turns layers into user-definable mappings for applications). This could be done via sending a command by having ktrl see if there is a running instance for the device and executing basically any of the perform commands.

I.e. in firefox, I can't redefine keyboard shortcuts (*easily, i.e. without compiling firefox myself essentially). Its dumb.

So I would like to have a firefox layer that maps the keyboard shortcuts I want to use to the unchangeable firefox ones, same with other apps I use.

ItayGarin commented 4 years ago

That's an awesome idea! Really liked it :smile: I've come to expect the same from i3. I'll definitely add this to my to-dos :)

ItayGarin commented 4 years ago

I thought about another cool feature that would go nicely with this - It'd be nice if ktrl exposed the layer state for external use. E.g We could use that the display the current active layers in i3/bspwn's bar.

Let me know what you think

brockelmore commented 4 years ago

Yeah that would be great to expose it. Integrates nicely with named layers obviously

ItayGarin commented 4 years ago

Implemented (under the "ipc" feature flag)