|
|
@ -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)) |
|
|
|
|
|
|
|
|
|
|
|