add my eww widgets

This commit is contained in:
primardj 2024-03-15 14:05:00 +00:00
parent ac22f7a0cb
commit c7fb9247e7
9 changed files with 1241 additions and 14 deletions

View file

@ -2,18 +2,17 @@
.clock { .clock {
border-radius: 20px; border-radius: 20px;
padding: 10px; padding: 10px;
background: rgba(30, 31, 40, 0.8) background: rgba(40, 31, 30, 0.5)
} }
.analog-clock { .analog-clock {
padding: 2rem;
margin: 10px; margin: 10px;
background: #282a36; background: #362a28;
border-radius: 100%; border-radius: 100%;
border: 7px solid #282a36; border: 7px solid #362a28;
box-shadow: inset 4px 4px 10px rgba(0,0,0,0.5), box-shadow: inset 4px 4px 10px rgba(0,0,0,0.5),
inset -4px -4px 10px rgba(40,42,54,0.5), inset -4px -4px 10px rgba(54,42,40,0.5),
4px 4px 10px rgba(0,0,0,0.3); 4px 4px 10px rgba(0,0,0,0.3);
border-radius: 50%; border-radius: 50%;
} }
@ -30,18 +29,18 @@
padding: 10px; padding: 10px;
margin-left: 0px; margin-left: 0px;
margin-right: 5px; margin-right: 5px;
background: rgba(40,42,54,1.0); background: rgba(54,42,40,1.0);
border-radius: 10px; border-radius: 10px;
color: #00FFFF; color: #FFA500;
} }
.date { .date {
padding: 10px; padding: 10px;
margin: 5px 20px 0px 10px; margin: 5px 20px 0px 10px;
background: rgba(40,42,54,1.0); background: rgba(54,42,40,1.0);
border-radius: 10px; border-radius: 10px;
color: #00FFFF; color: #FFA500;
} }

View file

@ -1,5 +1,6 @@
(defpoll hours (defpoll hours
:interval "1s" :interval "1s"
:initial "00" :initial "00"
@ -31,7 +32,7 @@
(box :width 180 :height 180 :class "analog-clock") (box :width 180 :height 180 :class "analog-clock")
(box (box
:height 180 :height 180
:width 175 :width 180
:class "numerical-clock" :class "numerical-clock"
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
@ -64,9 +65,9 @@
:monitor 0 :monitor 0
:geometry (geometry :geometry (geometry
:x "5%" :x "5%"
:y "10%" :y "35%"
:height "180px" :height "200px"
:anchor "bottom left") :anchor "top right")
:stacking "bg" :stacking "bg"
:exclusive true :exclusive true
:focusable false :focusable false

View file

@ -1 +1,7 @@
@import "analog_clock/clock.scss" * {
all: unset;
}
@import "analog_clock/clock.scss";
@import "system_widget/system.scss";
@import "perf_widget/perf.scss";

View file

@ -1 +1,3 @@
(include "./analog_clock/clock.yuck") (include "./analog_clock/clock.yuck")
(include "./system_widget/system.yuck")
(include "./perf_widget/perf.yuck")

View file

@ -0,0 +1,52 @@
.perf {
border-radius: 20px;
padding: 10px 20px;
background: rgba(40, 31, 30, 0.5);
}
.perf_box {
margin-left: 7px;
}
.perf_bar {
/*color: #FFFFFF;*/
/*background: #1d2021;*/
margin: 5px;
progress {
min-width: 17px;
background: #ff5d00;
}
}
.bat_bar {
margin: 3px;
progress {
min-width: 13px;
background: #ff9900;
}
}
.ram_bar {
margin: 3px;
progress {
min-width: 13px;
background: #ff8866;
}
}
.swap_bar {
margin: 3px;
progress {
min-width: 13px;
background: #444444;
}
}

View file

@ -0,0 +1,269 @@
(defpoll cpu_avg :interval "0.5s"
:initial "0"
`cpu_calcul`)
(defpoll bat_avg :interval "0.5s"
:initial "0"
`cat /sys/class/power_supply/BAT1/capacity`)
(defpoll ram_avg :interval "0.5s"
:initial "0"
`echo $(free | grep Mem | awk '{print $7/$2 * 100.0}') | cut -d '.' -f 1 `)
(defpoll swap_avg :interval "0.5s"
:initial "0"
`echo $(free | grep Swap | awk '{print $4/$2 * 100.0}') | cut -d '.' -f 1 `)
(defwidget perf []
(box
:space-evenly false
:orientation "h"
:class "perf_bars"
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:height 500
:orientation "h"
:class "proc_box"
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 25}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 50}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 75}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 100}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 125}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 150}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 175}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 200}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 225}"
:orientation "v"
:class "perf_bar"))
(label
:class "val_label"
:text "${cpu_avg} %")
)
(box
:space-evenly true
:height 500
:orientation "v"
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:orientation "h"
:height 152
:class "perf_box"
(progress
:flipped true
:value "${bat_avg * 2.75}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 25}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 50}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 75}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 100}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 125}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 150}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 175}"
:orientation "v"
:class "bat_bar")
)
(label
:class "val_label"
:text "${bat_avg} %")
)
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:orientation "h"
:height 152
:class "perf_box"
(progress
:flipped true
:value "${ram_avg * 2.75}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 25}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 50}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 75}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 100}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 125}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 150}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 175}"
:orientation "v"
:class "ram_bar")
)
(label
:class "val_label"
:text "${100 - ram_avg} %")
)
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:orientation "h"
:height 152
:class "perf_box"
(progress
:flipped true
:value "${swap_avg * 2.75}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 25}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 50}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 75}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 100}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 125}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 150}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 175}"
:orientation "v"
:class "swap_bar")
)
(label
:class "val_label"
:text "${100 - swap_avg} %")
)
)
)
)
(defwindow perf
:monitor 0
:geometry (geometry
:x "5%"
:y "8%"
:height "500px"
:anchor "top left")
:stacking "bg"
:exclusive true
:focusable false
:namespaces "perf_widget"
(perf))

