✨ eww: add new tiles to control-center, new notification popup, new styles for a lot of widgets
This commit is contained in:
@@ -23,9 +23,8 @@
|
||||
:text "${application_name}")
|
||||
)
|
||||
(button :class "close"
|
||||
:style "border-radius: 10px; padding: 6px; padding-left: 10px; padding-right: 10px;"
|
||||
:onclick "${onclickclose}"
|
||||
:visible false ; Temporary, will try doing something to remove history items
|
||||
:visible true
|
||||
"")
|
||||
)
|
||||
|
||||
@@ -43,7 +42,7 @@
|
||||
:space-evenly false
|
||||
|
||||
(label :class "summary"
|
||||
:text "${summary}"
|
||||
:markup "${summary}"
|
||||
:xalign 0
|
||||
:halign "start"
|
||||
:show-truncated true)
|
||||
|
||||
@@ -1,54 +1,38 @@
|
||||
(defwidget notifications []
|
||||
(box :class "cc-notifications"
|
||||
:orientation "vertical"
|
||||
:space-evenly false
|
||||
|
||||
(scroll :class "vertical-scroll"
|
||||
:hscroll false
|
||||
:vscroll true
|
||||
:hexpand true
|
||||
:vexpand true
|
||||
:height 500
|
||||
:style "border-radius: 16px;"
|
||||
(scroll :class "cc-notifications scroll"
|
||||
:hscroll false
|
||||
:vscroll true
|
||||
:vexpand true
|
||||
:style "border-radius: 16px;"
|
||||
|
||||
(box :class "notifications"
|
||||
:orientation "vertical"
|
||||
:space-evenly false
|
||||
|
||||
|
||||
(for notification in json_notifications
|
||||
(notification :application_name "${notification.app-name.data}"
|
||||
:image "${notification.app-icon.data}"
|
||||
:summary "${notification.summary.data}"
|
||||
:body "${notification.body.data}"
|
||||
:onclick "makoctl invoke -n ${notification.id.data} view"
|
||||
:icon "${notification.app-name.data}"
|
||||
)
|
||||
)
|
||||
|
||||
(box :class "empty-notifications"
|
||||
:visible { arraylength(json_notifications) == 0 ? true : false }
|
||||
:style "margin-top: 50px;"
|
||||
:space-evenly false
|
||||
:orientation "vertical"
|
||||
:halign "center"
|
||||
|
||||
(label :class "bell-icon"
|
||||
:text ""
|
||||
:style "font-size: 96px")
|
||||
|
||||
(label :text "You're done!"
|
||||
:style "margin-left: 12px;")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(box :class "bottom button-row"
|
||||
:halign "end"
|
||||
(box :class "notifications"
|
||||
:orientation "vertical"
|
||||
:space-evenly false
|
||||
(button :class "clear-all"
|
||||
:onclick { arraylength(json_notifications) > 0 ? "pkill mako; hyprctl dispatch exec mako" : "" }
|
||||
" Clear")
|
||||
|
||||
(for notification in { json_notification_history["history"] }
|
||||
(notification :application_name "${notification.app-name.data}"
|
||||
:image "${notification.app-icon.data}"
|
||||
:summary "${notification.summary.data}"
|
||||
:body "${notification.body.data}"
|
||||
:onclickclose "sh scripts/notification-remove.sh ${notification.id.data}"
|
||||
:icon "${notification.app-name.data}")
|
||||
)
|
||||
|
||||
(box :class "empty-notifications"
|
||||
:visible { arraylength(json_notification_history["history"]) == 0 }
|
||||
:style "margin-top: 50px;"
|
||||
:space-evenly false
|
||||
:orientation "vertical"
|
||||
:halign "center"
|
||||
:valign "center"
|
||||
|
||||
(label :class "bell-icon"
|
||||
:text ""
|
||||
:style "font-size: 96px")
|
||||
|
||||
(label :text "You're done!"
|
||||
:style "margin-left: 12px;")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
(defwidget tiles []
|
||||
(box :class "tiles-grid"
|
||||
:orientation "vertical"
|
||||
(box :class "tiles tiles1"
|
||||
(tile :icon ''
|
||||
:label "Network"
|
||||
:enabled { network_status == "full" ? true : false }
|
||||
:onenable "nmcli n on"
|
||||
:ondisable "nmcli n off"
|
||||
:visible true
|
||||
:class "network")
|
||||
|
||||
(tile :icon ''
|
||||
:label "Bluetooth"
|
||||
:enabled { bluetooth_powered == "yes" ? true : false }
|
||||
:onenable "bluetoothctl power on"
|
||||
:ondisable "bluetoothctl power off"
|
||||
:visible true)
|
||||
|
||||
(tile :icon ''
|
||||
:label "Do Not Disturb"
|
||||
:enabled { notification_modes =~ "dnd" ? true : false }
|
||||
:onenable "makoctl mode -a dnd"
|
||||
:ondisable "makoctl mode -r dnd"
|
||||
:visible true
|
||||
:class "dnd")
|
||||
)
|
||||
(box :class "tiles tiles2"
|
||||
:visible true
|
||||
(tile :icon ''
|
||||
:label "Airplane Mode"
|
||||
:enabled { (network_status != "full" && network_status != "partial") && bluetooth_powered != "yes" ? true : false }
|
||||
:onenable "bluetoothctl power off; nmcli n off"
|
||||
:ondisable "bluetoothctl power on; nmcli n on")
|
||||
(tile :icon ''
|
||||
:label "Screen Record"
|
||||
:enabled "${is_recording}"
|
||||
:onenable "hyprctl dispatch exec \"sh $HOME/.config/eww/scripts/screen-recording.sh\" >> /dev/null"
|
||||
:ondisable "kill $(cat $HOME/.cache/recording.pid)"
|
||||
:class "screen-rec")
|
||||
(tile :icon ''
|
||||
:label "Night Light"
|
||||
:enabled "${night_light}"
|
||||
:onenable "hyprctl dispatch exec \"sh $HOME/.config/eww/scripts/night-light.sh\""
|
||||
:ondisable "kill $(cat $HOME/.cache/night-light.pid)"
|
||||
:class "night-light")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget tile [ ?class icon label ?onclickarrow ?enabled onenable ondisable ?visible ?min-width ]
|
||||
(checkbox :onchecked "${onenable}"
|
||||
:onunchecked "${ondisable}"
|
||||
:visible { visible == "" || visible ? true : false }
|
||||
:checked { enabled == "" || !enabled ? false : true }
|
||||
:class "tile-checkbox ${class}"
|
||||
|
||||
(box :class "tile"
|
||||
:space-evenly false
|
||||
:valign "center"
|
||||
|
||||
(label :text "${icon}"
|
||||
:class "icon"
|
||||
:unindent true
|
||||
:limit-width 1
|
||||
:show-truncated false
|
||||
:xalign 0)
|
||||
|
||||
(label :text "${label}"
|
||||
:class "label"
|
||||
:xalign 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1,61 +0,0 @@
|
||||
(defwidget toggles []
|
||||
(box :class "toggles-grid"
|
||||
:orientation "vertical"
|
||||
(box :class "toggles toggles1"
|
||||
(_toggle :icon ''
|
||||
:label "Network"
|
||||
:enabled { network_status == "full" ? true : false }
|
||||
:onenable "nmcli n on"
|
||||
:ondisable "nmcli n off"
|
||||
:visible true
|
||||
:class "network")
|
||||
(_toggle :icon ''
|
||||
:label "Bluetooth"
|
||||
:enabled { bluetooth_powered == "yes" ? true : false }
|
||||
:onenable "bluetoothctl power on"
|
||||
:ondisable "bluetoothctl power off"
|
||||
:visible true)
|
||||
(_toggle :icon ''
|
||||
:label "Do Not Disturb"
|
||||
:show-arrow false
|
||||
:enabled { notification_modes =~ "dnd" ? true : false }
|
||||
:onenable "makoctl mode -a dnd"
|
||||
:ondisable "makoctl mode -r dnd"
|
||||
:visible true
|
||||
:class "dnd")
|
||||
)
|
||||
(box :class "toggles toggles2"
|
||||
:visible false
|
||||
(_toggle :icon ''
|
||||
:label "Airplane Mode"
|
||||
:show-arrow false
|
||||
:onenable "notify-send -a 'Airplane Mode' 'Toggle AP mode!'"
|
||||
:ondisable ""
|
||||
:visible true)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget _toggle [ ?class icon label ?onclickarrow ?enabled onenable ondisable visible ?min-width ]
|
||||
(checkbox :onchecked "${onenable}"
|
||||
:onunchecked "${ondisable}"
|
||||
:checked { enabled == true ? true : false }
|
||||
:class "toggle-checkbox ${class}"
|
||||
|
||||
(box :class "toggle"
|
||||
:space-evenly false
|
||||
:valign "center"
|
||||
|
||||
(label :text "${icon}"
|
||||
:class "icon"
|
||||
:unindent true
|
||||
:limit-width 1
|
||||
:show-truncated false
|
||||
:xalign 0)
|
||||
|
||||
(label :text "${label}"
|
||||
:class "label"
|
||||
:xalign 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user