diff --git a/de/home/.config/eww/eww.scss b/de/home/.config/eww/eww.scss new file mode 100644 index 0000000..0729d76 --- /dev/null +++ b/de/home/.config/eww/eww.scss @@ -0,0 +1,51 @@ +* { + all: unset; // Unsets everything so you can style everything from scratch +} + +// Global Styles +.bar { + background-color: #3a3a3a; + color: #b0b4bc; + padding: 5px 0px; + border-radius: 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; +} + +.label-ram { + font-size: large; +} + +.workspaces button:hover { + color: #D35D6E; +} +.workspaces button { + background-color: #B87A7A; + color: #2C2423; + margin: 0px 5px; + padding: 2px; + border-radius: 8px; +} + diff --git a/de/home/.config/eww/eww.yuck b/de/home/.config/eww/eww.yuck new file mode 100644 index 0000000..fed8bf0 --- /dev/null +++ b/de/home/.config/eww/eww.yuck @@ -0,0 +1,73 @@ +(defwidget bar [] + (centerbox :orientation "h" + (workspaces :array workspacesArray) + (music) + (sidestuff))) + +(defwidget sidestuff [] + (box :class "sidestuff" :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 "") + time)) + +(deflisten workspacesArray :initial "${[1]}" + `~/.config/eww/scripts/getWorkspaces.sh`) + +(defwidget workspaces [array] +(box :class "workspaces" + :orientation "h" + :space-evenly true + :halign "start" + + (for entry in array + (button :onclick `swaymsg workspace "${entry.name}"` + :class {entry.focused ? "focused" : ""} + `${entry.name}`)))) + +(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 "10s" + "date '+%H:%M %b %d, %Y'") + +(defwindow bar + :monitor 0 + :windowtype "dock" + :geometry (geometry :x "0%" + :y "0%" + :width "99%" + :height "10px" + :anchor "top center") + :reserve (struts :side "top" :distance "4%") + (bar)) diff --git a/de/home/.config/eww/scripts/getWorkspaces.sh b/de/home/.config/eww/scripts/getWorkspaces.sh new file mode 100755 index 0000000..588cde2 --- /dev/null +++ b/de/home/.config/eww/scripts/getWorkspaces.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +function get_workspaces_info() { + output=$(swaymsg -t get_workspaces | jq 'sort_by(.name)') + echo $output +} + +get_workspaces_info + +swaymsg -t subscribe '["workspace"]' --monitor | { + while read -r event; do + get_workspaces_info + done +} diff --git a/de/home/.config/eww/scripts/getvol b/de/home/.config/eww/scripts/getvol new file mode 100644 index 0000000..4e4275d --- /dev/null +++ b/de/home/.config/eww/scripts/getvol @@ -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 diff --git a/de/include b/de/include index f201283..f720f23 100644 --- a/de/include +++ b/de/include @@ -52,3 +52,4 @@ .librewolf/school/user.js .librewolf/work/chrome .librewolf/work/user.js +.config/eww