From 704871969ffe2312f15ddc02cee159d12cde456b Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Sat, 11 Nov 2023 11:26:23 +0100 Subject: [PATCH] Add eww bar --- tree/.config/eww/eww.scss | 105 ++++++++++++++++++++++++++++ tree/.config/eww/eww.yuck | 67 ++++++++++++++++++ tree/.config/hypr/hyprland.conf.tpl | 9 +++ 3 files changed, 181 insertions(+) create mode 100644 tree/.config/eww/eww.scss create mode 100644 tree/.config/eww/eww.yuck diff --git a/tree/.config/eww/eww.scss b/tree/.config/eww/eww.scss new file mode 100644 index 0000000..a5f9fa3 --- /dev/null +++ b/tree/.config/eww/eww.scss @@ -0,0 +1,105 @@ +$black: #1D2021; +$black1: #282828; +$white: #FBF1C7; +$grey: #A89984; +$blue: #458588; +$cyan: #8EC07C; +$pink: #D3869B; +$yellow: #FABD2F; +$purple: #B12686; +$teal: #8EC07C; +$darkteal: #689D6A; +$green: #B8BB26; +$orange: #FE8019; +$red: #FB4934; +$bluealt: $black1; +$blackdark: $black; + +*{ + all: unset; + font-family: "Sauce Code Pro Nerd Font Mono"; +} + +window { + background: $blackdark; + border-radius: 15px; +} + +.workspace { + font-size: 18px; + font-weight: 300; + border: solid wheat 1px; + background: black; + color: wheat; + border-radius: 30px; + padding-top: 3px; + padding-bottom: 5px; + margin: 8px; + margin-top: 3px; + margin-bottom: 3px; + box-shadow: 0 0px 5px 1px #06060b; + transition: all 1s; +} + +.workspace.active { + background: wheat; + color: black; +} + +.workspaces { + margin-top: 10px; + margin-bottom: 10px; +} + +scale trough { + all: unset; + background-color: #22242b; + box-shadow: 0 0px 5px 1px #06060b; + border-radius: 16px; + min-width: 16px; + min-height: 70px; + margin: 0px 0px 0px 0px; +} + +.volume { + min-height: 150px; +} + +.volume trough highlight { + background-image: linear-gradient(to right, #6b4f73 30%, #5b3f63 50%, #5b3f63 100% *50); + border-radius: 10px; +} + +.vpn { + font-size: 40px; + color: wheat; + border-bottom: dotted green 6px; + margin: 2px; + margin-top: 20px; + transition: border-color 1s; +} + +.vpn label { + margin-top: -5px; + margin-bottom: -5px; +} + +.vpn.connecting { + border-color: orange; +} + +.vpn.disconnected { + border-color: red; +} + +.clock { + font-size: 30px; + font-weight: 400; + color: wheat; + margin-top: 20px; + margin-bottom: 20px; +} +.clock label { + padding: 0; + margin-top: -11px; +} diff --git a/tree/.config/eww/eww.yuck b/tree/.config/eww/eww.yuck new file mode 100644 index 0000000..13ca811 --- /dev/null +++ b/tree/.config/eww/eww.yuck @@ -0,0 +1,67 @@ +(defwindow bar + :monitor 0 + :geometry (geometry :y "0%" + :x "10px" + :height "90%" + :width "50px" + :anchor "center left") + :stacking "fg" + :exclusive true + (box :orientation "v" + (workspaces) + (bottom) + )) + +(defwidget bottom [] + (box :orientation "v" + :space-evenly false + :valign "end" + (speaker) + (vpn) + (clock) +)) + +(defwidget workspaces [] + (box :orientation "v" + :valign "start" + :class "workspaces" + (for workspace in workspaces_json + (label :class 'workspace ${workspace.class}' :text '${workspace.id}') + ) + )) + +(defwidget speaker [] + (box + :class "volume" + :orientation "v" + :valign "end" + (scale + :orientation "v" + :flipped true + :min 0 + :max 100 + :value volume_out + :onchange "pamixer --set-volume {} && volshow") + )) + +(defwidget vpn [] + (button + :valign "end" + :class "vpn ${vpn_status.class}" + :onclick "${vpn_status.on_click}" + (label :text '${vpn_status.icon}') + )) + +(defwidget clock [] + (box :orientation "v" + :valign "end" + :class "clock" + (label :text current_hour) + (label :text current_minute) + )) + +(defpoll workspaces_json :interval "1s" "eww-workspaces") +(defpoll volume_out :interval "1s" "pamixer --get-volume") +(defpoll vpn_status :interval "1s" "mullvad-status") +(defpoll current_minute :interval "1s" "date +%M") +(defpoll current_hour :interval "1s" "date +%H") diff --git a/tree/.config/hypr/hyprland.conf.tpl b/tree/.config/hypr/hyprland.conf.tpl index e8e5832..d827392 100644 --- a/tree/.config/hypr/hyprland.conf.tpl +++ b/tree/.config/hypr/hyprland.conf.tpl @@ -199,6 +199,7 @@ bind = $mainMod, mouse_up, workspace, e-1 bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow +{% if hostname == "buran" %} monitor=eDP-1,3456x2160@60.00100,0x680,2.0 monitor=DP-1,5120x2160@59.98500,1728x450,1.3 monitor=DP-3,2560x1440@59.95100,5666x0,1.0,transform,3 @@ -211,8 +212,16 @@ monitor=DP-3,2560x1440@59.95100,5666x0,1.0,transform,3 # flipped + 90 degrees -> 5 # flipped + 180 degrees -> 6 # flipped + 270 degrees -> 7 +{% end %} exec-once=hyprpaper + +{% if hostname == "buran" %} exec-once=waybar +{% else %} +exec-once=eww daemon +exec-once=eww open bar +{% end %} + exec-once=findex-daemon exec-once=nextcloud