feat: add eww widgets and remove stuff from waybar

This commit is contained in:
matt1432 2023-07-22 00:19:46 -04:00
parent 9b7b24ace1
commit fc18072aa5
8 changed files with 74 additions and 58 deletions

View file

@ -28,7 +28,7 @@
.cal-box { .cal-box {
font-family: Product Sans; font-family: Product Sans;
background-color: rgba(40, 42, 54, 0.8); background-color: rgba(40, 42, 54, 0.8);
border-radius: 15px; border-radius: 30px;
padding: 0 1rem .2rem; padding: 0 1rem .2rem;
color: $fg; color: $fg;
background-color: $bg; background-color: $bg;
@ -40,6 +40,7 @@
background-color: inherit; background-color: inherit;
padding: .5rem .10rem 0rem; padding: .5rem .10rem 0rem;
margin-left: 10px; margin-left: 10px;
border-radius: 30px;
& > * { & > * {
border: solid 0px transparent; border: solid 0px transparent;

View file

@ -13,7 +13,7 @@ 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" != "tablet-toggle" ]]; then if [[ "$element" != "left-bar" && "$element" != "right-bar" ]]; then
"$EWW_PATH"/close.sh "$element" "$EWW_PATH"/close.sh "$element"
fi fi
done done

View file

@ -1,20 +1,29 @@
.osk-toggle { .osk-toggle {
font-size: 30px; font-size: 30px;
min-height: 26px; min-height: 38px;
min-width: 50px; min-width: 50px;
padding: 0px 0px 0px 5px; padding: 0px 0px 0px 5px;
} }
.notif-panel {
min-width: 50px;
min-height: 26px;
font-size: 20px;
padding: 2px 25px 2px 35px;
}
.tablet-toggle { .tablet-toggle {
font-size: 26px; font-size: 26px;
padding: 2px 13px 2px 16px; min-height: 38px;
min-width: 50px;
padding: 0px 0px 0px 5px;
}
.heart-toggle {
font-size: 24px;
min-height: 38px;
min-width: 50px;
padding: 0px 0px 0px 4px;
}
.notif-panel {
font-size: 20px;
min-height: 34px;
min-width: 105px;
padding: 0px 0px 0px 5px;
} }
.toggle-off { .toggle-off {

View file

@ -1,78 +1,85 @@
(defvar osk-toggle-state false) (defvar osk-ts false)
(defwidget osk-toggle [] (defwidget osk-toggle []
(eventbox :class {osk-toggle-state ? "toggle-on" : "toggle-off"} (eventbox :class {osk-ts ? "toggle-on" : "toggle-off"}
:onclick "$HYPR_PATH/osk-toggle.sh toggle &" :onclick "$HYPR_PATH/osk-toggle.sh toggle &"
(box :class "osk-toggle" (box :class "osk-toggle"
:space-evenly true
:spacing 6
:orientation "h" :orientation "h"
(label :text " 󰌌 ") (label :text " 󰌌 ")
) )
) )
) )
(defwindow osk-toggle (defvar tablet-ts false)
:monitor 0
:stacking "overlay"
:exclusive "ignore"
:geometry (geometry :x "10px"
:y "9px"
:width "0px"
:height "0px"
:anchor "top left"
)
(osk-toggle)
)
(defvar toggle-state false)
(defwidget tablet-toggle [] (defwidget tablet-toggle []
(eventbox :class {toggle-state ? "toggle-on" : "toggle-off"} (eventbox :class {tablet-ts ? "toggle-on" : "toggle-off"}
:onclick {toggle-state ? "$HYPR_PATH/laptop-mode.sh &" : :onclick {tablet-ts ? "$HYPR_PATH/laptop-mode.sh &" :
"$HYPR_PATH/tablet-mode.sh &"} "$HYPR_PATH/tablet-mode.sh &"}
(box :class "tablet-toggle" (box :class "tablet-toggle"
:space-evenly true
:spacing 6
:orientation "h" :orientation "h"
(label :text " 󰦧 ") (label :text " 󰦧 ")
) )
) )
) )
(defwindow tablet-toggle (defvar heart-ts true)
(defvar heart-icon "󰣐")
(defwidget heart-toggle []
(eventbox :class {heart-ts ? "toggle-on" : "toggle-off"}
:onclick {heart-ts ? "eww update heart-icon= ; eww update heart-ts=false" :
"eww update heart-icon=󰣐 ; eww update heart-ts=true"}
(box :class "heart-toggle"
:orientation "h"
(label :text " ${heart-icon} ")
)
)
)
(defwidget left-bar []
(box :class "transparent"
:space-evenly true
:spacing 14
:orientation "h"
(osk-toggle)
(tablet-toggle)
(heart-toggle)
)
)
(defwindow left-bar
:monitor 0 :monitor 0
:stacking "overlay" :stacking "overlay"
:exclusive "ignore" :exclusive "ignore"
:geometry (geometry :x "72px" :geometry (geometry :x "10px"
:y "9px" :y "11px"
:width "0px" :width "0px"
:height "0px" :height "0px"
:anchor "top left" :anchor "top left"
) )
(tablet-toggle) (left-bar)
) )
(defvar notif-panel-state false) (defvar notif-panel-state false)
(defwidget notif-panel [] (defwidget notif-panel []
(button :class {notif-panel-state ? "toggle-on" : "toggle-off"} (button :class {notif-panel-state ? "toggle-on" : "toggle-off"}
:onclick {notif-panel-state ? "swaync-client -cp; eww update notif-panel-state=false" : :onclick {notif-panel-state ? "swaync-client -cp; eww update notif-panel-state=false" :
"swaync-client -op; eww update notif-panel-state=true"} "swaync-client -op; eww update notif-panel-state=true"}
(box :class "notif-panel" (box :class "notif-panel"
:space-evenly true
:spacing 6
:orientation "h" :orientation "h"
(label :text " ${notif_icon} ") (label :text " ${notif_icon} ")
) )
) )
) )
(defwindow notif-panel (defwidget right-bar []
(box :class "transparent"
:space-evenly true
:spacing 14
:orientation "h"
(notif-panel)
)
)
(defwindow right-bar
:monitor 0 :monitor 0
:stacking "overlay" :stacking "overlay"
:exclusive "ignore" :exclusive "ignore"
@ -82,5 +89,5 @@
:height "0px" :height "0px"
:anchor "top right" :anchor "top right"
) )
(notif-panel) (right-bar)
) )

View file

@ -21,9 +21,8 @@ exec-once = bash -c "sleep 5; nextcloud --background"
exec-once = bash -c "sleep 6; tutanota-desktop -a" exec-once = bash -c "sleep 6; tutanota-desktop -a"
exec-once = eww daemon exec-once = eww daemon
exec-once = eww open tablet-toggle exec-once = eww open left-bar
exec-once = eww open notif-panel exec-once = eww open right-bar
exec-once = eww open osk-toggle
# TODO: put this in eww configs? # TODO: put this in eww configs?
exec-once = $HYPR_PATH/osk-toggle.sh getState exec-once = $HYPR_PATH/osk-toggle.sh getState

View file

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

View file

@ -3,10 +3,10 @@
state () { state () {
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"
eww update osk-toggle-state=true eww update osk-ts=true
else else
echo "Stopped" echo "Stopped"
eww update osk-toggle-state=false eww update osk-ts=false
fi fi
} }
@ -14,11 +14,11 @@ 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
eww update osk-toggle-state=false eww update osk-ts=false
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
eww update osk-toggle-state=true eww update osk-ts=true
fi fi
} }

View file

@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
echo $XDG_DATA_DIRS >> ~/log.log echo "$XDG_DATA_DIRS" >> ~/log.log
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
brightnessctl -d tpacpi::kbd_backlight s 0 brightnessctl -d tpacpi::kbd_backlight s 0
$HYPR_PATH/autorotate.sh & "$HYPR_PATH"/autorotate.sh &
evtest --grab "/dev/input/by-path/platform-i8042-serio-0-event-kbd" & evtest --grab "/dev/input/by-path/platform-i8042-serio-0-event-kbd" &
evtest --grab "/dev/input/by-path/platform-i8042-serio-1-event-mouse" & evtest --grab "/dev/input/by-path/platform-i8042-serio-1-event-mouse" &
@ -13,4 +13,4 @@ evtest --grab "/dev/input/by-path/platform-AMDI0010:02-event-mouse" &
evtest --grab "/dev/input/by-path/platform-thinkpad_acpi-event" & evtest --grab "/dev/input/by-path/platform-thinkpad_acpi-event" &
evtest --grab "/dev/video-bus" & evtest --grab "/dev/video-bus" &
eww update toggle-state=true eww update tablet-ts=true