fix: fix tablet-toggle animation

This commit is contained in:
matt1432 2023-07-27 22:00:08 -04:00
parent 5862efb395
commit 5b3916e712
4 changed files with 35 additions and 6 deletions

View file

@ -46,10 +46,9 @@
;; Tablet Mode Toggle
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar tablet-ts false)
(defwidget tablet-toggle []
(eventbox :class {tablet-ts ? "toggle-on" : "toggle-off"}
:onclick {tablet-ts ? "$HYPR_PATH/laptop-mode.sh &" :
"$HYPR_PATH/tablet-mode.sh &"}
(defwidget tablet-toggle-on []
(eventbox :class "toggle-on"
:onclick "$HYPR_PATH/laptop-mode.sh &"
:cursor "pointer"
(box :class "tablet-toggle"
@ -58,6 +57,34 @@
)
)
)
(defwidget tablet-toggle-off []
(eventbox :class "toggle-off"
:onclick "$HYPR_PATH/tablet-mode.sh &"
:cursor "pointer"
(box :class "tablet-toggle"
:orientation "h"
(label :text " 󰦧 ")
)
)
)
(defwindow tablet
:monitor 0
:stacking "overlay"
:exclusive "ignore"
:geometry (geometry :x "72px"
:y "10px"
:width "0px"
:height "0px"
:anchor "top left"
)
(revealer
:transition "crossfade"
:reveal tablet-ts
:duration "550ms"
(tablet-toggle-on)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Heart Toggle
@ -112,7 +139,7 @@
:spacing 12
:orientation "h"
(osk-toggle-off)
(tablet-toggle)
(tablet-toggle-off)
(heart-toggle-off)
)
)

View file

@ -30,7 +30,7 @@ exec-once = $HYPR_PATH/osk-toggle.sh getState
# sometimes waybar starts after and stops me from pressing eww buttons
exec-once = bash -c "sleep 0.5; eww reload"
exec-once = bash -c "grep -q 󰣐 $HOME/.config/.heart && eww open heart && sleep 0.5 && eww update showh=true"
exec-once = bash -c "grep -q 󰣐 $HOME/.config/.heart && eww open heart && sleep 0.5 && eww update heart-ts=true"
exec-once = gnome-keyring-daemon --start --components=secrets
exec-once = squeekboard

View file

@ -7,4 +7,5 @@ brightnessctl -d tpacpi::kbd_backlight s 2
killall -r autorotate.sh
killall -r evtest
eww close tablet
eww update tablet-ts=false

View file

@ -13,4 +13,5 @@ evtest --grab "/dev/input/by-path/platform-AMDI0010:02-event-mouse" &
evtest --grab "/dev/input/by-path/platform-thinkpad_acpi-event" &
evtest --grab "/dev/video-bus" &
eww open tablet
eww update tablet-ts=true