Comments (13)
What is the difference between
hyper + f
jumpapp firefox
and
capslock + f
jumpapp firefox
in your case? If I understand correctly, this is exactly what you want: map the caps lock physical key to a command (which is what it means for swhkd
).
swhkd
reads input at a lower level than X11 libraries, so your custom rebind (with xmodmap
, setxbkmap
or any other) should not impact it in any way. (please correct me if I am wrong @angelofallars @EdenQwQ @Shinyzenith)
I think you should even be able to keep your custom config in X or wayland and both swhkd
binds and your custom mappings should work together.
from swhkd.
@ajanon -- thank you for the suggestion. With just:
capslock + f
jumpapp firefox
I just get:
[... ERROR swhkd] Config Error: Error parsing config file "/etc/swhkd/swhkdrc". Invalid modifier at line 1.
This is similar to sxhkd
, which why capslock has to be mapped to the hyper
modifier first.
from swhkd.
Yup, caps lock is not a "modifier" I get exactly the same. You can however use the hyper modifier in sway, so that is the route I took.
from swhkd.
swhkd reads input at a lower level than X11 libraries, so your custom rebind
@ajanon You are correct!
from swhkd.
Hi, thank you for the verbose report. Would you mind expanding on what the hyper key is? I'm not particularly familiar with that.
from swhkd.
It is an additional modifier, so I now have Super, Alt, Control and Hyper. You can use xmodmap to do this on x11, but on wayland I used this:
https://ibnishak.github.io/blog/post/caps-to-hyper/
So in sxhkd you can use:
hyper+d
<your-command-here>
Press and hold caps lock - press d.
I can define hyper in my sway config and it works:
set $mod3 Mod3
#######################
# Hyper key bindings: #
#######################
bindsym $mod3+b exec --no-startup-id killall -SIGUSR1 waybar
bindsym $mod3+n exec swaync-client -t -sw
bindsym $mod3+s exec ~/.local/bin/grimm
bindsym $mod3+u exec ~/scripts/ups.sh
All of which function as expected.
For a full history of additional modifiers, search for space-cadet keyboards on lisp machines (spot the emacs user 😄).
:edit:
To get caps lock, I use:
input type:keyboard {
xkb_layout "gb"
xkb_options shift:both_capslock # <<<<<<<<<<<<<<
}
Press both shifts to toggle caps lock.
from swhkd.
OK I will get someone to look into this. I currently can't work on it due to my deteriorating health.
from swhkd.
No problems, I completely understand, I am an old crip, easier and quicker to list what isn't wrong with me 🤣
from swhkd.
I was experimenting with migrating from sxhkd
, but this is a show-stopper for me. With my existing sxhkd
config:
hyper + f
jumpapp firefox
...
I get:
[2022-08-19T00:09:53Z ERROR swhkd] Config Error: Error parsing config file "/etc/swhkd/swhkdrc". Unknown symbol at line 1.
99% of what I use sxhkd
for is mapping commands to hyper combinations, fwiw.
from swhkd.
patches are always welcome
from swhkd.
does that mean that there's no way to get binds with the hyper mod key working in swhkd?
from swhkd.
I found the code to do with the "hyper" mod key, while trying to make the "alt graph" key work. It may be considered a breaking change. I've managed to get it working with the "alt gr" key so I'm assuming it would work with the "hyper" key, however I don't have a keyboard with the "hyper" key.
Also by "hyper" key I'm assuming you mean the "right logo/windows" button found on larger keyboards.
There are 2 main steps to get the hyper key working.
- Add "Hyper" in the "Modifier" enum in config.rs
pub enum Modifier {
Super,
Hyper,
Alt,
Control,
Shift,
Any,
}
- Map "RIGHTMETA" key to the "Hyper" Modifer enum in the "modifiers_map" hashmap located in daemon.rs
let modifiers_map: HashMap<Key, config::Modifier> = HashMap::from([
(Key::KEY_LEFTMETA, config::Modifier::Super),
(Key::KEY_RIGHTMETA, config::Modifier::Hyper),
(Key::KEY_LEFTALT, config::Modifier::Alt),
(Key::KEY_RIGHTALT, config::Modifier::Alt),
(Key::KEY_LEFTCTRL, config::Modifier::Control),
(Key::KEY_RIGHTCTRL, config::Modifier::Control),
(Key::KEY_LEFTSHIFT, config::Modifier::Shift),
(Key::KEY_RIGHTSHIFT, config::Modifier::Shift),
]);
Again, I can't test whether this will work since I don't have that key available on my keyboard
from swhkd.
@samsonnagamani Thanks for the patch! If anyone can test it and get it working, I'd be more than happy to merge and support this usecase.
from swhkd.
Related Issues (20)
- Keyboard stops working after running `pkexec swhkd` HOT 6
- How to express this sxkhd underscore-range idiom in swkhd?
- `XDG_RUNTIME_DIR` is not a typo HOT 1
- `/dev/input/mouse1`: Inappropriate ioctl for device HOT 10
- compositor pkexec swhkd invocation is buggy
- documentation for multiple config loading
- pkexec alternative ?
- Can't compile (make: rustup: No such file or directory make: *** [Makefile:61: setup] Error 127) HOT 2
- Systemd service won't start HOT 2
- swhkd doesn't compile, returns Makefile 25 error HOT 10
- Proposal: Better Path handling Mechanisms HOT 3
- Mouse events occur twice HOT 2
- [enchancement] Add Path Validations to Environment Variables
- feat: generate default config HOT 1
- [enchancement] Fork into SWHKS when not detected HOT 3
- Swhks stops after login HOT 5
- Use rust build scripts/GH integration instead of Makefile
- compatibility with hyprland HOT 1
- XF86AudioStop not being recognized HOT 1
- install guide turns off NetworkManager wifi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swhkd.