laptop, large refactor and some new stuff
This commit is contained in:
parent
c7a2895e5a
commit
07941251b5
15 changed files with 307 additions and 492 deletions
180
nixos/hosts/thalassa/null/home/eww/eww.yuck
Normal file
180
nixos/hosts/thalassa/null/home/eww/eww.yuck
Normal file
|
@ -0,0 +1,180 @@
|
|||
(defwidget bar []
|
||||
(centerbox :orientation "v" :hexpand false
|
||||
(box :valign "start" :hexpand false :vexpand true :orientation "v" :space-evenly false
|
||||
(powerbutton)
|
||||
)
|
||||
|
||||
(workspaces :halign "center" :vexpand true :hexpand false :orientation "v")
|
||||
|
||||
(box :valign "end" :hexpand false :vexpand true :orientation "v" :space-evenly false
|
||||
(wifi)
|
||||
(volume)
|
||||
(battery)
|
||||
(time)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; Variables
|
||||
; (defvar time false)
|
||||
; (defvar cal false)
|
||||
|
||||
;; ━━━ WIFI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
(defvar wifi "{}")
|
||||
(defpoll wifi :interval "30s" "./scripts/wifi.sh")
|
||||
|
||||
(defwidget wifi []
|
||||
(box :vexpand false :hexpand false :orientation "v"
|
||||
(label :text {wifi.icon}
|
||||
:limit-width 10
|
||||
:tooltip {wifi.status}
|
||||
:class "wifi"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; ━━━ BATTERY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
(defwidget battery []
|
||||
(eventbox :onclick "eww open batterywindow --toggle"
|
||||
(label :text `${
|
||||
EWW_BATTERY.BAT0.status == "Charging" ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 10 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 20 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 30 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 40 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 50 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 60 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 70 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 80 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity < 90 ? "" : ""
|
||||
}`
|
||||
:limit-width 10
|
||||
:tooltip "${EWW_BATTERY.BAT0.status}: ${EWW_BATTERY.BAT0.capacity}%"
|
||||
:class "battery"
|
||||
))
|
||||
)
|
||||
|
||||
(defwidget batterymenu []
|
||||
(box :orientation "v"
|
||||
:class "batterymenu"
|
||||
(label :text "${EWW_BATTERY.BAT0.status}: ${EWW_BATTERY.BAT0.capacity}%")
|
||||
(progress :value "${EWW_BATTERY.BAT0.capacity}" :orientation "h") ; TODO: change class (and color) on low juice
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow batterywindow
|
||||
:monitor 0
|
||||
:geometry (geometry
|
||||
:x "53px"
|
||||
:y "30px"
|
||||
:anchor "bottom left"
|
||||
)
|
||||
(batterymenu)
|
||||
)
|
||||
|
||||
;; ━━━ VOLUME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
(defvar volume "{}")
|
||||
(defpoll volume :interval "1s" "./scripts/volume.sh")
|
||||
(defwidget volume []
|
||||
(eventbox :onclick "pamixer -t"
|
||||
(label :text {volume.icon}
|
||||
:limit-width 10
|
||||
:tooltip "${volume.percent}%"
|
||||
:class "volume"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; ━━━ TIME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
(defpoll hour :interval "10s" "date +%H")
|
||||
(defpoll minute :interval "10s" "date +%M")
|
||||
(defpoll dateVar :interval "600s" "date '+%A %d.%m.%y'")
|
||||
|
||||
(defwidget time []
|
||||
(eventbox :cursor "hand" :hexpand false :vexpand false
|
||||
:tooltip "${dateVar}"
|
||||
:onclick "eww open calendar --toggle &"
|
||||
(box :orientation "v" :hexpand false :vexpand false :space-evenly false :class "clock"
|
||||
(label :class "date" :text "${hour}")
|
||||
|
||||
(label :class "date" :text "${minute}")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; Calendar
|
||||
(defpoll calendar_day :interval "20h" "date '+%d'")
|
||||
(defpoll calendar_year :interval "20h" "date '+%Y'")
|
||||
(defwidget cal []
|
||||
(box :class "cal" :orientation "v"
|
||||
(box :class "cal-in"
|
||||
(calendar :class "cal"
|
||||
:day calendar_day
|
||||
:year calendar_year))))
|
||||
|
||||
(defwindow calendar
|
||||
:monitor 0
|
||||
:geometry (geometry :x "53px"
|
||||
:y "5px"
|
||||
:anchor "bottom left"
|
||||
:width "270px"
|
||||
:height "60px")
|
||||
(cal))
|
||||
|
||||
;; powermenu
|
||||
|
||||
(defwidget powerbutton []
|
||||
(eventbox :cursor "hand"
|
||||
(button :class "reg-btn powerbutton"
|
||||
:onclick "eww open powermenu --toggle &" "")
|
||||
)
|
||||
)
|
||||
(defwidget powermenucontent []
|
||||
(box :orientation "h"
|
||||
:class "powermenu-container"
|
||||
(box :class "shutdown-btn-box"
|
||||
:orientation "h"
|
||||
(button :class "btn"
|
||||
:tooltip "Shutdown"
|
||||
:onclick "eww close powermenu && shutdown now"
|
||||
"⏻")
|
||||
)
|
||||
(box :class "reboot-btn-box"
|
||||
:orientation "h"
|
||||
(button :class "btn"
|
||||
:tooltip "Reboot"
|
||||
:onclick "eww close powermenu && reboot"
|
||||
"")
|
||||
)
|
||||
(box :class "exit-btn-box"
|
||||
:orientation "h"
|
||||
(button :class "btn"
|
||||
:tooltip "Suspend"
|
||||
:onclick "systemctl suspend"
|
||||
"⏾")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow powermenu
|
||||
:monitor 0
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0%"
|
||||
:width "30%"
|
||||
:height "15%"
|
||||
:anchor "center center")
|
||||
:wm-ignore true
|
||||
(powermenucontent))
|
||||
|
||||
(deflisten workspaces_listen "./scripts/workspaces.sh")
|
||||
(defwidget workspaces []
|
||||
(literal :content workspaces_listen))
|
||||
|
||||
(defwindow bar
|
||||
:monitor 0
|
||||
:exclusive false
|
||||
:geometry (geometry :height "1080px" :x "-4px" :y "0px"
|
||||
:width "52px"
|
||||
:anchor "top left")
|
||||
:stacking "fg"
|
||||
(bar))
|
Loading…
Add table
Add a link
Reference in a new issue