feat(eww): add notif-panel anim and hack around swaync bugs
This commit is contained in:
parent
0a9473c071
commit
e4ac599ce5
8 changed files with 131 additions and 31 deletions
|
@ -1,6 +1,8 @@
|
||||||
what is currently not working:
|
what is currently not working:
|
||||||
- plymouth theme has no login prompt
|
- plymouth theme has no login prompt
|
||||||
- sddm theme flashes white
|
- sddm theme flashes white
|
||||||
|
- fixme: swaync acts up with eww
|
||||||
|
- autosign in to keyring
|
||||||
|
|
||||||
what i want to do:
|
what i want to do:
|
||||||
- learn flakes
|
- learn flakes
|
||||||
|
|
|
@ -1,9 +1,39 @@
|
||||||
(defwidget closer []
|
(defwidget closer []
|
||||||
(eventbox :onclick "$EWW_PATH/close-opened.sh && eww close closer"))
|
(eventbox :onclick "$EWW_PATH/close-opened.sh && eww close closer")
|
||||||
|
)
|
||||||
(defwindow closer
|
(defwindow closer :monitor 0
|
||||||
:monitor 0
|
:geometry (geometry :width "100%"
|
||||||
:geometry (geometry :width "100%" :height "100%")
|
:height "100%")
|
||||||
:stacking "overlay"
|
:stacking "overlay"
|
||||||
:focusable false
|
:focusable false
|
||||||
(closer :window ""))
|
(closer :window "")
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwidget closer-notif []
|
||||||
|
(eventbox :onclick "$EWW_PATH/notif-toggle.sh off")
|
||||||
|
)
|
||||||
|
(defwindow closer-notif1 :monitor 0
|
||||||
|
:geometry (geometry :width "1412px"
|
||||||
|
:height "1200px")
|
||||||
|
:stacking "overlay"
|
||||||
|
:focusable false
|
||||||
|
:exclusive "ignore"
|
||||||
|
(closer-notif)
|
||||||
|
)
|
||||||
|
(defwindow closer-notif2 :monitor 0
|
||||||
|
:geometry (geometry :width "100%"
|
||||||
|
:height "200px"
|
||||||
|
:y "1063px")
|
||||||
|
:stacking "overlay"
|
||||||
|
:focusable false
|
||||||
|
:exclusive "ignore"
|
||||||
|
(closer-notif)
|
||||||
|
)
|
||||||
|
(defwindow closer-notif3 :monitor 0
|
||||||
|
:geometry (geometry :width "100%"
|
||||||
|
:height "63px")
|
||||||
|
:stacking "overlay"
|
||||||
|
:focusable false
|
||||||
|
:exclusive "ignore"
|
||||||
|
(closer-notif)
|
||||||
|
)
|
||||||
|
|
|
@ -7,13 +7,18 @@ readarray -t array <<< "$(eww windows | grep '^\*')"
|
||||||
for ((i=0; i<${#array[@]}; i++))
|
for ((i=0; i<${#array[@]}; i++))
|
||||||
do
|
do
|
||||||
array[i]=${array[i]#'*'}
|
array[i]=${array[i]#'*'}
|
||||||
array[i]=${array[i]%-reveal}
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Close every window except permanent ones
|
# Close every window except permanent ones
|
||||||
for element in "${array[@]}"
|
for element in "${array[@]}"
|
||||||
do
|
do
|
||||||
if [[ "$element" != "left-bar" && "$element" != "right-bar" ]]; then
|
[[ "$element" != "left-bar" ]] &&
|
||||||
"$EWW_PATH"/close.sh "$element"
|
[[ "$element" != "notif-panel" ]] &&
|
||||||
fi
|
[[ "$element" != "notif-panel-on" ]] &&
|
||||||
|
[[ "$element" != "heart" ]] &&
|
||||||
|
[[ "$element" != "osk" ]] &&
|
||||||
|
[[ "$element" != "tablet" ]] &&
|
||||||
|
[[ "$element" != "quick-settings-toggle" ]] &&
|
||||||
|
#[[ "$element" != "" ]] &&
|
||||||
|
eww close "$element"
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
WINDOW="$1"
|
|
||||||
(
|
|
||||||
eww update "$WINDOW"-visible=false
|
|
||||||
#sleep .55
|
|
||||||
eww close "$WINDOW"-reveal
|
|
||||||
) &
|
|
40
config/eww/scripts/notif-toggle.sh
Executable file
40
config/eww/scripts/notif-toggle.sh
Executable file
|
@ -0,0 +1,40 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
on() {
|
||||||
|
# open notif panel
|
||||||
|
swaync-client -op
|
||||||
|
|
||||||
|
# open closers when outside control center
|
||||||
|
eww open closer-notif1
|
||||||
|
eww open closer-notif2
|
||||||
|
eww open closer-notif3
|
||||||
|
|
||||||
|
# reload waybar to draw over closers
|
||||||
|
#killall -r -SIGUSR2 waybar &&
|
||||||
|
|
||||||
|
# re open eww widgets over closers # FIXME: ??
|
||||||
|
eww close notif-panel; eww open notif-panel &&
|
||||||
|
eww open notif-panel-on
|
||||||
|
eww update notif-panel-state=true
|
||||||
|
|
||||||
|
eww close quick-settings-toggle; eww open quick-settings-toggle
|
||||||
|
#eww close left-bar; eww open left-bar
|
||||||
|
|
||||||
|
#if eww get osk-ts; then eww close osk; eww open osk; fi
|
||||||
|
#if eww get tablet-ts; then eww close tablet; eww open tablet; fi
|
||||||
|
#if eww get heart-ts; then eww close heart; eww open heart; fi
|
||||||
|
}
|
||||||
|
|
||||||
|
off() {
|
||||||
|
swaync-client -cp
|
||||||
|
eww close notif-panel-on
|
||||||
|
|
||||||
|
eww update notif-panel-state=false
|
||||||
|
|
||||||
|
eww close closer-notif1
|
||||||
|
eww close closer-notif2
|
||||||
|
eww close closer-notif3
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ "$1" == "on" ]] && on
|
||||||
|
[[ "$1" == "off" ]] && off
|
|
@ -4,7 +4,6 @@ state () {
|
||||||
if [[ $(hyprctl layers | grep swaync-control-center) == "" ]]; then
|
if [[ $(hyprctl layers | grep swaync-control-center) == "" ]]; then
|
||||||
if [[ $(eww get notif-panel-state) == "true" ]]; then
|
if [[ $(eww get notif-panel-state) == "true" ]]; then
|
||||||
eww update notif-panel-state=false
|
eww update notif-panel-state=false
|
||||||
eww reload
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,10 +188,9 @@
|
||||||
;; Notification Panel Toggle
|
;; Notification Panel Toggle
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(defvar notif-panel-state false)
|
(defvar notif-panel-state false)
|
||||||
(defwidget notif-panel []
|
(defwidget notif-panel-on []
|
||||||
(eventbox :class {notif-panel-state ? "toggle-on" : "toggle-off"}
|
(eventbox :class "toggle-on"
|
||||||
:onclick {notif-panel-state ? "swaync-client -cp; eww update notif-panel-state=false" :
|
:onclick "$EWW_PATH/notif-toggle.sh off"
|
||||||
"swaync-client -op; eww update notif-panel-state=true"}
|
|
||||||
:cursor "pointer"
|
:cursor "pointer"
|
||||||
|
|
||||||
(box :class "notif-panel"
|
(box :class "notif-panel"
|
||||||
|
@ -200,6 +199,18 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
(defwidget notif-panel-off []
|
||||||
|
(eventbox :class "toggle-off"
|
||||||
|
:onclick "$EWW_PATH/notif-toggle.sh on"
|
||||||
|
:cursor "pointer"
|
||||||
|
|
||||||
|
(box :class "notif-panel"
|
||||||
|
:orientation "h"
|
||||||
|
(label :text " ${notif_icon} ")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
(defwindow notif-panel
|
(defwindow notif-panel
|
||||||
:monitor 0
|
:monitor 0
|
||||||
:stacking "overlay"
|
:stacking "overlay"
|
||||||
|
@ -210,5 +221,22 @@
|
||||||
:height "0px"
|
:height "0px"
|
||||||
:anchor "top right"
|
:anchor "top right"
|
||||||
)
|
)
|
||||||
(notif-panel)
|
(notif-panel-off)
|
||||||
|
)
|
||||||
|
(defwindow notif-panel-on
|
||||||
|
:monitor 0
|
||||||
|
:stacking "overlay"
|
||||||
|
:exclusive "ignore"
|
||||||
|
:geometry (geometry :x "60px"
|
||||||
|
:y "10px"
|
||||||
|
:width "0px"
|
||||||
|
:height "0px"
|
||||||
|
:anchor "top right"
|
||||||
|
)
|
||||||
|
(revealer
|
||||||
|
:transition "crossfade"
|
||||||
|
:reveal notif-panel-state
|
||||||
|
:duration "550ms"
|
||||||
|
(notif-panel-on)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,17 +7,21 @@ state () {
|
||||||
eww update osk-ts=true
|
eww update osk-ts=true
|
||||||
else
|
else
|
||||||
echo "Stopped"
|
echo "Stopped"
|
||||||
|
if [[ $(eww windows | grep '*osk') != "" ]]; then
|
||||||
eww close osk
|
eww close osk
|
||||||
eww update osk-ts=false
|
eww update osk-ts=false
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle () {
|
toggle () {
|
||||||
if [[ $(busctl get-property --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 Visible) == "b true" ]]; then
|
if [[ $(busctl get-property --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 Visible) == "b true" ]]; then
|
||||||
echo "Running"
|
echo "Running"
|
||||||
busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
|
busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
|
||||||
|
if [[ $(eww windows | grep '*osk') != "" ]]; then
|
||||||
eww close osk
|
eww close osk
|
||||||
eww update osk-ts=false
|
eww update osk-ts=false
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Stopped"
|
echo "Stopped"
|
||||||
busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
|
busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
|
||||||
|
|
Loading…
Reference in a new issue