Last active
July 25, 2023 08:11
-
-
Save dharmx/faa04af5c12ce390e55f716d341d6c47 to your computer and use it in GitHub Desktop.
Handle keys only when EWW window is open.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defwindow window :windowtype "normal" :wm-ignore true | |
| :geometry (geometry :anchor "center" :y 100 :width "10%" :height "10%") | |
| (key)) | |
| (deflisten log "./key.sh") | |
| (defwidget key[] "This prints nohing. '${log}'") | |
| ;; vim:filetype=yuck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # depends on https://github.com/dharmx/xcore | |
| xcore -Mkey | while read -r keytype key; do | |
| [[ "$keytype" == "KeyRelease" ]] && continue | |
| case "$key" in | |
| Return) dunstify "Return pressed!" ;; | |
| d) dunstify "D pressed!" ;; | |
| Super_L) dunstify "Super pressed!" ;; | |
| esac | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
demo.mp4