750
dotconfig/eww/profile.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 552 KiB

View file

@ -0,0 +1,37 @@
.system {
border-radius: 20px;
padding: 10px 20px;
background: rgba(40, 31, 30, 0.5);
}
.profilepicture {
margin: 10px;
background: #362a28;
border-radius: 100%;
border: 7px solid #362a28;
box-shadow: inset 4px 4px 10px rgba(0,0,0,0.5),
inset -4px -4px 10px rgba(54,42,40,0.5),
4px 4px 10px rgba(0,0,0,0.3);
border-radius: 50%;
margin-right: 20px;
}
.boxtextcyan {
color: #FFA500;
margin: 2px 2px;
padding: 5px 10px 7px 10px;
background: rgba(54,42,40,1.0);
border-radius: 10px;
}
.cyan {
color: #FFA500;
}
.white {
color: #FFFFFF;
}

View file

@ -0,0 +1,111 @@
(defpoll hostname :interval "1s"
`hostname`)
(defpoll username :interval "1s"
`whoami`)
(defpoll systemRunning :interval "1s"
`uname -o`)
(defpoll architechture :interval "1s"
`uname -m`)
(defpoll kernel :interval "1s"
`uname -r`)
(defpoll uptime :interval "1s"
`newuptime`)
(defpoll temperature_name :interval "1s"
`echo $(cat /sys/class/thermal/thermal_zone0/type)`)
(defpoll temperature_val :interval "1s"
`echo "scale=1;$(cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc`)
(defwidget system []
(box
:space-evenly false
:orientation "h"
:class "system"
(box
:class "profilepicture"
(image :path "/home/primardj/.config/eww/profile.svg" :image-width 145 :image-height 145)
)
(box
:space-evenly false
:orientation "v"
:class "information"
(box :class "boxtextcyan"
:halign "fill"
(label :text "${username}@${hostname}")
)
(box
:space-evenly false
:orientation "h"
(box :class "boxtextcyan"
:halign "fill"
:hexpand true
(label :class "cyan" :text "OS:")
)
(box :class "boxtextcyan"
(label :class "white" :text "${systemRunning} ${architechture}")
)
)
(box
:space-evenly false
:orientation "h"
(box :class "boxtextcyan"
:hexpand true
:halign "fill"
(label :class "cyan" :text "Kernel:")
)
(box :class "boxtextcyan"
(label :class "white" :text "${kernel}")
)
)
(box
:space-evenly false
:orientation "h"
(box :class "boxtextcyan"
:hexpand true
:halign "fill"
(label :class "cyan" :text "Uptime:")
)
(box :class "boxtextcyan"
(label :class "white" :text "${uptime}")
)
)
(box
:space-evenly false
:orientation "h"
(box :class "boxtextcyan"
:hexpand true
:halign "fill"
(label :class "cyan" :text "${temperature_name}:")
)
(box :class "boxtextcyan"
(label :class "white" :text "${temperature_val}°C")
)
)
)
)
)
(defwindow system
:monitor 0
:geometry (geometry
:x "5%"
:y "8%"
:height "200px"
:anchor "top right")
:stacking "bg"
:exclusive true
:focusable false
:namespaces "system_widget"
(system))