From a2ab73e8a1b7d04fa4f4ffb2331527ff8d4d8105 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Tue, 24 Oct 2023 21:53:57 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20:=20premi=C3=A8re=20configuration=20de?= =?UTF-8?q?=20eww?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/eww/eww.scss | 55 ++++++++++++++++++++++++++++ config/eww/eww.yuck | 75 +++++++++++++++++++++++++++++++++++++++ config/eww/scripts/getvol | 2 ++ 3 files changed, 132 insertions(+) create mode 100644 config/eww/eww.scss create mode 100644 config/eww/eww.yuck create mode 100755 config/eww/scripts/getvol diff --git a/config/eww/eww.scss b/config/eww/eww.scss new file mode 100644 index 0000000..efa2a50 --- /dev/null +++ b/config/eww/eww.scss @@ -0,0 +1,55 @@ +* { + all: unset; //Unsets everything so you can style everything from scratch +} + +//Global Styles +.bar { + background-color: #3a3a3a; + color: #b0b4bc; + padding: 10px; +} + +// Styles on classes (see eww.yuck for more information) + +.sidestuff 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/config/eww/eww.yuck b/config/eww/eww.yuck new file mode 100644 index 0000000..98a9c03 --- /dev/null +++ b/config/eww/eww.yuck @@ -0,0 +1,75 @@ +(defwidget bar [] + (centerbox :orientation "h" + (workspaces) + (music) + (sidestuff))) + +(defwidget sidestuff [] + (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" + (metric :label "🔊" + :value volume + :onchange "wpctl set-volume @DEFAULT-SINK@ {}%") + (metric :label "" + :value {EWW_RAM.used_mem_perc} + :onchange "") + (metric :label "💾" + :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)} + :onchange "") + time)) + +(defwidget workspaces [] + (box :class "workspaces" + :orientation "h" + :space-evenly true + :halign "start" + :spacing 10 + (button :onclick "hyprctl dispatch workspace 0" 1) + (button :onclick "hyprctl dispatch workspace 1" 2) + (button :onclick "hyprctl dispatch workspace 2" 3) + (button :onclick "hyprctl dispatch workspace 3" 4) + (button :onclick "hyprctl dispatch workspace 4" 5) + (button :onclick "hyprctl dispatch workspace 5" 6) + (button :onclick "hyprctl dispatch workspace 6" 7) + (button :onclick "hyprctl dispatch workspace 7" 8) + (button :onclick "hyprctl dispatch workspace 8" 9))) + +(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" + "scripts/getvol") + +(defpoll time :interval "1s" + "date '+%Y-%m-%d | %H:%M:%S'") + +(defwindow bar + :monitor 0 + :windowtype "dock" + :geometry (geometry :x "0%" + :y "0%" + :width "90%" + :height "10px" + :anchor "top center") + :reserve (struts :side "top" :distance "4%") + (bar)) diff --git a/config/eww/scripts/getvol b/config/eww/scripts/getvol new file mode 100755 index 0000000..b7f6385 --- /dev/null +++ b/config/eww/scripts/getvol @@ -0,0 +1,2 @@ +#!/bin/sh +exec wpctl get-volume @DEFAULT-SINK@