dotfiles/eww/eww.yuck
2022-05-22 15:32:36 -04:00

184 lines
2.8 KiB
Text

;; ______ Valerie' Amazing ____
;; / ____/ ___ __ / __ )____ ______
;; / __/ | | /| / / | /| / / / __ / __ `/ ___/
;; / /___ | |/ |/ /| |/ |/ / / /_/ / /_/ / /
;;/_____/ |__/|__/ |__/|__/ /_____/\__,_/_/
;;
(include "./sidebar.yuck")
(include "./calendar.yuck")
;; Variables
(defvar sidebar_rev false)
(defvar WM_MODE "default")
(defpoll
DATETIME
:interval "2s"
"date +\"%a %b %d %I:%M %p\""
)
(defpoll REDSHIFT
:interval "2m"
"/home/val/.config/eww/scripts/redshift.sh"
)
(defpoll KEYBOARD
:interval "20ms"
"/home/val/.config/eww/scripts/kb.sh"
)
(defpoll LAN
:interval "2s"
"/home/val/.config/eww/scripts/lan.sh"
)
(defpoll PLAYING
:interval "50ms"
"playerctl status"
)
(deflisten i3-workspace "/home/val/.config/eww/bin/i3-ws")
;; Left Section
(defwidget distro []
(box
:orientation "h"
:space-evenly false
:halign "start"
(button
:class "icon"
:onclick "exec ~/.script/sysmenu.py system &"
""
)
)
)
(defwidget workspace []
(box
:space-evenly false
(revealer
:reveal { WM_MODE != "default" }
:transition "slideleft"
(label
:text WM_MODE
:style "margin-left: 8px;"
)
)
(literal :content i3-workspace)
)
)
(defwidget left []
(box
:orientation "h"
:space-evenly false
:halign "start"
:class "left_modules"
(distro)
(workspace)
)
)
;; Right Section
(defwidget keyboard []
(box
:class "module"
:space-evenly false
:orientation "h"
:spacing "3"
(revealer
:reveal {KEYBOARD != ""}
:transition "slideleft"
:duration "350ms"
(button
:class "icon"
KEYBOARD
)
)
)
)
(defwidget redshift []
(box
:class "module"
:space-evenly false
:orientation "h"
:spacing "3"
(button
:class "icon"
:onclick "exec ~/.script/sysmenu.py redshift &"
REDSHIFT
)
)
)
(defwidget wifi []
(box
:class "module"
:space-evenly false
:orientation "h"
:spacing "3"
(button
:class "icon"
:onclick "exec ~/.script/sysmenu.py lan &"
LAN
)
)
)
(defwidget sidebar_toggle []
(box
:class "module"
:space-evenly false
:orientation "h"
:spacing "3"
(button
:class "icon-sm"
:onclick "/home/val/.config/eww/scripts/toggle_sidebar.sh"
{sidebar_rev ? "" : "﬿"}
)
)
)
(defwidget datetime []
(box
:class "module"
:space-evenly false
:orientation "h"
:spacing 5
(button
:onclick "/home/val/.config/eww/scripts/toggle_calendar.sh"
DATETIME
)
)
)
(defwidget right []
(box
:orientation "h"
:space-evenly false
:spacing 5
:halign "end"
:class "right_modules"
(keyboard)
(redshift)
(wifi)
(sidebar_toggle)
(datetime)
)
)
(defwidget bar []
(box
:class "bar"
:orientation "h"
(left)
(right)
)
)
;; Windows
(defwindow bar
:geometry (geometry
:x "0px"
:y "0px"
:width "100%"
:height "24px"
:anchor "top center"
)
:stacking "fg"
:windowtype "dock"
(bar)
)