Skip to content

Instantly share code, notes, and snippets.

@dharmx
Last active July 25, 2023 08:11
Show Gist options
  • Select an option

  • Save dharmx/faa04af5c12ce390e55f716d341d6c47 to your computer and use it in GitHub Desktop.

Select an option

Save dharmx/faa04af5c12ce390e55f716d341d6c47 to your computer and use it in GitHub Desktop.
Handle keys only when EWW window is open.
(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
#!/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
@dharmx
Copy link
Copy Markdown
Author

dharmx commented Jul 25, 2023

demo.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment