added new widgets
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
tooltip {
|
tooltip {
|
||||||
background: #2E3440;
|
background: #2E3440;
|
||||||
color: #E5E6E7;
|
color: #E5E6E7;
|
||||||
|
padding: 3px 1rem;
|
||||||
border-radius: 1.5rem 1rem;
|
border-radius: 1.5rem 1rem;
|
||||||
border: 1px solid #6F7175;
|
border: 1px solid #6F7175;
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,8 @@
|
|||||||
:space-evenly true
|
:space-evenly true
|
||||||
:spacing 5
|
:spacing 5
|
||||||
:halign 'start'
|
:halign 'start'
|
||||||
(loremText :text "Workspaces")
|
(hypr_workspaces)
|
||||||
|
(hypr_active_window)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -57,6 +58,7 @@
|
|||||||
:space-evenly false
|
:space-evenly false
|
||||||
:spacing 5
|
:spacing 5
|
||||||
(media)
|
(media)
|
||||||
|
(sysmon)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -68,8 +70,10 @@
|
|||||||
:spacing 5
|
:spacing 5
|
||||||
:halign 'end'
|
:halign 'end'
|
||||||
(hyprsunset)
|
(hyprsunset)
|
||||||
|
(volume)
|
||||||
(datetime)
|
(datetime)
|
||||||
(stray)
|
(stray)
|
||||||
|
(swaync)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
12
.config/eww/scripts/getvol
Normal file
12
.config/eww/scripts/getvol
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if command -v pamixer &>/dev/null; then
|
||||||
|
if [ true == $(pamixer --get-mute) ]; then
|
||||||
|
echo 0
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
pamixer --get-volume
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
amixer -D pulse sget Master | awk -F '[^0-9]+' '/Left:/{print $3}'
|
||||||
|
fi
|
@@ -1,5 +1,10 @@
|
|||||||
|
@import 'widgets/lorem-text';
|
||||||
@import 'widgets/media';
|
@import 'widgets/media';
|
||||||
@import 'widgets/datetime.scss';
|
@import 'widgets/datetime.scss';
|
||||||
@import 'widgets/systray';
|
@import 'widgets/systray';
|
||||||
@import 'widgets/hyprsunset';
|
@import 'widgets/hyprsunset';
|
||||||
@import 'widgets/lorem-text';
|
@import 'widgets/hypr_activewindow.scss';
|
||||||
|
@import 'widgets/hypr_workspaces.scss';
|
||||||
|
@import 'widgets/sysmon.scss';
|
||||||
|
@import 'widgets/swaync.scss';
|
||||||
|
@import 'widgets/volume.scss';
|
||||||
|
@@ -1,5 +1,10 @@
|
|||||||
|
(include "widgets/lorem-text.yuck")
|
||||||
(include "widgets/media.yuck")
|
(include "widgets/media.yuck")
|
||||||
(include "widgets/datetime.yuck")
|
(include "widgets/datetime.yuck")
|
||||||
(include "widgets/systray.yuck")
|
(include "widgets/systray.yuck")
|
||||||
(include "widgets/hyprsunset.yuck")
|
(include "widgets/hyprsunset.yuck")
|
||||||
(include "widgets/lorem-text.yuck")
|
(include "widgets/hypr_workspaces.yuck")
|
||||||
|
(include "widgets/hypr_activewindow.yuck")
|
||||||
|
(include "widgets/sysmon.yuck")
|
||||||
|
(include "widgets/swaync.yuck")
|
||||||
|
(include "widgets/volume.yuck")
|
||||||
|
9
.config/eww/widgets/hypr_activewindow.scss
Normal file
9
.config/eww/widgets/hypr_activewindow.scss
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
.activewindow{
|
||||||
|
background: lightgreen;
|
||||||
|
color: black;
|
||||||
|
|
||||||
|
&--xwayland{
|
||||||
|
background: maroon;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
32
.config/eww/widgets/hypr_activewindow.yuck
Normal file
32
.config/eww/widgets/hypr_activewindow.yuck
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
(deflisten activewindow :initial "..." "hyprman -a 2>>/tmp/eww_hyprman_activewindow.log")
|
||||||
|
|
||||||
|
(defvar windowIcons
|
||||||
|
`{
|
||||||
|
"generic": "",
|
||||||
|
"spotify": "",
|
||||||
|
"mpv": "",
|
||||||
|
"firefox": "",
|
||||||
|
"chromium": "",
|
||||||
|
"zen": "",
|
||||||
|
"Alacritty": "",
|
||||||
|
"steam": "",
|
||||||
|
"discord": ""
|
||||||
|
}`)
|
||||||
|
|
||||||
|
(defwidget windowIcon []
|
||||||
|
(image
|
||||||
|
:icon-size: 12
|
||||||
|
:icon {activewindow.class}))
|
||||||
|
|
||||||
|
(defwidget hypr_active_window []
|
||||||
|
(tooltip
|
||||||
|
(label :text {activewindow.title})
|
||||||
|
(box
|
||||||
|
:class "activewindow${activewindow.xwayland == true ? '--xwayland' : ''}"
|
||||||
|
:halign "left"
|
||||||
|
:valign "center"
|
||||||
|
:spacing 3
|
||||||
|
(label
|
||||||
|
:limit-width 25
|
||||||
|
:unindent true
|
||||||
|
:text "${windowIcons[activewindow.class] ?: windowIcons['generic']} ${activewindow.class}"))))
|
35
.config/eww/widgets/hypr_workspaces.scss
Normal file
35
.config/eww/widgets/hypr_workspaces.scss
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
.workspaces {
|
||||||
|
/* Green */
|
||||||
|
$light: #bad012;
|
||||||
|
$dark: #53730a;
|
||||||
|
|
||||||
|
/* Orange */
|
||||||
|
//$light: #fde10e;
|
||||||
|
//$dark: #ff6520;
|
||||||
|
|
||||||
|
background: $dark;
|
||||||
|
padding: 3px 1rem;
|
||||||
|
|
||||||
|
&--ws {
|
||||||
|
border-radius: 50%;
|
||||||
|
font-family: 'Symbols Nerd Font Mono';
|
||||||
|
border: 1px solid blue;
|
||||||
|
color: black;
|
||||||
|
|
||||||
|
&--label {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--active {
|
||||||
|
background: $light;
|
||||||
|
color: $dark;
|
||||||
|
border-color: $light;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--inactive {
|
||||||
|
background: $dark;
|
||||||
|
color: $dark;
|
||||||
|
border-color: $light;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
24
.config/eww/widgets/hypr_workspaces.yuck
Normal file
24
.config/eww/widgets/hypr_workspaces.yuck
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
(deflisten workspaces :initial "" "hyprman -w 2>>/tmp/eww_hyprman_workspaces.log")
|
||||||
|
|
||||||
|
(defvar workspaceIcons '{
|
||||||
|
"empty": "",
|
||||||
|
"full": "",
|
||||||
|
"focused": ""
|
||||||
|
}')
|
||||||
|
|
||||||
|
(defwidget hypr_workspaces []
|
||||||
|
(box
|
||||||
|
:class "workspaces"
|
||||||
|
:space-evenly false
|
||||||
|
:spacing 3
|
||||||
|
(for workspace in workspaces
|
||||||
|
(eventbox
|
||||||
|
:height 20
|
||||||
|
:width 20
|
||||||
|
:onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||||
|
:cursor "pointer"
|
||||||
|
:tooltip "${workspace.name}"
|
||||||
|
:class "workspaces--ws ${workspace.active == true ? 'workspaces--ws--active' : 'workspaces--ws--inactive'}"
|
||||||
|
(label
|
||||||
|
:class "workspaces--ws--label"
|
||||||
|
:text "${workspace.windows > 0 ? workspaceIcons.full : workspaceIcons.empty}")))))
|
13
.config/eww/widgets/swaync.scss
Normal file
13
.config/eww/widgets/swaync.scss
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
.swaync{
|
||||||
|
background: aqua;
|
||||||
|
color: black;
|
||||||
|
&--dnd{
|
||||||
|
background: rosybrown;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
&--inhib{
|
||||||
|
background: indianred;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
19
.config/eww/widgets/swaync.yuck
Normal file
19
.config/eww/widgets/swaync.yuck
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
(deflisten notification :initial '{ "count": 0, "dnd": false, "visible": false, "inhibited": false }' "swaync-client -s")
|
||||||
|
|
||||||
|
(defvar swaync_icon_act "")
|
||||||
|
(defvar swaync_icon_inh "")
|
||||||
|
(defvar swaync_icon_dnd "")
|
||||||
|
|
||||||
|
(defwidget swaync []
|
||||||
|
(eventbox
|
||||||
|
:class "swaync${notification.dnd == true ? " swaync--dnd" : ""}${notification.inhibited == true ? " swaync--inhib" : ""}"
|
||||||
|
:cursor "pointer"
|
||||||
|
:onclick "swaync-client -t"
|
||||||
|
:onmiddleclick "swaync-client -d"
|
||||||
|
:onrightclick "swaync-client -C"
|
||||||
|
(box
|
||||||
|
:orientation "horizontal"
|
||||||
|
:spacing 3
|
||||||
|
:space-evenly false
|
||||||
|
(label :text "${notification.dnd == true ? swaync_icon_dnd : notification.inhibited == true ? swaync_icon_inh : swaync_icon_act}")
|
||||||
|
(label :text "${notification.count}"))))
|
19
.config/eww/widgets/sysmon.scss
Normal file
19
.config/eww/widgets/sysmon.scss
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
.sysmon{
|
||||||
|
background: transparent;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
.danger{
|
||||||
|
color: red
|
||||||
|
}
|
||||||
|
.ram{
|
||||||
|
background: tan;
|
||||||
|
}
|
||||||
|
.disk{
|
||||||
|
background: mediumturquoise;
|
||||||
|
}
|
||||||
|
.cpu{
|
||||||
|
background: lightgreen;
|
||||||
|
}
|
||||||
|
.net{
|
||||||
|
background: plum;
|
||||||
|
}
|
51
.config/eww/widgets/sysmon.yuck
Normal file
51
.config/eww/widgets/sysmon.yuck
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
(defvar netiface "eno1")
|
||||||
|
|
||||||
|
(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[netiface].NET_UP * 8 / 1000000, 2)} Mbit")
|
||||||
|
(label :text " ${round(EWW_NET[netiface].NET_DOWN * 8 / 1000000, 2)} Mbit")))
|
12
.config/eww/widgets/volume.scss
Normal file
12
.config/eww/widgets/volume.scss
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
.sourcevol{
|
||||||
|
background: steelblue;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
.sinkvol{
|
||||||
|
background: slateblue;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
.muted{
|
||||||
|
background: tomato;
|
||||||
|
color: white;
|
||||||
|
}
|
17
.config/eww/widgets/volume.yuck
Normal file
17
.config/eww/widgets/volume.yuck
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
(defpoll sourcevol :interval "1s" `wpctl get-volume @DEFAULT_SOURCE@ | awk -F ' ' '{print $2}'`)
|
||||||
|
(defpoll sourcemute :interval "1s" `wpctl get-volume @DEFAULT_SOURCE@ | awk -F ' ' '{print $3}'`)
|
||||||
|
(defpoll sinkvol :interval "200ms" `wpctl get-volume @DEFAULT_SINK@ | awk -F ' ' '{print $2}'`)
|
||||||
|
(defpoll sinkmute :interval "1s" `wpctl get-volume @DEFAULT_SINK@ | awk -F ' ' '{print $3}'`)
|
||||||
|
|
||||||
|
(defwidget volume []
|
||||||
|
(box
|
||||||
|
:space-evenly false
|
||||||
|
:spacing 3
|
||||||
|
(eventbox
|
||||||
|
:class "sourcevol${sourcemute == "[MUTED]" ? " muted" : ""}"
|
||||||
|
:onclick "wpctl set-mute @DEFAULT_SOURCE@ toggle"
|
||||||
|
(label :text "${sourcemute == "[MUTED]" ? "" : ""} ${sourcevol}"))
|
||||||
|
(eventbox
|
||||||
|
:class "sinkvol${sinkmute == "[MUTED]" ? " muted" : ""}"
|
||||||
|
:onclick "wpctl set-mute @DEFAULT_SINK@ toggle"
|
||||||
|
(label :text "${sinkmute == "[MUTED]" ? "" : ""} ${sinkvol}"))))
|
Reference in New Issue
Block a user