Move EWW config into sub-directories to be included, for easier switching

This commit is contained in:
Evie Litherland-Smith 2023-04-11 17:43:23 +01:00
parent 97147c08bf
commit 76f52b7207
12 changed files with 313 additions and 129 deletions

View file

@ -0,0 +1,56 @@
* {
all: unset; //Unsets everything so you can style everything from scratch
}
//Global Styles
.bar {
background-color: #3a3a3a;
color: #b0b4bc;
padding: 10px;
}
// Styles on classes (see eww.yuck for more information)
.sidestuff slider {
all: unset;
color: #ffd5cd;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.label-ram {
font-size: large;
}
.workspaces button:hover {
color: #D35D6E;
}
// vim:ft=scss

View file

@ -0,0 +1,77 @@
(defwidget bar []
(centerbox :orientation "h"
(workspaces)
(music)
(sidestuff)))
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(metric :label "󰕾 "
:value volume
:onchange "amixer -D pulse sset Master {}%")
(metric :label "󰍛 "
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label " "
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
time))
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
(defwidget workspaces []
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
(box :space-evenly true
(label :text "${workspaces}${current_workspace}" :visible false)
(for workspace in workspaces
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
(box :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
(label :text "${workspace.id}")
)
)
)
)
)
)
(defwidget music []
(box :class "music"
:orientation "h"
:space-evenly false
:halign "center"
{music != "" ? "🎵${music}" : ""}))
(defwidget metric [label value onchange]
(box :orientation "h"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
(defpoll volume :interval "1s"
"scripts/getvol")
(defpoll time :interval "10s"
"date '+%H:%M %b %d, %Y'")
(defwindow bar
:monitor 0
:windowtype "dock"
:geometry (geometry :x "0%"
:y "0%"
:width "90%"
:anchor "top center")
:reserve (struts :side "top" :distance "4%")
(bar))
;; vim:ft=yuck

View file

@ -1,56 +1,3 @@
* { @import "./powermenu/eww.scss"
all: unset; //Unsets everything so you can style everything from scratch
}
//Global Styles
.bar {
background-color: #3a3a3a;
color: #b0b4bc;
padding: 10px;
}
// Styles on classes (see eww.yuck for more information)
.sidestuff slider {
all: unset;
color: #ffd5cd;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.label-ram {
font-size: large;
}
.workspaces button:hover {
color: #D35D6E;
}
// vim:ft=scss // vim:ft=scss

View file

@ -1,77 +1,3 @@
(defwidget bar [] (include "./powermenu/eww.yuck")
(centerbox :orientation "h"
(workspaces)
(music)
(sidestuff)))
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(metric :label "󰕾 "
:value volume
:onchange "amixer -D pulse sset Master {}%")
(metric :label "󰍛 "
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label " "
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
time))
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
(defwidget workspaces []
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
(box :space-evenly true
(label :text "${workspaces}${current_workspace}" :visible false)
(for workspace in workspaces
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
(box :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
(label :text "${workspace.id}")
)
)
)
)
)
)
(defwidget music []
(box :class "music"
:orientation "h"
:space-evenly false
:halign "center"
{music != "" ? "🎵${music}" : ""}))
(defwidget metric [label value onchange]
(box :orientation "h"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
(defpoll volume :interval "1s"
"scripts/getvol")
(defpoll time :interval "10s"
"date '+%H:%M %b %d, %Y'")
(defwindow bar
:monitor 0
:windowtype "dock"
:geometry (geometry :x "0%"
:y "0%"
:width "90%"
:anchor "top center")
:reserve (struts :side "top" :distance "4%")
(bar))
;; vim:ft=yuck ;; vim:ft=yuck

View file

@ -0,0 +1,69 @@
$surface-darkgrey: #20252b;
$surface-fg: #949494;
$surface-lightgrey: #3d464e;
$surface-grey: #2b3238;
$surface-red: #f87070;
* { all: unset; }
.layout-box {
font-family: Phosphor, Koulen;
background-repeat: no-repeat;
background-size: contain;
padding: 5em;
color: rgba($surface-fg, 0.8);
}
.net-box,
.bat-box,
.tm-box {
label {
font-size: 2em;
}
}
.close-btn {
font-size: 2em;
&:hover {
color: $surface-red;
}
}
.btns-box {
font-size: 2.5em;
button {
padding: 0.4em;
border-radius: 0.1em;
background-color: rgba($surface-darkgrey, 0.3);
&:hover {
transition: 200ms linear background-color, border-radius;
background-color: rgba($surface-lightgrey, 0.6);
}
&:first-child {
color: rgba($surface-red, 0.8);
}
}
}
.sep {
font-size: 1em;
padding-top: 0.15em;
padding-left: 0.2em;
padding-right: 0.2em;
font-family: Iosevka;
font-weight: 400;
}
.sundial-lbl {
font-size: 1.5em;
font-weight: bold;
border-radius: 0.2em;
padding: 0.4em;
padding-bottom: 0.5em;
font-family: "Poiret One";
}
// vim:ft=scss

View file

@ -0,0 +1,109 @@
(defwindow powermenu
:monitor 0
:stacking "bg"
:windowtype "normal"
:wm-ignore true
:geometry (geometry :width "100%" :height "100%")
(powermenu_layout))
(defpoll time :interval "5s"
:initial `date +'{"hour":"%H","min":"%M"}'`
`date +'{"hour":"%H","min":"%M"}'`)
(defpoll net :interval "100s"
:initial `N/A`
`nmcli -t -f SIGNAL,ACTIVE device wifi \
| awk -F':' '{if($2=="yes")print$1}'`)
(defpoll eth :interval "100s"
:initial `N/A`
`nmcli -t -f TYPE,STATE device status \
| awk -F':' '{if($2=="connected")print$1}'`)
(defwidget powermenu_layout []
(box :class "layout-box" :space-evenly false :orientation "vertical"
:style "background-image: url('./powermenu/wallpaper')"
(box :valign "start" :space-evenly false :spacing 25
(_sundial)
(_battery :status {EWW_BATTERY.BAT0.status}
:battery {EWW_BATTERY.BAT0.capacity})
(_network :strength net :offline "󰤭 " :excellent "󰤨 " :good "󰤥 "
:okay "󰤢 " :slow "󰤟 ")
(_network_ethernet :name eth)
(label :text "|" :class "sep")
(button :onclick "eww close powermenu" :class "close-btn" ""))
(box :space-evenly false :hexpand true :vexpand true
(box :spacing 15 :class "tm-box" :space-evenly false
:valign "end" :halign "start"
(label :text "󰥔 ")
(label :text "${time.hour} ${time.min}"))
(_buttons :shutdown "poweroff" :reboot "reboot"
:logout "loginctl kill-session self"
:shutdown_icon "󰐥 " :reboot_icon "󰤁 "
:logout_icon "󰍃 "))))
(defwidget _battery [battery status]
(box :class "bat-box" :space-evenly false :spacing 8
(label :text {
status == 'Charging' ? "󰂄" :
battery < 10 ? "󰁺" :
battery < 20 ? "󰁻" :
battery < 30 ? "󰁼" :
battery < 40 ? "󰁽" :
battery < 50 ? "󰁾" :
battery < 60 ? "󰁿" :
battery < 70 ? "󰂀" :
battery < 80 ? "󰂁" :
battery < 90 ? "󰂂" :
"󰁹"})))
(defwidget _network [strength offline excellent
good okay slow]
(box :class "net-box"
:space-evenly false
:spacing 8
(label :text {strength == "" ? offline :
strength < 26 ? slow :
strength < 51 ? okay :
strength < 76 ? good : excellent})))
(defwidget _network_ethernet [name]
(box :class "net-box"
:space-evenly false
:spacing 8
(label :text {name == "ethernet" ? "󰈁 " : "󰈂 "})))
(defwidget _buttons [shutdown shutdown_icon reboot
reboot_icon logout logout_icon]
(box :class "btns-box" :spacing 5
:vexpand true :hexpand true
:valign "end" :halign "end"
:space-evenly false
(button :onclick shutdown shutdown_icon)
(button :onclick reboot reboot_icon)
(button :onclick logout logout_icon)))
(defwidget _sundial []
(label :class "sundial-lbl" :halign "end" :hexpand true
:text {time.hour >= 2 && time.hour <= 4 ? "Early Morning" :
time.hour <= 5 ? "Dawn" :
time.hour >= 6
&& (time.hour <= 8 && time.min <= 59)
? "Morning" :
time.hour >= 9
&& (time.hour <= 11 && time.min <= 59)
? "Late Morning" :
time.hour == 12 && time.min <= 29
? "Midday" :
time.hour >= 12 && time.hour <= 16
? "Afternoon" :
time.hour > 16 && time.hour <= 17
? "Late Afternoon" :
(time.hour >= 17 && time.min <= 1)
|| (time.hour <= 18 && time.min <= 20)
? "Early Evening" :
time.hour >= 18 && time.hour <= 19
? "Dusk" :
time.hour > 19 && time.hour <= 21
? "Late Evening" :
time.hour > 21 ? "Night" : "Midnight"}))
;; vim:ft=yuck

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB