added a sysmon widget
This commit is contained in:
@@ -22,10 +22,11 @@
|
||||
(defwidget left []
|
||||
(box :orientation 'h'
|
||||
:class: 'left'
|
||||
:space-evenly true
|
||||
:space-evenly false
|
||||
:spacing 5
|
||||
:halign 'start'
|
||||
(hypr_workspaces)(hypr_active_window)))
|
||||
(hypr_workspaces)
|
||||
(hypr_active_window)))
|
||||
|
||||
|
||||
(defwidget center []
|
||||
@@ -33,7 +34,8 @@
|
||||
:class 'center'
|
||||
:space-evenly false
|
||||
:spacing 5
|
||||
(media)))
|
||||
(media)
|
||||
(sysmon)))
|
||||
|
||||
(defwidget right []
|
||||
(box
|
||||
|
@@ -5,3 +5,4 @@
|
||||
@import 'widgets/lorem-text';
|
||||
@import 'widgets/hypr_activewindow.scss';
|
||||
@import 'widgets/hypr_workspaces.scss';
|
||||
@import 'widgets/sysmon.scss';
|
||||
|
@@ -5,3 +5,4 @@
|
||||
(include "widgets/lorem-text.yuck")
|
||||
(include "widgets/hypr_workspaces.yuck")
|
||||
(include "widgets/hypr_activewindow.yuck")
|
||||
(include "widgets/sysmon.yuck")
|
||||
|
@@ -1,6 +1,6 @@
|
||||
.activewindow{
|
||||
background: #98C379;
|
||||
color: #ffffff;
|
||||
background: lightgreen;
|
||||
color: black;
|
||||
|
||||
&--xwayland{
|
||||
background: red;
|
||||
|
@@ -1,23 +1,19 @@
|
||||
.workspacecontainer{
|
||||
background: orange;
|
||||
|
||||
}
|
||||
|
||||
.workspace{
|
||||
border-radius: 1rem 1rem;
|
||||
margin: 6px;
|
||||
padding: 6px;
|
||||
font-family: 'Symbols Nerd Font Mono';
|
||||
font-size: 16px;
|
||||
border: 1px solid blue;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.wsactive{
|
||||
background: pink;
|
||||
color: red;
|
||||
background: red;
|
||||
}
|
||||
|
||||
.wsinactive{
|
||||
background: yellow;
|
||||
color: red;
|
||||
}
|
||||
|
@@ -9,12 +9,17 @@
|
||||
(defwidget hypr_workspaces []
|
||||
(box
|
||||
:class "workspacecontainer"
|
||||
:space-evenly true
|
||||
:space-evenly false
|
||||
:spacing 3
|
||||
(for workspace in workspaces
|
||||
(eventbox
|
||||
:width 20
|
||||
:height 20
|
||||
:onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
:tooltip "${workspace.name}"
|
||||
:class "workspace ${workspace.active == true ? 'wsactive' : 'wsinactive'}"
|
||||
"${workspace.windows > 0 ? workspaceIcons.full : workspaceIcons.empty}"))))
|
||||
|
||||
|
||||
(label
|
||||
:xalign 0
|
||||
:yalign 0.5
|
||||
:limit-width 1
|
||||
:text "${workspace.windows > 0 ? workspaceIcons.full : workspaceIcons.empty}")))))
|
||||
|
19
eww/widgets/sysmon.scss
Normal file
19
eww/widgets/sysmon.scss
Normal file
@@ -0,0 +1,19 @@
|
||||
.sysmon{
|
||||
background: darkred;
|
||||
color: black;
|
||||
}
|
||||
.danger{
|
||||
color: red
|
||||
}
|
||||
.ram{
|
||||
background: yellow;
|
||||
}
|
||||
.disk{
|
||||
background: lightblue;
|
||||
}
|
||||
.cpu{
|
||||
background: green;
|
||||
}
|
||||
.net{
|
||||
background: purple;
|
||||
}
|
51
eww/widgets/sysmon.yuck
Normal file
51
eww/widgets/sysmon.yuck
Normal file
@@ -0,0 +1,51 @@
|
||||
(defvar netiface "enp34s0")
|
||||
|
||||
(defwidget sysmon []
|
||||
(box
|
||||
:class 'sysmon'
|
||||
:space-evenly false
|
||||
:spacing 1
|
||||
(cpu)
|
||||
(ram)
|
||||
(disk)
|
||||
(net)))
|
||||
|
||||
(defwidget ram []
|
||||
(tooltip
|
||||
:class 'ram ${EWW_RAM.used_mem_perc > 90 ? 'danger' : ''}'
|
||||
(label :text " ${round(EWW_RAM.free_swap/1000000000, 2)} GB/${round(EWW_RAM.total_swap/1000000000, 2)} GB")
|
||||
(label :text " ${round(EWW_RAM.used_mem/1000000000, 2)} GB/${round(EWW_RAM.total_mem/1000000000, 2)} GB")))
|
||||
|
||||
(defwidget disk []
|
||||
(tooltip
|
||||
:class 'disk ${EWW_DISK["/"].used_perc > 90 ? 'danger' : ''}'
|
||||
(label :text " ${round(EWW_DISK["/"].free/1000000000, 2)} GB /${round(EWW_DISK["/"].total/1000000000, 2)} GB")
|
||||
(label :text " ${round(EWW_DISK["/"].used_perc,2)}%")))
|
||||
|
||||
(defwidget cpu []
|
||||
(tooltip
|
||||
:class 'cpu'
|
||||
(box :orientation "vertical"
|
||||
(for cpu in {EWW_CPU.cores}
|
||||
(box
|
||||
:orientation "horizontal"
|
||||
:space-evenly false
|
||||
:spacing 10
|
||||
(circular-progress
|
||||
:thickness 5
|
||||
:start-at 75
|
||||
:value {cpu.usage})
|
||||
(label
|
||||
:limit-width 6
|
||||
:show-truncated false
|
||||
:text "${cpu.core}: ")
|
||||
(label :text "${cpu.freq} Hz ${cpu.usage}%"))))
|
||||
(label :text " ${round(EWW_CPU.avg, 2)}%")))
|
||||
|
||||
(defwidget net []
|
||||
(box
|
||||
:class 'net'
|
||||
:space-evenly false
|
||||
(label :text "")
|
||||
(label :text " ${round(EWW_NET.enp34s0.NET_UP * 8 / 1000000, 2)} Mbit")
|
||||
(label :text " ${round(EWW_NET.enp34s0.NET_DOWN * 8 / 1000000, 2)} Mbit")))
|
Reference in New Issue
Block a user