feat(eww): make on-release work. proof of concept with heart widget
This commit is contained in:
parent
001588bad1
commit
416a4e1635
5 changed files with 38 additions and 6 deletions
|
@ -37,3 +37,15 @@
|
||||||
:exclusive "ignore"
|
:exclusive "ignore"
|
||||||
(closer-notif)
|
(closer-notif)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(defwidget on-release-fix []
|
||||||
|
(eventbox :onclick "eww close on-release-fix")
|
||||||
|
)
|
||||||
|
(defwindow on-release-fix :monitor 0
|
||||||
|
:geometry (geometry :width "100%"
|
||||||
|
:height "100%"
|
||||||
|
)
|
||||||
|
:stacking "overlay"
|
||||||
|
:exclusive "ignore"
|
||||||
|
(on-release-fix)
|
||||||
|
)
|
||||||
|
|
|
@ -31,6 +31,8 @@ startup() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$HYPR_PATH"/osk-toggle.sh getState &
|
"$HYPR_PATH"/osk-toggle.sh getState &
|
||||||
|
"$EWW_PATH"/on-release.sh &
|
||||||
|
input-emulator start mouse -n &
|
||||||
|
|
||||||
if grep -q "$FILE"; then
|
if grep -q "$FILE"; then
|
||||||
eww close heart
|
eww close heart
|
||||||
|
|
|
@ -1,10 +1,21 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
FILE="$HOME/.config/.on-release"
|
||||||
|
|
||||||
function run() {
|
function run() {
|
||||||
echo "touch up"
|
echo "can_run" > "$FILE"
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while IFS='$\n' read -r line; do
|
while IFS='$\n' read -r line; do
|
||||||
[[ $(echo "$line" | grep TOUCH_UP) != "" ]] && run
|
if [[ $(echo "$line" | grep TOUCH_UP) != "" ]]; then
|
||||||
done < <(stdbuf -oL journalctl --user -feu libinput-events)
|
run
|
||||||
|
elif [[ $(echo "$line" | grep release) != "" ]]; then
|
||||||
|
run
|
||||||
|
elif [[ $(echo "$line" | grep 'TOUCH_DOWN.*1 (1)') != "" ]]; then
|
||||||
|
eww update cancel_touch=true
|
||||||
|
elif [[ $(echo "$line" | grep 'TOUCH_UP.*1 (1)') != "" ]]; then
|
||||||
|
eww update cancel_touch=false
|
||||||
|
else
|
||||||
|
echo "other" > "$FILE"
|
||||||
|
fi
|
||||||
|
done < <(stdbuf -oL libinput debug-events)
|
||||||
|
|
|
@ -90,10 +90,13 @@
|
||||||
;; Heart Toggle
|
;; Heart Toggle
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(defvar heart-ts "default")
|
(defvar heart-ts "default")
|
||||||
|
(defvar heart-run-off "false")
|
||||||
(defwidget heart-toggle-on []
|
(defwidget heart-toggle-on []
|
||||||
(eventbox :class "toggle-on"
|
(eventbox :class "toggle-on"
|
||||||
:onclick "$EWW_PATH/heart.sh toggle"
|
:onclick "$EWW_PATH/run.sh '$EWW_PATH/heart.sh toggle' heart-run-off &"
|
||||||
:cursor "pointer"
|
:cursor "pointer"
|
||||||
|
:onhover "eww update heart-run-off=true"
|
||||||
|
:onhoverlost "eww update heart-run-off=false"
|
||||||
|
|
||||||
(box :class "heart-toggle"
|
(box :class "heart-toggle"
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
|
@ -101,10 +104,13 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
(defvar heart-run-on "false")
|
||||||
(defwidget heart-toggle-off []
|
(defwidget heart-toggle-off []
|
||||||
(eventbox :class "toggle-off"
|
(eventbox :class "toggle-off"
|
||||||
:onclick "$EWW_PATH/heart.sh toggle"
|
:onclick "$EWW_PATH/run.sh '$EWW_PATH/heart.sh toggle' heart-run-on &"
|
||||||
:cursor "pointer"
|
:cursor "pointer"
|
||||||
|
:onhover "eww update heart-run-on=true"
|
||||||
|
:onhoverlost "eww update heart-run-on=false"
|
||||||
|
|
||||||
(box :class "heart-toggle"
|
(box :class "heart-toggle"
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
; this var starts all scripts needed when eww boots
|
; this var starts all scripts needed when eww boots
|
||||||
(deflisten heart_icon "$EWW_PATH/heart.sh startup")
|
(deflisten heart_icon "$EWW_PATH/heart.sh startup")
|
||||||
|
(defvar cancel_touch "false")
|
||||||
|
|
||||||
(deflisten notif_icon "$EWW_PATH/notif.sh icon")
|
(deflisten notif_icon "$EWW_PATH/notif.sh icon")
|
||||||
(deflisten mic_icon "$EWW_PATH/mic.sh icon")
|
(deflisten mic_icon "$EWW_PATH/mic.sh icon")
|
||||||
|
|
Loading…
Reference in a new issue