From 8395b9c84f0ce9f9493683b751a19ff94c3b1920 Mon Sep 17 00:00:00 2001 From: candifloss Date: Mon, 5 Aug 2024 21:25:02 +0530 Subject: [PATCH] Created dock. Changed indentation, etc. --- eww/eww.css | 15 +++++++++++ eww/eww.css.map | 2 +- eww/eww.yuck | 3 ++- eww/scss/colors/_glassy.scss | 7 +++++- eww/scss/common/_common.scss | 2 +- eww/scss/dock/_dock.scss | 17 +++++++++++++ eww/scss/eww.scss | 1 + eww/yuck/dock/dock_widg.yuck | 46 ++++++++++++++++++++++++++++++++++ eww/yuck/dock/dock_window.yuck | 20 +++++++++++++-- eww/yuck/osd/osd_window.yuck | 22 ++++++++-------- 10 files changed, 118 insertions(+), 17 deletions(-) create mode 100644 eww/scss/dock/_dock.scss diff --git a/eww/eww.css b/eww/eww.css index 90ff538..ed15efb 100644 --- a/eww/eww.css +++ b/eww/eww.css @@ -96,4 +96,19 @@ tooltip { font-family: "icon-font"; } +/* Dock bar */ +.dock_widg { + border-radius: 5px; + background-color: rgba(128, 128, 128, 0.5); +} +.dock_widg .dock_icon { + border-radius: 5px; + font-family: "icon-font"; + font-size: 30px; + color: rgb(255, 255, 255); +} +.dock_widg .dock_icon:hover { + background-color: rgba(128, 128, 128, 0.5); +} + /*# sourceMappingURL=eww.css.map */ diff --git a/eww/eww.css.map b/eww/eww.css.map index cd4b29c..83e59c9 100644 --- a/eww/eww.css.map +++ b/eww/eww.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["scss/common/_common.scss","scss/tooltip/_tooltip.scss","scss/colors/_glassy.scss","scss/osd/_osd.scss","scss/osd/_bat.scss","scss/osd/_bri.scss","scss/osd/_vol.scss"],"names":[],"mappings":"AAAA;AACA;EACI;;;ACFJ;AAGA;EACI;EACA,kBCDS;EDET,OCDY;;;ACDhB;AAKI;EACH,eAJI;EAKJ,kBDHY;;ACMT;EAEH;EACA,kBDNc;;ACOd;EAEI,eAdA;;AAgBJ;EAEI;;AClBA;EACH,kBFMyB;;AEJtB;EACH,kBFI6B;;AEF1B;EACH,kBFE0B;;AEAvB;EACH;;AAEG;EACH,kBFF0B;;AEIvB;EACH,kBFJsB;;AEMnB;EACH,kBFNwB;;AEQrB;EACH,kBFRuB;;AEUpB;EACH,kBFVuB;;AGfpB;EACH,kBHyBsB;;AGvBnB;EACH,kBHuBsB;;AGrBnB;EACH,kBHqBuB;;AGnBpB;EACH,kBHmBuB;;AGjBpB;EACH,kBHiBuB;;AI9BpB;EACH,kBJgBsB;;AIdnB;EACH,kBJesB;;AIbnB;EACH,kBJasB;;AIXnB;EACH,kBJWuB;;AITpB;EACH,kBJSuB;;AIPpB;EACH,kBJOuB;;ACErB;EAEH,cA3BI;EA4BJ;EACA;;AAGG;EAEH;EACA;EACA","file":"eww.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["scss/common/_common.scss","scss/tooltip/_tooltip.scss","scss/colors/_glassy.scss","scss/osd/_osd.scss","scss/osd/_bat.scss","scss/osd/_bri.scss","scss/osd/_vol.scss","scss/dock/_dock.scss"],"names":[],"mappings":"AAAA;AACA;EACI;;;ACFJ;AAGA;EACI;EACA,kBCDS;EDET,OCDY;;;ACDhB;AAKI;EACH,eAJI;EAKJ,kBDHY;;ACMT;EAEH;EACA,kBDNc;;ACOd;EAEI,eAdA;;AAgBJ;EAEI;;AClBA;EACH,kBFMyB;;AEJtB;EACH,kBFI6B;;AEF1B;EACH,kBFE0B;;AEAvB;EACH;;AAEG;EACH,kBFF0B;;AEIvB;EACH,kBFJsB;;AEMnB;EACH,kBFNwB;;AEQrB;EACH,kBFRuB;;AEUpB;EACH,kBFVuB;;AGfpB;EACH,kBHyBsB;;AGvBnB;EACH,kBHuBsB;;AGrBnB;EACH,kBHqBuB;;AGnBpB;EACH,kBHmBuB;;AGjBpB;EACH,kBHiBuB;;AI9BpB;EACH,kBJgBsB;;AIdnB;EACH,kBJesB;;AIbnB;EACH,kBJasB;;AIXnB;EACH,kBJWuB;;AITpB;EACH,kBJSuB;;AIPpB;EACH,kBJOuB;;ACErB;EAEH,cA3BI;EA4BJ;EACA;;AAGG;EAEH;EACA;EACA;;;AIzCD;AAEA;EACI;EACA,kBLoCU;;AKnCV;EACI;EACA;EACA;EACA,OLiCc;;AK/Bd;EACI,kBL6BM","file":"eww.css"} \ No newline at end of file diff --git a/eww/eww.yuck b/eww/eww.yuck index eab5526..9097709 100644 --- a/eww/eww.yuck +++ b/eww/eww.yuck @@ -1,3 +1,4 @@ (include "yuck/vars/vars.yuck") (include "yuck/test/test-window.yuck") -(include "yuck/osd/osd_window.yuck") \ No newline at end of file +(include "yuck/osd/osd_window.yuck") +(include "yuck/dock/dock_window.yuck") \ No newline at end of file diff --git a/eww/scss/colors/_glassy.scss b/eww/scss/colors/_glassy.scss index 6d49fdc..9048f9c 100644 --- a/eww/scss/colors/_glassy.scss +++ b/eww/scss/colors/_glassy.scss @@ -36,4 +36,9 @@ $osd_fill_col_bri_high: rgba(201, 108, 50, 1); $osd_fill_col_bri_vhigh: rgba(231, 59, 48, 1); $osd_fill_col_bri_full: rgba(231, 59, 48, 1); -$c: rgba(245, 40, 145, 0.8); \ No newline at end of file +$c: rgba(245, 40, 145, 0.8); + +//Dock +$dock_bg_col: rgba(128, 128, 128, 0.5); +$dock_ico_bg_col: rgba(128, 128, 128, 0.5); +$dock_ico_fg_def_col: rgba(255, 255, 255, 1); \ No newline at end of file diff --git a/eww/scss/common/_common.scss b/eww/scss/common/_common.scss index 2d279b4..1d4472d 100644 --- a/eww/scss/common/_common.scss +++ b/eww/scss/common/_common.scss @@ -1,4 +1,4 @@ /* Common/default for all elements/selectors */ * { - all: unset; + all: unset; } \ No newline at end of file diff --git a/eww/scss/dock/_dock.scss b/eww/scss/dock/_dock.scss new file mode 100644 index 0000000..0e7db21 --- /dev/null +++ b/eww/scss/dock/_dock.scss @@ -0,0 +1,17 @@ +@use "../colors/_glassy.scss" as *; +/* Dock bar */ + +.dock_widg { + border-radius: 5px; + background-color: $dock_bg_col; + .dock_icon { + border-radius: 5px; + font-family: "icon-font"; + font-size: 30px; + color: $dock_ico_fg_def_col; + //background-color: rgba(50,50,50,1); + &:hover { + background-color: $dock_ico_bg_col; + } + } +} \ No newline at end of file diff --git a/eww/scss/eww.scss b/eww/scss/eww.scss index 0d6e4cb..ec84d62 100644 --- a/eww/scss/eww.scss +++ b/eww/scss/eww.scss @@ -1,6 +1,7 @@ @use "common/_common.scss"; @use "tooltip/_tooltip.scss"; @use "osd/_osd.scss"; +@use "dock/_dock.scss" //@use "colors/_glassy.scss"; \ No newline at end of file diff --git a/eww/yuck/dock/dock_widg.yuck b/eww/yuck/dock/dock_widg.yuck index e69de29..88539db 100644 --- a/eww/yuck/dock/dock_widg.yuck +++ b/eww/yuck/dock/dock_widg.yuck @@ -0,0 +1,46 @@ +(defwidget dock_widg [] + (box + :class "dock_widg" + :active false + :halign "fill" + :height 50 + :width 200 + :active true + (dock_icon :pinned_app "${apps}") ;These widgs are for testing + (dock_icon :pinned_app "${firefox}") + (dock_icon :pinned_app "${files}") + (dock_icon :pinned_app "${terminal}") + ) +) + +(defwidget dock_icon [pinned_app] + (eventbox + :class "dock_icon ${pinned_app.alias}" + :height 48 + :width 48 + :halign "center" + :valign "center" + :active true + :tooltip "${pinned_app.name}" + :onclick "${pinned_app.cmd}" + "${pinned_app.icon}" + ) +) + +;These vars are for testing +(defvar + firefox + "{\"name\":\"Firefox\", \"icon\":\"\", \"cmd\":\"firefox --private\", \"alias\":\"firefox\"}" +) +(defvar + terminal + "{\"name\":\"Terminal\", \"icon\":\"\", \"cmd\":\"alacritty\", \"alias\":\"terminal\"}" +) +(defvar + files + "{\"name\":\"Files\", \"icon\":\"\", \"cmd\":\"nautilus\", \"alias\":\"nautilus\"}" +) +(defvar + apps + "{\"name\":\"Apps\", \"icon\":\"\", \"cmd\":\"firefox --private\", \"alias\":\"apps\"}" +) \ No newline at end of file diff --git a/eww/yuck/dock/dock_window.yuck b/eww/yuck/dock/dock_window.yuck index 45e988d..6bc647a 100644 --- a/eww/yuck/dock/dock_window.yuck +++ b/eww/yuck/dock/dock_window.yuck @@ -1,4 +1,20 @@ -(defwindow dock - +(include "yuck/dock/dock_widg.yuck") +(defwindow dock + :monitor 0 + :windowtype "dock" + :class "dock_window" + :wm-ignore true + :stacking "fg" + :halign "end" + :valign "end" + :geometry + (geometry + :anchor "bottom center" + :x "0%" + :y "-0.5%" + :height "4%" + :width "10%" + ) + (dock_widg) ) \ No newline at end of file diff --git a/eww/yuck/osd/osd_window.yuck b/eww/yuck/osd/osd_window.yuck index c08eabf..464e96a 100644 --- a/eww/yuck/osd/osd_window.yuck +++ b/eww/yuck/osd/osd_window.yuck @@ -1,20 +1,20 @@ (include "yuck/osd/osd_widg.yuck") (defwindow osd [osdtype] - :geometry - (geometry - :x "-1%" - :y "4.5%" - :width "10%" - :height "4%" - :anchor "top right" - ) - :halign "end" - :valign "end" :monitor 0 - :stacking "fg" :windowtype "dock" :wm-ignore true + :stacking "fg" + :halign "end" + :valign "end" + :geometry + (geometry + :anchor "top right" + :x "-1%" + :y "4.5%" + :height "4%" + :width "10%" + ) (osd_widg :osdtype "${osdtype}"