Compare commits

..

2 Commits
dev ... main

5 changed files with 117 additions and 47 deletions

101
bar/.yuck Normal file → Executable file
View File

@ -1,27 +1,47 @@
(defpoll time :interval "10s" (defwindow bar
"date '+%H:%M %b %d, %Y'") :monitor 1
:geometry (geometry
:x "0px"
:y "0px"
:width "100%"
:height "0"
:anchor "top center"
)
:stacking "fg"
:exclusive true
:focusable false
(bar)
)
(defwidget system-tray [] (defwidget bar []
(systray (box :class "bar"
:halign "center" :orientation "h"
)) :hexpand true
:space-evenly true
(left)
(center)
(right)
)
)
(defwidget left [] (defwidget left []
(box (box
:class "panel" :class "panel"
:orientation "h" :orientation "h"
:halign "end" :halign "start"
:valign "fill"
:space-evenly false :space-evenly false
(system-tray) (workspaces_indicator :hexpand true :valign "center")
(label :text time) )
)) )
(defwidget center [] (defwidget center []
(box (box
:class "panel" :class "panel"
:halign "center" :halign "center"
:valign "fill"
:space-evenly false :space-evenly false
(label :text "Hareworks") (label :text "Hareworks" :class "center")
) )
) )
@ -29,39 +49,50 @@
(box (box
:class "panel" :class "panel"
:orientation "h" :orientation "h"
:halign "start" :halign "end"
:valign "fill"
:space-evenly false :space-evenly false
(workspaces) (system-tray)
(label :text time)
) )
) )
(defwidget workspaces [] (defwidget workspaces_indicator []
(literal :content get_workspaces)) (literal
:content workspaces_indicator :hexpand true :valign "center"
)
)
(deflisten get_workspaces `sh ~/.config/eww/bar/workspace.sh 1`) (deflisten workspaces_indicator `sh ~/.config/eww/bar/workspace.sh 1`)
(defwidget bar [] (defpoll time :interval "10s"
(box :class "bar" "date '+%H:%M %b %d, %Y'")
:orientation "h"
:hexpand true
:space-evenly true
(right)
(center)
(left)
))
(defwindow bar (defwidget system-tray []
(systray
:halign "center"
:icon-size 24
:height 32
)
)
(defwindow roundedEdge
:monitor 1 :monitor 1
:geometry (geometry :geometry (geometry
:x "0px" :x "0px"
:y "8px" :y "0px"
:width "2544px" :width "100%"
:height "30px" :height "15px"
:anchor "top center") :anchor "top center")
:stacking "fg" :stacking "bg"
:exclusive true :exclusive false
:focusable false :focusable false
(bar)) (box :class "roundededge"
:orientation "h"
:space-evenly false
(label :text "" :class "left" :width 15)
(label :text "" :class "center" :hexpand true)
(label :text "" :class "right" :width 15)
)
)

42
bar/style.scss Normal file → Executable file
View File

@ -1,19 +1,43 @@
@import "../colors.scss";
.bar { .bar {
font-size: 18px; font-size: 16px;
margin: 0px; margin: 0px;
background-color: $background_color_dark;
.panel { .panel {
background: rgba(89, 89, 89, 0.667); background-color: $background_color;
border-radius: 15px; border-radius: 16px;
margin: 6px;
padding: 0 6px 0 6px;
}
.center {
padding: 0 10px 0 10px; padding: 0 10px 0 10px;
} }
.workspace { .workspaces {
background: rgba(89, 89, 89, 0.667); > .workspace {
border-radius: 15px; background: $background_color_dark;
padding: 0 10px 0 10px; border-radius: 50%;
&.focused { border: 2px solid $accent-color;
background: rgba(255, 255, 255, 0.667); &.focused {
background: $accent-color;
}
}
> .label {
color: $text-color;
padding: 0 26px 0 4px;
} }
} }
}
.roundededge {
>.right {
background-image: radial-gradient(circle at calc(100% - 15px) 15px, transparent 15px, $background_color_dark 0px);
}
>.left {
background-image: radial-gradient(circle at 15px 15px, transparent 15px, $background_color_dark 0px);
}
} }

7
bar/workspace.sh Normal file → Executable file
View File

@ -8,13 +8,14 @@ print_workspaces() {
for w in $(echo $output | jq -r '.id'); do for w in $(echo $output | jq -r '.id'); do
text=$(echo $output | jq -r "select(.id == $w) | .name") text=$(echo $output | jq -r "select(.id == $w) | .name")
if [ $w -eq $focused ]; then if [ $w -eq $focused ]; then
buf="$buf (label :class \"workspace focused\" :text \"$text\")" buf="$buf (button :class \"workspace focused\" :width 20 :height 20)"
else else
buf="$buf (label :class \"workspace\" :text \"$text\")" buf="$buf (button :class \"workspace\" :width 20 :height 20)"
fi fi
done done
focused=$(echo $output | jq -r "select(.id == $focused) | .name")
echo "(box :class \"workspaces\" :orientation \"h\" :valign \"start\"$buf)" echo "(box :class \"workspaces\" :orientation \"h\" :space-evenly false :spacing 4 :hexpand true :valign \"center\"$buf (label :class \"label\" :text \"$focused\"))"
} }
print_workspaces print_workspaces

14
colors.scss Executable file
View File

@ -0,0 +1,14 @@
$primary-color: #ff4081;
$secondary-color: #3f51b5;
$accent-color: #caf9ff;
$background-color: #3b3b3b;
$background-color-light: #616161;
$background-color-dark: #212121;
$text-color: #e2e2e2;
$text-color-black: #2c2c2c;
$success-color: #4caf50;
$error-color: #f44336;
$warning-color: #ff9800;
$info-color: #2196f3;

0
eww.scss Normal file → Executable file
View File