From 2e23d59872f6edae8864545d6b4eaac2b664a6e0 Mon Sep 17 00:00:00 2001 From: statzitz Date: Sat, 3 Aug 2024 13:18:47 +0200 Subject: [PATCH] update eww --- dotconfig/eww/bar_widget/bar.scss | 112 ++++++++++++++++++++++++ dotconfig/eww/bar_widget/bar.yuck | 102 +++++++++++++++++++++ dotconfig/eww/eww.scss | 2 + dotconfig/eww/eww.yuck | 1 + dotconfig/eww/perf_widget/perf.yuck | 4 +- dotconfig/eww/system_widget/system.yuck | 4 +- 6 files changed, 221 insertions(+), 4 deletions(-) create mode 100644 dotconfig/eww/bar_widget/bar.scss create mode 100644 dotconfig/eww/bar_widget/bar.yuck diff --git a/dotconfig/eww/bar_widget/bar.scss b/dotconfig/eww/bar_widget/bar.scss new file mode 100644 index 0000000..cc16b15 --- /dev/null +++ b/dotconfig/eww/bar_widget/bar.scss @@ -0,0 +1,112 @@ +//Global Styles +.bar { + background: rgba(40, 31, 30, 0.5); + font-size: 14px; + /*padding: 10px;*/ +} + +.workspaces { + /*padding-top: 2px; + padding-left: 16px; + padding-right: 16px;*/ + transition: none; + color: #f8f8f2; + + margin-left: 8px; + border-radius: 13px; + background: #362a28; +} + +.btw { + padding-top: 6px; + padding-left: 12px; + padding-right: 12px; +} +.active { + padding-top: 6px; + padding-left: 12px; + padding-right: 12px; + color: #ffaa00; +} + +.time_box { + padding-top: 2px; + padding-left: 12px; + padding-right: 8px; + transition: none; + color: #ffcc44; + + margin-left: 16px; + border-radius: 13px 0px 0px 13px; + background: #362a28; + +} + +.wifi_box { + padding-top: 2px; + padding-left: 8px; + padding-right: 12px; + transition: none; + color: #bd93f9; + + border-radius: 0px 13px 13px 0px; + background: #362a28; + +} + +.tray { + padding-top: 2px; + padding-left: 12px; + padding-right: 12px; + margin-right: 16px; + transition: none; + color: #bd93f9; + + border-radius: 13px 13px 13px 13px; + background: #362a28; + +} + +// Styles on classes (see eww.yuck for more information) + +.left_pane slider { + all: unset; + color: #ffd5cd; +} + +.metric scale trough highlight { + all: unset; + background-color: #D35D6E; + color: #000000; + border-radius: 10px; +} +.metric scale trough { + all: unset; + background-color: #4e4e4e; + border-radius: 50px; + min-height: 3px; + min-width: 50px; + margin-left: 10px; + margin-right: 20px; +} +.metric scale trough highlight { + all: unset; + background-color: #D35D6E; + color: #000000; + border-radius: 10px; +} +.metric scale trough { + all: unset; + background-color: #4e4e4e; + border-radius: 50px; + min-height: 3px; + min-width: 50px; + margin-left: 10px; + margin-right: 20px; +} +.label-ram { + font-size: large; +} +.workspaces button:hover { + color: #D35D6E; +} diff --git a/dotconfig/eww/bar_widget/bar.yuck b/dotconfig/eww/bar_widget/bar.yuck new file mode 100644 index 0000000..a18eb6f --- /dev/null +++ b/dotconfig/eww/bar_widget/bar.yuck @@ -0,0 +1,102 @@ + + + +(defwidget bar [] + (centerbox :orientation "h" + (right_pane) + (music) + (left_pane))) + +(defwidget right_pane [] + (box :class "rpane" + :orientation "h" + :space-evenly false + (time_box) + (wifi_box) + (workspaces) + )) + +(defwidget time_box [] + (box + :class "time_box" + (label :text " ${time}" + ))) + +(defwidget wifi_box [] + (box + :class "wifi_box" + (label :text " ${wlan0}" + ))) + +(defwidget left_pane [] + (box :class "left_pane" :orientation "h" :space-evenly false :halign "end" + (metric :label "🔊" + :value volume + :onchange "amixer -D pulse sset Master {}%") + (metric :label "" + :value {EWW_RAM.used_mem_perc} + :onchange "") + (metric :label "💾" + :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)} + :onchange "") + (systray :class "tray" :orientation "h" :space-evenly true :icon-size "16") + )) + +(defwidget workspaces [] + (box :class "workspaces" + :orientation "h" + :space-evenly false + :halign "start" + (literal :content workspace) + ;(for i in workspace + ; (button :class "btw" :onclick "hyprctl dispatch workspace ${i}" "${i}")) + )) + +(defwidget music [] + (box :class "music" + :orientation "h" + :space-evenly false + :halign "center" + {music != "" ? "🎵${music}" : ""})) + + +(defwidget metric [label value onchange] + (box :orientation "h" + :class "metric" + :space-evenly false + (box :class "label" label) + (scale :min 0 + :max 101 + :active {onchange != ""} + :value value + :onchange onchange))) + + + +(deflisten music :initial "" + "playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true") + +(defpoll volume :interval "1s" + "echo 50") + +(defpoll time :interval "1s" + "date '+%I:%M:%S %p'") + +(defpoll wlan0 :interval "1s" + "get_network") + +(defpoll workspace :interval "0.5s" + "get_active_workspace") + +(defwindow bar + :monitor 0 + :geometry (geometry + :x "0%" + :y "0%" + :width "134%" + :height "30px" + :anchor "top center") + :stacking "bg" + :exclusive true + :focusable false + (bar)) diff --git a/dotconfig/eww/eww.scss b/dotconfig/eww/eww.scss index 59b2b0b..422bd86 100644 --- a/dotconfig/eww/eww.scss +++ b/dotconfig/eww/eww.scss @@ -1,7 +1,9 @@ * { all: unset; + font-family: '0xproto', FontAwesome, Roboto, Helvetica, Arial, sans-serif; } @import "analog_clock/clock.scss"; @import "system_widget/system.scss"; @import "perf_widget/perf.scss"; +@import "bar_widget/bar.scss"; diff --git a/dotconfig/eww/eww.yuck b/dotconfig/eww/eww.yuck index 4d61cd5..40dd6e0 100644 --- a/dotconfig/eww/eww.yuck +++ b/dotconfig/eww/eww.yuck @@ -1,3 +1,4 @@ (include "./analog_clock/clock.yuck") (include "./system_widget/system.yuck") (include "./perf_widget/perf.yuck") +(include "./bar_widget/bar.yuck") diff --git a/dotconfig/eww/perf_widget/perf.yuck b/dotconfig/eww/perf_widget/perf.yuck index 9a92f2b..39e40cc 100644 --- a/dotconfig/eww/perf_widget/perf.yuck +++ b/dotconfig/eww/perf_widget/perf.yuck @@ -93,7 +93,7 @@ :class "perf_bar")) (label :class "perf_label" - :text "${cpu_avg} %") + :text "${round(cpu_avg,0)} %") ) (box :space-evenly true @@ -261,7 +261,7 @@ ) ) - (literal :content all_disks) + ;(literal :content all_disks) ) ) diff --git a/dotconfig/eww/system_widget/system.yuck b/dotconfig/eww/system_widget/system.yuck index 50ef530..3c7fba1 100644 --- a/dotconfig/eww/system_widget/system.yuck +++ b/dotconfig/eww/system_widget/system.yuck @@ -48,7 +48,7 @@ :class "information" (box :class "inf-title" :orientation "v" - :width 76 + :width 90 (box :class "boxtextcyan" :halign "fill" :hexpand true @@ -72,7 +72,7 @@ ) (box :class "inf-data" :orientation "v" - :width 150 + :width 180 (box :class "boxtextcyan" (label :class "white" :text "${systemRunning} ${architechture}") )