Eww: More improvements to radio & css & powermenu
This commit is contained in:
45
modules/home/wayland/apps/eww/bar/windows/powermenu.yuck
Normal file
45
modules/home/wayland/apps/eww/bar/windows/powermenu.yuck
Normal file
@ -0,0 +1,45 @@
|
||||
(defwidget powermenu_entry [label icon onclick]
|
||||
(box :orientation "v" :space-evenly false :class "powermenu-entry"
|
||||
(button :class "powermenu-button" :onclick {onclick}
|
||||
:tooltip "${label}"
|
||||
(label :class "powermenu-icon" :text {icon})
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget powermenu []
|
||||
(box :orientation "h" :space-evenly true :valign "center" :halign "center" :class "powermenu-box"
|
||||
(powermenu_entry :label "Power off"
|
||||
:icon ""
|
||||
:onclick "systemctl poweroff")
|
||||
(powermenu_entry :label "Reboot"
|
||||
:icon ""
|
||||
:onclick "systemctl reboot")
|
||||
(powermenu_entry :label "Lock"
|
||||
:icon ""
|
||||
:onclick "sleep 0.1 && gtklock & eww close powermenu &")
|
||||
|
||||
(powermenu_entry :label "Suspend"
|
||||
:icon ""
|
||||
:onclick "sleep 0.1 && gtklock & systemctl suspend & eww close powermenu &")
|
||||
|
||||
(powermenu_entry :label "Sign out"
|
||||
:icon ""
|
||||
:onclick "hyprctl dispatch exit 0")
|
||||
|
||||
(powermenu_entry :label "Cancel"
|
||||
:icon ""
|
||||
:onclick "eww close powermenu")
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow powermenu
|
||||
:monitor 0
|
||||
:stacking "overlay"
|
||||
:geometry (geometry
|
||||
:anchor "center"
|
||||
:width "120%"
|
||||
:height "120%")
|
||||
:namespace "eww-blur"
|
||||
(powermenu)
|
||||
)
|
@ -12,8 +12,8 @@
|
||||
:x "0%"
|
||||
:y "0%"
|
||||
:anchor "bottom right"
|
||||
:width "200px"
|
||||
:height "300px")
|
||||
:width "0px"
|
||||
:height "0px")
|
||||
(radio-win))
|
||||
|
||||
|
||||
@ -32,9 +32,7 @@
|
||||
|
||||
(box
|
||||
:class "album_art"
|
||||
:vexpand "false"
|
||||
:hexpand "false"
|
||||
:style "background-size:cover; background-image: url('${radio.song.image600}');")
|
||||
:style "background-size:cover; background-image: url('${radio.song.image600?:'https://www.radiorecord.ru/upload/stations_images/record_image600_white_fill.png'}');")
|
||||
(box
|
||||
:space-evenly false
|
||||
:orientation "v"
|
||||
@ -42,14 +40,14 @@
|
||||
:halign "center"
|
||||
:class "song"
|
||||
:wrap "true"
|
||||
:limit-width 25
|
||||
:text "${radio.song.song}")
|
||||
:limit-width 18
|
||||
:text "${radio.song.song?:'...'}")
|
||||
(label
|
||||
:halign "center"
|
||||
:class "artist"
|
||||
:wrap "true"
|
||||
:limit-width 22
|
||||
:text "${radio.song.artist}")
|
||||
:text "${radio.song.artist?:'...'}")
|
||||
(box
|
||||
:space-evenly true
|
||||
:orientation "h"
|
||||
@ -61,9 +59,9 @@
|
||||
:onclick "${EWW_CMD} update radio_rev=${!radio_rev}"
|
||||
(box ""))
|
||||
|
||||
(button
|
||||
(button
|
||||
:class "btn_play"
|
||||
:timeout "1s"
|
||||
:timeout "2s"
|
||||
:onclick "scripts/radio toggle"
|
||||
"${radio.is_paused==1 ? "" : ""}")
|
||||
|
||||
@ -91,8 +89,8 @@
|
||||
|
||||
(for station in {radio.stations}
|
||||
(button
|
||||
:class "station_art"
|
||||
:timeout "1s"
|
||||
:class "station_art ${(radio.radio == station.id)?'station_sel':''}"
|
||||
:timeout "2s"
|
||||
:onclick "scripts/radio start ${station.id}"
|
||||
:tooltip "${station.title}"
|
||||
:style "background-size:cover; background-image: url('${station.icon_fill_white}');"
|
||||
@ -104,7 +102,7 @@
|
||||
|
||||
(defwidget radio-button []
|
||||
(button
|
||||
:onclick "${EWW_CMD} open --toggle radio"
|
||||
:onclick "${EWW_CMD} open --toggle --no-daemonize radio"
|
||||
(box
|
||||
:class "module"
|
||||
:orientation "v"
|
||||
|
@ -3,8 +3,8 @@
|
||||
(box
|
||||
:orientation "v"
|
||||
:space-evenly false
|
||||
(box :class "sys-label" "CPU")
|
||||
(box
|
||||
|
||||
:orientation "v"
|
||||
(for core in {EWW_CPU.cores}
|
||||
(box
|
||||
@ -27,22 +27,23 @@
|
||||
(box
|
||||
:orientation "v"
|
||||
:space-evenly false
|
||||
(box :class "sys-label" "GPU")
|
||||
(progress
|
||||
:value {gpu.devices[0].GRBM2.CommandProcessor-Compute.value}
|
||||
:value {gpu.devices[0].GRBM2?.CommandProcessor-Compute?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "Compute"
|
||||
)
|
||||
(progress
|
||||
:value {gpu.devices[0].GRBM2.CommandProcessor-Fetcher.value}
|
||||
:value {gpu.devices[0].GRBM2?.CommandProcessor-Fetcher?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "Fetcher"
|
||||
)
|
||||
(progress
|
||||
:value {gpu.devices[0].GRBM2.CommandProcessor-Graphics.value}
|
||||
:value {gpu.devices[0].GRBM2?.CommandProcessor-Graphics?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
@ -50,21 +51,21 @@
|
||||
)
|
||||
(box :class "spacer")
|
||||
(progress
|
||||
:value {gpu.devices[0].gpu_activity.GFX.value}
|
||||
:value {gpu.devices[0]?.gpu_activity?.GFX?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "GFX"
|
||||
)
|
||||
(progress
|
||||
:value {gpu.devices[0].gpu_activity.Memory.value}
|
||||
:value {gpu.devices[0]?.gpu_activity?.Memory?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "Memory"
|
||||
)
|
||||
(progress
|
||||
:value {gpu.devices[0].gpu_activity.MediaEngine.value}
|
||||
:value {gpu.devices[0]?.gpu_activity?.MediaEngine?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
@ -72,7 +73,7 @@
|
||||
)
|
||||
(box :class "spacer")
|
||||
(progress
|
||||
:value {100*gpu.devices[0].VRAM.TotalVRAMUsage.value/gpu.devices[0].VRAM.TotalVRAM.value}
|
||||
:value {100*(gpu.devices[0]?.VRAM?.TotalVRAMUsage?.value?:0.0)/(gpu.devices[0]?.VRAM?.TotalVRAM?.value?:1.0)}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
@ -83,7 +84,9 @@
|
||||
|
||||
(defwidget ram-sys-win []
|
||||
(box
|
||||
:orientation "v"
|
||||
:space-evenly false
|
||||
(box :class "sys-label" "RAM")
|
||||
(progress
|
||||
:value {100*memory.used/memory.total}
|
||||
:orientation "h"
|
||||
|
Reference in New Issue
Block a user