From 65d0db4189a003020d0dafae21ceb90edf43c629 Mon Sep 17 00:00:00 2001 From: Anish L Date: Fri, 2 Sep 2022 01:14:26 +1000 Subject: [PATCH] eww calendar widget (no ikhal integration) --- users/profiles/desktop/default.nix | 1 + users/profiles/desktop/eww/eww.scss | 50 +++++++++++++++++++++++++ users/profiles/desktop/eww/eww.yuck | 13 +++++++ users/profiles/desktop/eww/widgets.yuck | 20 ++++++++++ 4 files changed, 84 insertions(+) create mode 100644 users/profiles/desktop/eww/widgets.yuck diff --git a/users/profiles/desktop/default.nix b/users/profiles/desktop/default.nix index 64e812be..7161e7bf 100644 --- a/users/profiles/desktop/default.nix +++ b/users/profiles/desktop/default.nix @@ -114,6 +114,7 @@ in ".local/bin/mpv-ify".source = ./bin/mpv-ify; ".config/eww/eww.yuck".source = ./eww/eww.yuck; ".config/eww/eww.scss".source = ./eww/eww.scss; + ".config/eww/widgets.yuck".source = ./eww/widgets.yuck; # ".local/bin/hotplug-monitor.sh".source = ./bin/hotplug-monitor.sh; }; diff --git a/users/profiles/desktop/eww/eww.scss b/users/profiles/desktop/eww/eww.scss index e69de29b..6e328f06 100644 --- a/users/profiles/desktop/eww/eww.scss +++ b/users/profiles/desktop/eww/eww.scss @@ -0,0 +1,50 @@ +* { + all: unset; + color: #cdd6f4; +} + +/* Calendar */ + +.cal-box { + background-color: #181825; + border-radius: 8px; + font-family: JetBrainsMono Nerd Font; + font-size: 1.2em; + + .cal-inner-box { + padding: 1rem 1rem .3rem 1rem; + + .cal { + &.highlight { + padding: 10rem; + } + + padding: .8rem .25rem 0rem; + margin-left: 10px; + } + } +} + +calendar:selected { + color: #9ece6a; +} + +calendar.header { + color: #ad8ee6; + font-weight: bold; +} + +calendar.button { + color: #449dab; +} + +calendar.highlight { + color: #7aa2f7; + font-weight: bold; +} + +calendar:indeterminate { + color: #8C8C8C; +} + + diff --git a/users/profiles/desktop/eww/eww.yuck b/users/profiles/desktop/eww/eww.yuck index e69de29b..047a6f50 100644 --- a/users/profiles/desktop/eww/eww.yuck +++ b/users/profiles/desktop/eww/eww.yuck @@ -0,0 +1,13 @@ +; includes: +;widgets +(include "widgets.yuck") + +;; Calendar Windows ;; + +(defwindow calendar + :geometry (geometry :x "-19px" + :y "50px" + :width "270px" + :height "60px" + :anchor "top right") +(cal)) diff --git a/users/profiles/desktop/eww/widgets.yuck b/users/profiles/desktop/eww/widgets.yuck new file mode 100644 index 00000000..0912a03b --- /dev/null +++ b/users/profiles/desktop/eww/widgets.yuck @@ -0,0 +1,20 @@ +; widgets + +(defpoll time0 :interval "10s" "date '+%H':%M") +(defpoll date :interval "10s" "date '+%b %d'") + +;; Calendar Widgets ;; +(defwidget cal [] + (box :class "cal-box" + :orientation "v" + (box :class "cal-inner-box" + (calendar :class "cal" + :day calendar_day + :month calendar_month + :year calendar_year)))) +(defpoll calendar_day :interval "10h" + "date '+%d'") +(defpoll calendar_month :interval "10h" + "calendar") +(defpoll calendar_year :interval "10h" + "date '+%Y'")