1 Star 0 Fork 0

FZDSLR/dotfile

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
eww.yuck 4.69 KB
一键复制 编辑 原始数据 按行查看 历史
FZDSLR 提交于 2024-06-30 20:09 +08:00 . 0630
(deflisten workspace "./scripts/workspaces.sh")
(defwidget workspaces []
(literal :content workspace)
)
(deflisten volume :initial "0" "./scripts/audio.sh volume")
; (deflisten vo-symbol :initial "0" "./scripts/audio.sh symbol")
(defpoll month :interval "1s" "date +%m")
(defpoll day :interval "1s" "date +%d")
(defpoll hour :interval "1s" "date +%H")
(defpoll min :interval "1s" "date +%M")
;(defpoll sec :interval "1s" "date +%S")
(defvar eww "eww")
(defpoll wifi-icon :interval "1s" "./scripts/wifi.sh icon")
(defpoll wifi-name :interval "1s" "./scripts/wifi.sh name")
(defpoll brightness :interval "5s" :initial 0 "brightnessctl -m | awk -F, '{print substr($4, 0, length($4)-1)}'")
(defvar br_reveal false)
(defpoll baticon :interval "1s" "./scripts/battery.sh icon")
(defpoll batper :interval "1m" "./scripts/battery.sh percent")
(defwidget bar []
(centerbox :orientation "v"
(box :class "segment-top"
:valign "start"
(top))
(box :valign "center"
:class "middle"
(middle))
(box :valign "end"
:class "segment-bottom"
:vexpand true
(bottom))))
(defwidget top []
(workspaces :halign "center" :vexpand true :hexpand false :orientation "v"))
(defwidget middle []
"")
(defwidget bottom []
(box :orientation "v"
:vexpand true
:valign "end"
:space-evenly false
:spacing 5
; (wifi)
; (bright)
(re-statusbar)
(statusbar)
(time)
))
(defwidget statusbar []
(box :class "statusbar" :space-evenly true :valign "end" :spacing 3 :orientation "v" :vexpand true
(cpupgs)
(cpulabel)
(mempgs)
(memlabel)
(batpgs)
(batlabel)
(wifi)
))
(defwidget re-statusbar []
(box :class "re-statusbar" :space-evenly false :orientation "v" :vexpand true :spacing 3
(volume)
(bright)
)
)
(defwidget bright []
(eventbox :onhover "${eww} update br_reveal=true"
:onhoverlost "${eww} update br_reveal=false"
(box :orientation "v"
:space-evenly "false"
:spacing 1
; (revealer :transition "slideup"
; :reveal br_reveal
; :duration "550ms"
; (scale :class "brightbar"
; :value {brightness}
; :tooltip "Brightness: ${brightness}%"
; :onchange "${eww} update brightness ={}; brightnessctl set {}%"
; :orientation "v"
; :flipped true
; :max 101
; :min 0))
;)
(label :class "brightness-icon"
:text "")
(label :text brightness :class "brightness-num")
)))
(defwidget volume []
(box :orientation "v"
:space-evenly "false"
:spacing 1
(label :class "volume-icon"
; :text vo-symbol)
:text "")
(label :class "volume-num"
:text volume)
))
(defwidget cpupgs[]
(circular-progress :value {EWW_CPU.avg}
:class "cpubar"
:thickness 2
:start-at 75
)
)
(defwidget cpulabel []
(box :vexpand "true" :hexpand "false" :orientation "v"
(label :class "iconcpu" :text "CPU")
(label :class "iconcpu2" :text "${round(EWW_CPU.avg,0)}")
)
)
(defwidget mempgs []
(box :vexpand "true" :hexpand "false" :orientation "v"
(circular-progress :value {EWW_RAM.used_mem_perc}
:class "membar"
:thickness 2
:start-at 75
)
; (label :class "iconmem" :text "MEM")
)
)
(defwidget memlabel []
(box :vexpand "true" :hexpand "false" :orientation "v"
(label :class "iconmem" :text "MEM")
(label :class "iconmem2" :text "${round(EWW_RAM.used_mem_perc,0)}")
)
)
(defwidget batpgs[]
(circular-progress :value {batper}
:class "batbar"
:thickness 2
:start-at 75
(label :halign "center" :valign "center" :text {baticon})
)
)
(defwidget batlabel []
(box :vexpand "true" :hexpand "false" :orientation "v"
(label :class "iconbat" :text "BAT")
(label :class "iconbat2" :text "${batper}")
)
)
(defwidget wifi []
(box :vexpand "true" :hexpand "false" :orientation "v" :tooltip "${wifi-name}"
(label :class "iconwifi" :text "WIFI")
(label :class "iconwifi2" :text "${wifi-icon}")
)
)
(defwidget time []
(box :orientation "v"
:class "time"
:space-evenly "false"
:spacing 2
:vexpand "true"
hour min))
(defwindow bar
:monitor 0
:geometry (geometry :x "5px"
:y "5px"
:width "35px"
:height "99%"
:anchor "left center")
:stacking "fg"
:exclusive "true"
(bar))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/FZDSLR/dotfile.git
git@gitee.com:FZDSLR/dotfile.git
FZDSLR
dotfile
dotfile
master

搜索帮助