feat: add some stuff for eww

This commit is contained in:
matt1432 2023-08-22 21:15:03 -04:00
parent 914a6950e3
commit c0175571fd
5 changed files with 14 additions and 7 deletions

View file

@ -1,4 +1,5 @@
(defvar showqs false) (defvar showqs false)
(defvar showplayer false)
(defwidget quick-settings-smol [] (defwidget quick-settings-smol []
(box :class "quick-settings-smol" (box :class "quick-settings-smol"
@ -321,9 +322,11 @@
:style "margin-bottom: 10px;" :style "margin-bottom: 10px;"
(label) (label)
(eventbox :cursor "pointer" (revealer :reveal showplayer
:onclick "${expand_player == 'true' ? 'eww update expand_player=false' : 'eww update expand_player=true'}" (eventbox :cursor "pointer"
"${expand_player == 'true' ? ' ' : ' ' }" :onclick "${expand_player == 'true' ? 'eww update expand_player=false' : 'eww update expand_player=true'}"
"${expand_player == 'true' ? ' ' : ' ' }"
)
) )
(label) (label)

View file

@ -71,9 +71,11 @@ get_cover() {
get_accents get_accents
fi fi
if [[ -f "/tmp/cover.jpg" ]]; then if [[ -s "/tmp/cover.jpg" ]]; then
eww update showplayer=true
echo "/tmp/cover.jpg" echo "/tmp/cover.jpg"
else else
eww update showplayer=false
echo "randomfile" echo "randomfile"
fi fi
} }

View file

@ -40,7 +40,6 @@
border-right: 2px solid $contrastbg; border-right: 2px solid $contrastbg;
min-height: 14px; min-height: 14px;
min-width: 105px; min-width: 105px;
margin-top: -10px;
background-color: $bg; background-color: $bg;
transition: all 0.5s; transition: all 0.5s;
} }

View file

@ -128,6 +128,7 @@
(defwidget notif-panel [] (defwidget notif-panel []
(box :orientation "v" (box :orientation "v"
:space-evenly false :space-evenly false
:spacing 0
(eventbox :class "${notif-panel-state == 'true' ? 'toggle-on' : 'toggle-off'}" (eventbox :class "${notif-panel-state == 'true' ? 'toggle-on' : 'toggle-off'}"
:onclick "${notif-panel-state == 'true' ? turn-notif-off : turn-notif-on}" :onclick "${notif-panel-state == 'true' ? turn-notif-off : turn-notif-on}"
:cursor "pointer" :cursor "pointer"
@ -139,7 +140,9 @@
(label :text " ${notif_icon} ") (label :text " ${notif_icon} ")
) )
) )
(expander :expanded notif-panel-state (revealer :reveal notif-panel-state
:duration anim_duration
:transition "slideup"
:height 0 :height 0
(box :class "filler" (box :class "filler"
:height 0 :height 0

View file

@ -20,7 +20,7 @@
(deflisten br_icon "$EWW_PATH/brightness.sh icon") (deflisten br_icon "$EWW_PATH/brightness.sh icon")
(defpoll br :interval "1s" "$EWW_PATH/brightness.sh br") (defpoll br :interval "1s" "$EWW_PATH/brightness.sh br")
(defvar anim_duration "550ms") (defvar anim_duration "200ms")
(defpoll completeday :interval "1h" "date '+%A, %d %B'") (defpoll completeday :interval "1h" "date '+%A, %d %B'")
(defpoll lithour :interval "30m" "date +%H") (defpoll lithour :interval "30m" "date +%H")