laptop
Elias Almqvist 1 year ago
parent a4ba1c44c5
commit 4e5ab1a9d3
No known key found for this signature in database
GPG Key ID: E31A99CE3E75A158
  1. 162
      eww/.config/eww/eww.scss
  2. 200
      eww/.config/eww/eww.yuck

@ -29,160 +29,100 @@ $anim-transition: 150ms;
* { * {
all: unset; //Unsets everything so you can style everything from scratch all: unset; //Unsets everything so you can style everything from scratch
font-family: "Fira Code"; font-family: "Lato Mono";
// color: $fg-color;
} }
tooltip { tooltip {
color: $fg-alt-color; color: $fg-alt-color;
background-color: $bg-alt-color; background-color: $bg-alt-color;
border-radius: 12px;
} }
.bar-1, .bar-1,
.bar-2 { .bar-2 {
background-color: $bg-color; background-color: rgba(0, 0, 0, 0.65);
color: $fg-alt-color;
border-right: solid 1px $border-color;
}
.segment-end {
}
// Styles on classes (see eww.yuck for more information)
button {
transition-property: opacity, color;
transition-duration: $anim-transition;
} }
// Workspaces .main-cont {
.workspaces { padding-left: 1.5rem;
padding: .3rem; padding-right: 1.5rem;
padding-bottom: 0;
padding-top: 4px;
} }
.workspaces > button { .segment-start,
font-size: $font-size; .segment-middle,
margin: 4px; .segment-end {
} }
.workspaces > button:hover { .icon {
color: $fg-sel-color; opacity: 1;
opacity: 0.8; transition: opacity $anim-transition;
} }
button.active { .icon:hover {
// font-weight: bold; opacity: 0.6;
color: $fg-sel-color;
} }
button.inactive { .inactive,
color: $fg-desel-color; .active {
font-size: 1.28rem;
} }
// Generic stuff .inactive {
scale trough { color: $fg-color;
all: unset;
background-color: $bg-alt-color;
border-radius: 5px;
min-height: 60px;
min-width: 4px;
margin: 0.3rem 0 0.3rem 0;
}
// Menu
.powermenu {
transition: color $anim-transition; transition: color $anim-transition;
// border-right: solid 1px $border-color; color: $fg-color;
padding: 0.5rem 0.2rem 0.3rem 0.2rem;
} }
.active {
.quit, color: $fg-color;
.lock,
.reboot,
.poweroff {
// padding: .5rem .2rem .3rem .2rem;
} }
// Colors for the buttons .pm-inner {
.lock:hover { padding-left: 6px;
color: $blue; padding-right: 6px;
} padding-top: 0;
.quit:hover { padding-bottom: 0;
color: $green;
}
.reboot:hover {
color: $yellow;
}
.poweroff:hover {
color: $red;
} }
.pm-active { .icon {
// background-color: $bg-alt-color; font-size: 1.2rem;
// border-radius: 5px; padding-left: 6px;
padding-right: 6px;
} }
.pm-inner { .logo {
padding: 0.2rem 0; font-weight: 600;
} }
// Control .logo-seperator {
.control { border-left: 2px solid $fg-color;
margin-bottom: $logo-size;
margin-bottom: 0.5rem;
font-family: Material Icons;
font-size: 1.6em;
} }
.icon { .time {
margin: 0 0.2rem; font-size: 1rem;
font-size: $icon-size; font-weight: 600;
font-family: Material Icons;
padding: 0 1px;
} }
.icon:hover { // Volume stuff
opacity: 0.6; .vol {
padding-left: 0;
} }
// Volume stuff
.volbar trough highlight { .volbar trough highlight {
background-color: $fg-accent; background-color: $fg-accent;
border-radius: 5px; border-radius: 8px;
}
// Time
.time {
// color: $fg-alt-color;
font-size: 11px;
font-weight: bold;
border-top: solid 2px $fg-alt-color;
padding-top: 1rem;
margin-bottom: 0.5rem;
} }
// Logo button scale trough {
.logo { all: unset;
margin: 0 0.8rem; background-color: $bg-alt-color;
margin-top: 6px; border-radius: 8px;
font-size: $logo-size; min-height: 6px;
} min-width: 70px;
margin: 0px 8px 0px 0px;
.logo-seperator {
border-bottom: 2px solid $border-color;
padding-bottom: 0.4rem;
} }
// Color overrides
.red { .red {
color: $red; color: $red;
opacity: 0.8;
}
// Music widget
.musicmenu {
// background-color: $bg-alt-color;
}
.mm-inner {
color: $blue;
} }

@ -1,57 +1,42 @@
(defwidget bar [screen] (defwidget bar-1 [screen]
(box :orientation "v" (box :class "main-cont"
:vexpand "false" :orientation "h"
:hexpand "false"
(box :class "segment-start" (box :class "segment-start"
:valign "start" :halign "start"
:halign "center"
:space-evenly false
:orientation "v"
:space-evenly false
(power :screen screen)
)
(box :class "segment-mid"
:valign "center" :valign "center"
:halign "center" (start-control :screen screen)
:orientation "v"
:space-evenly false
(workspaces :wsp workspaces-data :screen screen)
) )
(box :class "segment-end" (box :class "segment-middle"
:valign "end"
:halign "center" :halign "center"
:orientation "v" :valign "center"
:space-evenly true :space-evenly true
(control :screen screen) (mid-control)
)
(box :class "segment-end"
:halign "end"
:valign "center"
(end-control)
) )
) )
) )
(defwidget bar-2 [screen] (defwidget bar-2 [screen]
(box :orientation "v" (box :class "main-cont"
:vexpand "false" :orientation "h"
:hexpand "false"
(box :class "segment-start" (box :class "segment-start"
:valign "start" :halign "start"
:halign "center"
:space-evenly false
:orientation "v"
:space-evenly false
;; (power :screen screen)
)
(box :class "segment-mid"
:valign "center" :valign "center"
:halign "center" (start-control :screen screen)
:orientation "v"
:space-evenly false
(workspaces :wsp workspaces-data :screen screen)
) )
(box :class "segment-end" (box :class "segment-middle"
:valign "end"
:halign "center" :halign "center"
:orientation "v" :valign "center"
:space-evenly true :space-evenly true
(control-2 :screen screen) (mid-control)
)
(box :class "segment-end"
:halign "end"
:valign "center"
) )
) )
) )
@ -60,22 +45,19 @@
(defwidget power [] (defwidget power []
(eventbox ;;:onhover "${EWW_CMD} update power=true" (eventbox ;;:onhover "${EWW_CMD} update power=true"
:onhoverlost "${EWW_CMD} update power=false" :onhoverlost "${EWW_CMD} update power=false"
(box :orientation "v" (box :orientation "h"
:space-evenly "false" :space-evenly "false"
:vexpand "false" :vexpand "false"
:class "powermenu ${power ? 'pm-active' : ''}" :class "powermenu ${power ? 'pm-active' : ''}"
;; Open menu button ;; Open menu button
(button :class "icon logo ${power ? 'logo-seperator' : ''}" (revealer :transition "slideleft"
:tooltip "Open menu"
:onclick "${EWW_CMD} update power=true" "Λ")
(revealer :transition "slidedown"
:reveal power :reveal power
:duration "450ms" :duration "450ms"
(box :orientation "v" (box :orientation "h"
:class "pm-inner" :class "pm-inner"
:space-evenly true :space-evenly true
:halign "middle" :valign "middle"
:spacing 6 :spacing 16
;; Lock screen ;; Lock screen
(button :class "icon lock" (button :class "icon lock"
@ -98,72 +80,64 @@
:onclick "poweroff" "") :onclick "poweroff" "")
)) ))
(button :class "icon logo ${power ? 'logo-seperator' : ''}"
:tooltip "Open menu"
:onclick "${EWW_CMD} update power=true" "Λ")
))) )))
(defvar power false) (defvar power false)
;; Control widget (container) ;; Control widget (container)
(defwidget control [] (defwidget start-control [screen]
(box :class "control" :spacing 12 :space-evenly false :orientation "v" (box :class "control" :spacing 16 :space-evenly false :orientation "h"
;; (wifi) (workspaces :wsp workspaces-data :screen screen)
;; (bat)
(music)
(volume)
(time)
) )
) )
(defwidget mid-control []
(defwidget control-2 [] (box :class "control" :spacing 16 :space-evenly false :orientation "h"
(box :class "control" :spacing 12 :space-evenly false :orientation "v"
;; (wifi)
;; (bat)
;; (music)
;; (volume)
(time) (time)
) )
) )
(defwidget end-control []
(box :class "control" :spacing 16 :space-evenly false :orientation "h"
(music)
(volume)
(power)
)
)
;; Clock Widget ;; Clock Widget
(defwidget time [] (defwidget time []
(box :orientation "v" (box :orientation "h"
:class "time" :class "time"
:valign "end" :space-evenly "false"
(button :onclick "scripts/popup calendar" :halign "middle"
:class "hour" hour)
(button :onclick "scripts/popup calendar"
:class "min" min)
(button :onclick "scripts/popup calendar" (button :onclick "scripts/popup calendar"
:class "sec" sec) :class "day" full-time)
)) ))
(defpoll hour :interval "1s" "date '+%H'") (defpoll full-time :interval "1s" "date +'%d %B (%m), %Y - %A %H:%M:%S'")
(defpoll min :interval "1s" "date '+%M'")
(defpoll sec :interval "1s" "date '+%S'")
;; Volume widget ;; Volume widget
(defwidget volume [] (defwidget volume []
(eventbox :onhover "${EWW_CMD} update volume=true" (eventbox :onhover "${EWW_CMD} update volume=true"
:onhoverlost "${EWW_CMD} update volume=false" :onhoverlost "${EWW_CMD} update volume=false"
(box :orientation "v" (box :class "" :space-evenly "false" :orientation "h" :spacing "4"
:space-evenly "false" (revealer :transition "slideleft"
:spacing 2
(revealer :transition "slideup"
:reveal volume :reveal volume
:duration "450ms" :duration "350ms"
(scale :class "volbar" (scale :class "volbar"
:value current-volume :value current-volume
:orientation "v"
:flipped true :flipped true
:tooltip "Volume: ${current-volume}%" :orientation "h"
:max 101 :max 100
:min 0 :min 0
:onchange "amixer -D pulse sset Master {}%" :onchange "amixer -D pulse sset Master {}%" )
)
) )
(button :onclick "amixer -D pulse set Master 1+ toggle" (button :onclick "amixer -D pulse set Master 1+ toggle"
:class "icon volume + ${muted-volume != 'on' ? 'red' : ''}" :class "icon vol" {muted-volume != "on" ? "󰝟" : "󰕾"}
:tooltip "Volume: ${current-volume}%"
{muted-volume != "on" ? "󰝟" : "󰕾"}
) )
))) )
)
)
(defvar volume false) (defvar volume false)
(defpoll current-volume :interval "1ms" "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") (defpoll current-volume :interval "1ms" "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'")
(defpoll muted-volume :interval "1ms" "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $4 }' | tr -d '%'") (defpoll muted-volume :interval "1ms" "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $4 }' | tr -d '%'")
@ -191,7 +165,7 @@
;; Workspaces container ;; Workspaces container
(defwidget workspaces [wsp] (defwidget workspaces [wsp]
(box :space-evenly true :spacing 4 :orientation "v" :class "workspaces" (box :space-evenly true :spacing 16 :orientation "h" :class "workspaces"
(for ws in wsp (for ws in wsp
(workspace :data ws) (workspace :data ws)
))) )))
@ -200,7 +174,9 @@
(defwidget workspace [data] (defwidget workspace [data]
(button :onclick "wmctrl -s ${data['index']}" (button :onclick "wmctrl -s ${data['index']}"
:class {data["iscurrent"] == true ? "active" : "inactive"} :class {data["iscurrent"] == true ? "active" : "inactive"}
"${data['name']}" ;; "${data['name']}"
:tooltip "Switch to workspace ${data['name']}"
{data["iscurrent"] == true ? "" : ""}
)) ))
(deflisten workspaces-data "scripts/workspace.py") (deflisten workspaces-data "scripts/workspace.py")
@ -209,39 +185,36 @@
(revealer :reveal {music-active == "true"} (revealer :reveal {music-active == "true"}
(eventbox :onhover "${EWW_CMD} update music=true" (eventbox :onhover "${EWW_CMD} update music=true"
:onhoverlost "${EWW_CMD} update music=false" :onhoverlost "${EWW_CMD} update music=false"
(box :orientation "v" (box :orientation "h"
:space-evenly "false" :space-evenly "false"
:vexpand "false"
:class "musicmenu ${music ? 'mm-active' : ''}" :class "musicmenu ${music ? 'mm-active' : ''}"
(revealer :transition "slideup" (revealer :transition "slideleft"
:reveal music :reveal music
:flipped true :flipped true
:duration "450ms" :duration "450ms"
(box :orientation "v" (box :orientation "h"
:class "mm-inner" :class "mm-inner"
:space-evenly true :space-evenly true
:halign "middle" :valign "center"
:spacing 4 :spacing 8
;; Next ;; Pause
(button :class "icon next" (button :class "icon prev"
:tooltip "Pause/play" :tooltip "Pause/play"
:onclick "playerctl next" "") :onclick "playerctl previous" "")
;; Pause ;; Pause
(button :class "icon pause" (button :class "icon pause"
:tooltip "Pause/play" :tooltip "Pause/play"
:onclick "playerctl play-pause" {music-status == "Playing" ? "󰏤" : ""}) :onclick "playerctl play-pause" {music-status == "Playing" ? "󰏤" : "󰐊"})
;; Next
;; Pause (button :class "icon next"
(button :class "icon prev"
:tooltip "Pause/play" :tooltip "Pause/play"
:onclick "playerctl previous" "") :onclick "playerctl next" "")
)) ))
;; Open menu button ;; Open menu button
(button :class "icon" (button :class "icon"
:tooltip "${title} - ${artist}" :tooltip "Music"
:onclick "${EWW_CMD} update music=true" "") :onclick "${EWW_CMD} update music=true" "󰎈")
) )
))) )))
@ -261,23 +234,24 @@
:windowtype "dock" :windowtype "dock"
:geometry (geometry :x "0%" :geometry (geometry :x "0%"
:y "0%" :y "0%"
:width "42px" :width "100%"
:height "100%" :height "32px"
:anchor "left center") :anchor "top center")
:reserve (struts :side "left" :distance "42px") :reserve (struts :side "top" :distance "32px")
:hexpand "false" :hexpand "false"
:vexpand "false" :vexpand "false"
(bar :screen 1)) (bar-1 :screen 1))
(defwindow bar-2 (defwindow bar-2
:monitor 1 :monitor 1
:windowtype "dock" :windowtype "dock"
:geometry (geometry :x "0%" :geometry (geometry :x "0%"
:y "0%" :y "0%"
:width "42px" :width "100%"
:height "100%" :height "32px"
:anchor "left center") :anchor "top center")
:reserve (struts :side "left" :distance "42px") :reserve (struts :side "top" :distance "32px")
:hexpand "false" :hexpand "false"
:vexpand "false" :vexpand "false"
(bar-2 :screen 2)) (bar-2 :screen 2))

Loading…
Cancel
Save