Refactor codebase to use nix modules

This commit is contained in:
Julia Lange 2024-04-14 05:40:02 -07:00
parent a4735423b4
commit ffada2703c
114 changed files with 1018 additions and 744 deletions

View file

@ -0,0 +1,5 @@
(defwidget hyprwindow []
(label :text "${hyprwindow_listener}")
)
(deflisten hyprwindow_listener :initial "" "bash $XDG_CONFIG_HOME/eww/scripts/get-window-title")

View file

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

View file

@ -0,0 +1,8 @@
(defwidget internet []
(box :spacing 0 :space-evenly false :style "color: #f5c2e7"
network
)
)
(defpoll network :interval "30s"
"iwgetid -r")

View file

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

View file

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

View file

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