Refactor codebase to use nix modules
This commit is contained in:
parent
a4735423b4
commit
ffada2703c
114 changed files with 1018 additions and 744 deletions
40
hmModules/services/widgets/eww/config/modules/bar.yuck
Normal file
40
hmModules/services/widgets/eww/config/modules/bar.yuck
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
(include "./widgets/components/hyprwindow.yuck")
|
||||
(include "./widgets/components/hyprworkspaces.yuck")
|
||||
(include "./widgets/components/internet.yuck")
|
||||
(include "./widgets/components/japanesedate.yuck")
|
||||
(include "./widgets/components/japaneseaudio.yuck")
|
||||
|
||||
(defwidget bar []
|
||||
(centerbox :orientation "horizontal"
|
||||
:style "padding: 0px 8px"
|
||||
(box :halign "start"
|
||||
:spacing 18
|
||||
:space-evenly false
|
||||
(hyprworkspaces)
|
||||
(hyprwindow)
|
||||
)
|
||||
""
|
||||
(box :halign "end"
|
||||
:spacing 18
|
||||
:space-evenly false
|
||||
(eventbox :onhover "eww open preview"
|
||||
:onhoverlost "eww close preview"
|
||||
barplayer
|
||||
)
|
||||
(internet)
|
||||
(japaneseaudio)
|
||||
(japanesedate)
|
||||
(label :style "color: #FAE3B0"
|
||||
:text bartime
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll bartime :interval "10s"
|
||||
"date '+%H:%M'"
|
||||
)
|
||||
|
||||
(deflisten barplayer :initial ""
|
||||
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true"
|
||||
)
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
(defwidget hyprwindow []
|
||||
(label :text "${hyprwindow_listener}")
|
||||
)
|
||||
|
||||
(deflisten hyprwindow_listener :initial "" "bash $XDG_CONFIG_HOME/eww/scripts/get-window-title")
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
(defwidget hyprworkspaces []
|
||||
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
||||
(box :space-evenly false
|
||||
:spacing 5
|
||||
(for workspace in workspaces
|
||||
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
(box :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
|
||||
(label :text "${workspace.id}")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(deflisten workspaces :initial "[]" "bash $XDG_CONFIG_HOME/eww/scripts/get-workspaces")
|
||||
(deflisten current_workspace :initial "1" "bash $XDG_CONFIG_HOME/eww/scripts/get-active-workspace")
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
(defwidget internet []
|
||||
(box :spacing 0 :space-evenly false :style "color: #f5c2e7"
|
||||
network
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll network :interval "30s"
|
||||
"iwgetid -r")
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
(defwidget japaneseaudio []
|
||||
(eventbox :onscroll "bash -c 'if [ '{}' = 'up' ]; then pamixer -i 5; else pamixer -d 5; fi'"
|
||||
(box :spacing 0 :space-evenly false :style "color: #96CDFB"
|
||||
volume
|
||||
"音"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll volume :interval "1s"
|
||||
"pamixer --get-volume")
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
(defwidget japanesebattery []
|
||||
(box :spacing 0 :space-evenly false :style "color: #FAB387"
|
||||
power
|
||||
"電"
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll power :interval "1m"
|
||||
"cat /sys/class/power_supply/BAT1/capacity")
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
(defwidget japanesedate []
|
||||
(label :style "color: #DDB6F2"
|
||||
:text japanesedate_time
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll japanesedate_time :interval "100s"
|
||||
"bash $XDG_CONFIG_HOME/eww/scripts/japanesedate"
|
||||
)
|
||||
15
hmModules/services/widgets/eww/config/modules/powerbar.yuck
Normal file
15
hmModules/services/widgets/eww/config/modules/powerbar.yuck
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(defwidget powerbar []
|
||||
(box
|
||||
:orientation "vertical"
|
||||
:spacing 8
|
||||
:space-evenly false
|
||||
:style "color: #FAB387"
|
||||
(progress
|
||||
:orientation "v"
|
||||
:value {100 - power})
|
||||
"電"
|
||||
)
|
||||
)
|
||||
|
||||
(defpoll power :interval "1m"
|
||||
"cat /sys/class/power_supply/BAT1/capacity")
|
||||
15
hmModules/services/widgets/eww/config/modules/switch.yuck
Normal file
15
hmModules/services/widgets/eww/config/modules/switch.yuck
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(defwindow switch
|
||||
:monitor 1
|
||||
:stacking "fg"
|
||||
:focusable false
|
||||
:geometry (geometry :y "60%"
|
||||
:width "500px"
|
||||
:height "110px"
|
||||
:anchor "top center")
|
||||
(border
|
||||
"Example contenting")
|
||||
)
|
||||
|
||||
(defwidget border []
|
||||
(box :class "content-box"
|
||||
(children)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue