From 0417c202a2a2219e4f551c342e2bdd2ba79ebbdd Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Thu, 9 Nov 2023 16:57:11 -0800 Subject: [PATCH] added sun-based gradient background to dash clock --- .../eww-config/dashboard/dashboard.scss | 7 ++++++- .../eww-config/dashboard/dashboard.yuck | 19 +++++++++++++++++++ modules/hyprland/default.nix | 3 ++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/modules/ewwbar/eww-config/dashboard/dashboard.scss b/modules/ewwbar/eww-config/dashboard/dashboard.scss index ae091f1..cf65e49 100644 --- a/modules/ewwbar/eww-config/dashboard/dashboard.scss +++ b/modules/ewwbar/eww-config/dashboard/dashboard.scss @@ -4,10 +4,15 @@ } .dash_clock { - background-image: linear-gradient(45deg, #7d7d7d, #262626 30%, #262626 60%, #10384a); + // background-image: linear-gradient(45deg, #7d7d7d, #262626 30%, #262626 60%, #10384a); border-radius: 16px; } +.dash_clock_bg { + border-radius: 16px; + background-color: #262626; +} + .dash_clock_time { font-size: 30px; } diff --git a/modules/ewwbar/eww-config/dashboard/dashboard.yuck b/modules/ewwbar/eww-config/dashboard/dashboard.yuck index d844cc8..2acb8a2 100644 --- a/modules/ewwbar/eww-config/dashboard/dashboard.yuck +++ b/modules/ewwbar/eww-config/dashboard/dashboard.yuck @@ -18,6 +18,14 @@ :onaccept "eww update show_elevation_prompt=false;eww close elevate_to_windows; echo \"{}\" | sudo -S grub-reboot 1 && systemctl reboot") )))) +(defpoll clock_gradient :interval "5m" + {"gcal --resource-file=/home/nixolas/.config/eww/scripts/gcalinfo -H no | ewwtilities calendar-background"}) + +(defwidget dash_clock_bg [] + (box :class "dash_clock_bg" + :style "background-image: ${clock_gradient}" + )) + (defwidget dash_clock [] (box :class "dash_clock" :orientation "v" @@ -77,6 +85,17 @@ (dash_clock) ) +(defwindow dash_clock_bg + :stacking "bg" + :focusable "false" + :monitor 0 + :geometry (geometry :x 760 + :y 200 + :width 400 + :height 150) + (dash_clock_bg) +) + (defwindow logout :stacking "bg" :focusable "false" diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index 1806bd7..0b8c509 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -44,7 +44,8 @@ in exec-once = [ "${pkgs.swww}/bin/swww init & sleep 0.5 & ${pkgs.swww}/bin/swww /home/nixolas/Downloads/RecountERD.png" - "eww open bar;eww open logout;eww open restart;eww open shutdown;eww open reboot_windows;eww open dash_clock" + "eww open bar;eww open logout;eww open restart;eww open shutdown;eww open reboot_windows" + "eww open dash_clock_bg;eww open dash_clock" # the order here matters ]; input = {