Fixed bar stuff

lightmode
E. Almqvist 2 years ago
parent 8a7ff7e7a1
commit e777e7bdae
  1. 38
      eww/.config/eww/eww.scss
  2. 124
      eww/.config/eww/eww.yuck

@ -32,9 +32,8 @@ $anim-transition: 150ms;
// color: $fg-color; // color: $fg-color;
} }
// Bar styles tooltip {
.time-thing { background-color: $red;
opacity: 0.2;
} }
.bar-1, .bar-2 { .bar-1, .bar-2 {
@ -44,6 +43,9 @@ $anim-transition: 150ms;
padding: .3rem; padding: .3rem;
} }
.segment-end {
}
// Styles on classes (see eww.yuck for more information) // Styles on classes (see eww.yuck for more information)
button { button {
transition-property: opacity, color; transition-property: opacity, color;
@ -87,10 +89,11 @@ scale trough {
.powermenu { .powermenu {
transition: color $anim-transition; transition: color $anim-transition;
// border-right: solid 1px $border-color; // border-right: solid 1px $border-color;
padding: .5rem .2rem .3rem .2rem;
} }
.quit, .lock, .reboot, .poweroff { .quit, .lock, .reboot, .poweroff {
padding: .5rem .2rem .3rem 0rem; // padding: .5rem .2rem .3rem .2rem;
} }
// Colors for the buttons // Colors for the buttons
@ -122,6 +125,7 @@ scale trough {
margin: 0 .2rem; margin: 0 .2rem;
font-size: $icon-size; font-size: $icon-size;
font-family: Material Icons; font-family: Material Icons;
padding: 0 1px;
} }
.icon:hover { .icon:hover {
@ -138,33 +142,39 @@ scale trough {
// Time // Time
.time { .time {
font-size: 11px; font-size: 11px;
// border-radius: 5px; font-weight: bold;
border-top: solid 2px $border-color; border-top: solid 2px $border-color;
color: $fg-alt-color; color: $fg-alt-color;
padding: .7rem 0; padding: 1rem 0;
padding-bottom: .5rem; padding-bottom: 0rem;
margin: .5rem 0 .5rem 0; margin: .5rem 0 .5rem 0;
} }
// Logo button // Logo button
.logo { .logo {
margin: 0 .8rem;
margin-top: 6px; margin-top: 6px;
font-size: $logo-size; font-size: $logo-size;
opacity: 0.8; opacity: 0.5;
} }
.logo-seperator { .logo-seperator {
border-bottom: 2px solid $border-color; border-bottom: 2px solid $border-color;
padding-bottom: .4rem;
} }
// .logo:hover {
// // color: $red;
// }
// Color overrides // Color overrides
.red { .red {
color: $red; color: $red;
opacity: 0.8; opacity: 0.8;
} }
// Music widget
.musicmenu {
// background-color: $bg-alt-color;
}
.mm-inner {
color: $blue;
}

@ -4,34 +4,59 @@
:hexpand "false" :hexpand "false"
(box :class "segment-start" (box :class "segment-start"
:valign "start" :valign "start"
:halign "center"
:space-evenly false :space-evenly false
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
;; (logo) (power :screen screen)
(power)
) )
(box :class "segment-mid" (box :class "segment-mid"
:valign "center" :valign "center"
:halign "center"
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
(workspaces :wsp workspaces-data) (workspaces :wsp workspaces-data :screen screen)
) )
(box :class "segment-end" (box :class "segment-end"
:valign "end" :valign "end"
:halign "center"
:orientation "v" :orientation "v"
:space-evenly false :space-evenly true
(control) (control :screen screen)
) )
) )
) )
;; Logo widget (defwidget bar-2 [screen]
(defwidget logo [] (box :orientation "v"
(button :class "logo" :vexpand "false"
"Λ" :hexpand "false"
)) (box :class "segment-start"
:valign "start"
:halign "center"
:space-evenly false
:orientation "v"
:space-evenly false
;; (power :screen screen)
)
(box :class "segment-mid"
:valign "center"
:halign "center"
:orientation "v"
:space-evenly false
(workspaces :wsp workspaces-data :screen screen)
)
(box :class "segment-end"
:valign "end"
:halign "center"
:orientation "v"
:space-evenly true
(control-2 :screen screen)
)
)
)
;; Powermenu Widgets ;; ;; Powermenu widget
(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"
@ -73,8 +98,6 @@
:onclick "poweroff now" "") :onclick "poweroff now" "")
)) ))
;; Poweroff
))) )))
(defvar power false) (defvar power false)
@ -83,11 +106,22 @@
(box :class "control" :spacing 12 :space-evenly false :orientation "v" (box :class "control" :spacing 12 :space-evenly false :orientation "v"
;; (wifi) ;; (wifi)
;; (bat) ;; (bat)
(music)
(volume) (volume)
(time) (time)
) )
) )
(defwidget control-2 []
(box :class "control" :spacing 12 :space-evenly false :orientation "v"
;; (wifi)
;; (bat)
;; (music)
;; (volume)
(time)
)
)
;; Clock Widget ;; Clock Widget
(defwidget time [] (defwidget time []
(box :orientation "v" (box :orientation "v"
@ -110,7 +144,7 @@
:onhoverlost "${EWW_CMD} update volume=false" :onhoverlost "${EWW_CMD} update volume=false"
(box :orientation "v" (box :orientation "v"
:space-evenly "false" :space-evenly "false"
:spacing "2" :spacing 2
(revealer :transition "slideup" (revealer :transition "slideup"
:reveal volume :reveal volume
:duration "450ms" :duration "450ms"
@ -169,18 +203,56 @@
)) ))
(deflisten workspaces-data "scripts/workspace.py") (deflisten workspaces-data "scripts/workspace.py")
;; Music widget
(defwidget music []
(revealer :reveal {music-status == "Playing" || music-status == "Paused"}
(eventbox :onhover "${EWW_CMD} update music=true"
:onhoverlost "${EWW_CMD} update music=false"
;; :onclick "wget ${artUrl} -O /tmp/cover.jpg; sleep 1; notify-send -i /tmp/cover.jpg '${title} - ${artist}' '${songtime}'"
(box :orientation "v"
:space-evenly "false"
:vexpand "false"
:class "musicmenu ${music ? 'mm-active' : ''}"
(revealer :transition "slideup"
:reveal music
:flipped true
:duration "450ms"
(box :orientation "v"
:class "mm-inner"
:space-evenly true
:halign "middle"
:spacing 4
(defwidget metric [label value onchange] ;; Next
(box :orientation "v" (button :class "icon next"
:class "metric" :tooltip "Pause/play"
:space-evenly false :onclick "playerctl next" "")
(box :class "label" label) ;; Pause
(scale :min 0 (button :class "icon pause"
:max 101 :tooltip "Pause/play"
;; :orientation "v" :onclick "playerctl play-pause" {music-status == "Playing" ? "" : ""})
:active {onchange != ""}
:value {value == "" ? "0" : value} ;; Pause
:onchange onchange))) (button :class "icon prev"
:tooltip "Pause/play"
:onclick "playerctl previous" "")
))
;; Open menu button
(button :class "icon"
:tooltip "${title} - ${artist}"
:onclick "${EWW_CMD} update music=true" "")
)
)))
(defpoll music-status :interval "200ms" "playerctl status")
(defpoll artUrl :interval "200ms" "playerctl metadata artUrl")
(defpoll title :interval "200ms" "playerctl metadata title")
(defpoll artist :interval "200ms" "playerctl metadata artist")
(defpoll songtime :interval "500ms" "scripts/getSongDuration")
(defvar music false)
;; WINDOWS ;; WINDOWS
(defwindow bar-1 (defwindow bar-1
@ -207,7 +279,7 @@
:reserve (struts :side "left" :distance "42px") :reserve (struts :side "left" :distance "42px")
:hexpand "false" :hexpand "false"
:vexpand "false" :vexpand "false"
(bar :screen 2)) (bar-2 :screen 2))
(defwindow time-thing (defwindow time-thing
:monitor 0 :monitor 0

Loading…
Cancel
Save