eww stuff

This commit is contained in:
Simon Gardling 2025-02-05 10:35:27 -05:00
parent 8035c74d44
commit 63341f404f
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
7 changed files with 184 additions and 142 deletions

View File

@ -54,11 +54,11 @@
]
},
"locked": {
"lastModified": 1738709900,
"narHash": "sha256-8Bo5xFlCH5q72ExvAnH7TzStMlLZldKOSLMClRSfmTc=",
"lastModified": 1738753876,
"narHash": "sha256-yXT82kERWL4R81hfun9BuT478Q6ut0dJzdQjAxjRS38=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f2d32e46fac9d51da6912948ae1156044c71774b",
"rev": "f20b7a8ab527a2482f13754dc00b2deaddc34599",
"type": "github"
},
"original": {
@ -79,11 +79,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1738707843,
"narHash": "sha256-0DMn9YbqU7ODIOBzu15vcrBnSKe72HUDkOtxHcpjK4A=",
"lastModified": 1738756893,
"narHash": "sha256-8i0bwUAomkug0nTNkyzpVctC78FYCUWUg3kOtXVeR/c=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "a81adb09eb7eb2ffad1ac3b91d1e59083c8e5918",
"rev": "1b2c644b287066aa161734a727f3f6f5da9b4d5c",
"type": "github"
},
"original": {
@ -112,11 +112,11 @@
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1738654964,
"narHash": "sha256-30l3hOfTW1kJXcTRQsJ9f0/wE1aaTTACKb4ch6ZlLNU=",
"lastModified": 1738751713,
"narHash": "sha256-DxucZaCzH72v4SSUC6eK1TNLQVxBwXr1nYMsABoJ6ls=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "7d24ad23c2bc690b22b1f13ad4598dc8323d128b",
"rev": "900da597e4d3d09ad4c4ddc3ba2abf58c4886ec9",
"type": "github"
},
"original": {
@ -143,11 +143,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1738574474,
"narHash": "sha256-rvyfF49e/k6vkrRTV4ILrWd92W+nmBDfRYZgctOyolQ=",
"lastModified": 1738702386,
"narHash": "sha256-nJj8f78AYAxl/zqLiFGXn5Im1qjFKU8yBPKoWEeZN5M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fecfeb86328381268e29e998ddd3ebc70bbd7f7c",
"rev": "030ba1976b7c0e1a67d9716b17308ccdab5b381e",
"type": "github"
},
"original": {
@ -242,11 +242,11 @@
]
},
"locked": {
"lastModified": 1738710976,
"narHash": "sha256-/Zyfku2FxQKMs3LHI90Hy61o8VuXtI16RfvK/d849B0=",
"lastModified": 1738754044,
"narHash": "sha256-ptZWtXstcE1a3My6N0OrKTA0wQePsYqqKnGpSZZy/bY=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "0622c0eb2ab953e40e3d167eebe885a1f3bbe8f9",
"rev": "e4cef7c609c948a1ebc7f29602554d29fbad500d",
"type": "github"
},
"original": {

View File

@ -7,9 +7,7 @@
map (f: "${homeDirectory}/${f}") [
".zen"
".local/share/fish"
".wallpaper.png"
".ssh"
"Documents"
"projects"
"Pictures"

View File

@ -0,0 +1,17 @@
(defwindow dashboard
:monitor 0
:stacking "bg"
:exclusive false
:geometry (geometry
:y "50%"
:x "50%"
:width "20%"
:height "20%"
)(dashboard))
(defwidget dashboard []
(box
(label :text "hi"))
)

View File

@ -1,125 +1,2 @@
(defwindow statusbar
:monitor 0
:stacking "fg"
:exclusive true
:geometry (geometry
:y "0.5%"
:width "100%"
:height "24px"
:anchor "top center")
(statusbar))
(defwidget statusbar []
(centerbox
(box :space-evenly false :halign 'start' :class 'padded'
(window-title))
(time)
(box :space-evenly false :halign 'end' :class 'padded'
(brightness-ctl)
(brightness-ctl-opener)
; (clipboard)
(battery)
(bluetooth)
(wifi))))
(defwidget cmd-slider [?symbol value command max color]
(box :space-evenly false
(label :text symbol :class "symbol")
(scale
:min 0 :max max
:value value
:round-digits 0
:timeout "200ms"
:onchange command)
(label :text "${value}%" :class color)))
(defwidget window-title []
(label
:text windowtitle))
(defpoll windowtitle :interval "1s" `scripts/currentWindow.fish`)
(defpoll currentworkspace :interval "1s" `scripts/currentWorkspace.fish`)
(defwidget brightness-ctl []
(box :visible brightnessctl-open
(cmd-slider :symbol "󰃠" :value brightness
:command `brightnessctl set {}%`
:max 101 :color "${
brightness >= 80 ? "green" :
brightness >= 50 ? "yellow" :
brightness >= 30 ? "peach" :
brightness >= 10 ? "maroon" : "red"
}")))
(defpoll brightness :interval "1s" :run-while brightnessctl-open `brightnessctl -m | awk -F, '{print $4+0}'`)
(defvar brightnessctl-open false)
(defwidget brightness-ctl-opener []
(eventbox :class "button"
(button
:onclick `${EWW_CMD} update brightnessctl-open=${!brightnessctl-open}`
"󰃠")))
(defwidget clipboard []
(label :text clipboard-short :tooltip clipboard :class "clipboard"))
(defpoll clipboard :interval "5s" `scripts/clipboardInfo.zsh all`)
(defpoll clipboard-short :interval "5s" `scripts/clipboardInfo.zsh head`)
(defwidget wifi []
(eventbox
:class "button ${wifi-strength.colour}"
(label
:text {wifi-strength.icon}
:tooltip "Connected To: ${wifi-name}")))
(defpoll wifi-strength :interval "10s" `scripts/wifiInfo.zsh strength`)
(defpoll wifi-name :interval "1m" `scripts/wifiInfo.zsh name`)
(defwidget bluetooth []
(eventbox
:class "bluetooth button ${ bluetooth-name != "" ? "green" : "lavendar" }"
:onclick `blueman-manager &`
(label
:text "${bluetooth-name} 󰂯")))
(defpoll bluetooth-name :interval "10s" `bluetoothctl devices Connected | awk '{print $3}'`)
(defwidget time []
(box
:space-evenly false
:class "time"
:tooltip {time.long}
(label :class "yellow" :text {time.hour})
(label :text ":")
(label :class "yellow" :text {time.minute})))
(defpoll time :interval "1s" `date +'{"long":"%a %b %e %H:%M:%S %Z %Y","hour":"%H","minute":"%M"}'`)
; TODO: make this a package or something, not using rust-script
(defpoll powerstats :interval "2s" `~/Documents/power_bat.rs`)
(defwidget battery []
(box :space-evenly false
:tooltip powerstats
(label
:text "${EWW_BATTERY.BAT1.status == "Charging" ? "󰂄" :
EWW_BATTERY.BAT1.capacity >= 90 ? "󰁹" :
EWW_BATTERY.BAT1.capacity >= 80 ? "󰂂" :
EWW_BATTERY.BAT1.capacity >= 70 ? "󰂁" :
EWW_BATTERY.BAT1.capacity >= 60 ? "󰂀" :
EWW_BATTERY.BAT1.capacity >= 50 ? "󰁿" :
EWW_BATTERY.BAT1.capacity >= 40 ? "󰁾" :
EWW_BATTERY.BAT1.capacity >= 30 ? "󰁽" :
EWW_BATTERY.BAT1.capacity >= 20 ? "󰁼" :
EWW_BATTERY.BAT1.capacity >= 10 ? "󰁻" : "󰁺"
} "
:class "${
EWW_BATTERY.BAT1.capacity >= 80 ? "green" :
EWW_BATTERY.BAT1.capacity >= 50 ? "yellow" :
EWW_BATTERY.BAT1.capacity >= 30 ? "peach" :
EWW_BATTERY.BAT1.capacity >= 10 ? "maroon" : "red"
}")
(label :text "${EWW_BATTERY.BAT1.capacity}%" :class "yellow")))
(include "./statusbar.yuck")
(include "./dashboard.yuck")

View File

@ -0,0 +1,2 @@
#!/usr/bin/env sh
wpctl inspect @DEFAULT_SINK@ | rg "node.description" | cut -d' ' -f6-

View File

@ -0,0 +1,8 @@
#!/usr/bin/env sh
count=$(wpctl get-volume @DEFAULT_SINK@ | sed 's/Volume: //g' | sed 's/0\.[0]//g')
color="green"
if ((count > 75)); then color="yellow"; fi
if ((count > 90)); then color="peach"; fi
if ((count > 100)); then color="maroon"; fi
if ((count > 110)); then color="red"; fi
echo "{\"count\":\"${count}\", \"color\":\"${color}\"}"

View File

@ -0,0 +1,140 @@
(defwindow statusbar
:monitor 0
:stacking "fg"
:exclusive true
:geometry (geometry
:y "0.5%"
:width "100%"
:height "24px"
:anchor "top center")
(statusbar))
(defwidget statusbar []
(centerbox
(box :space-evenly false :halign 'start' :class 'padded'
(window-title))
(time)
(box :space-evenly false :halign 'end' :class 'padded'
(brightness-ctl)
(brightness-ctl-opener)
; (clipboard)
(volume)
(battery)
(bluetooth)
(wifi))))
(defwidget cmd-slider [?symbol value command max color]
(box :space-evenly false
(label :text symbol :class "symbol")
(scale
:min 0 :max max
:value value
:round-digits 0
:timeout "200ms"
:onchange command)
(label :text "${value}%" :class color)))
(defwidget window-title []
(label
:text "(${windowtitle})"))
(defpoll windowtitle :interval "1s" `scripts/currentWindow.fish`)
(defpoll currentworkspace :interval "1s" `scripts/currentWorkspace.fish`)
(defwidget brightness-ctl []
(box :visible brightnessctl-open
(cmd-slider :symbol "󰃠" :value brightness
:command `brightnessctl set {}%`
:max 101 :color "${
brightness >= 80 ? "green" :
brightness >= 50 ? "yellow" :
brightness >= 30 ? "peach" :
brightness >= 10 ? "maroon" : "red"
}")))
(defpoll brightness :interval "1s" :run-while brightnessctl-open `brightnessctl -m | awk -F, '{print $4+0}'`)
(defvar brightnessctl-open false)
(defwidget brightness-ctl-opener []
(eventbox :class "button"
(button
:onclick `${EWW_CMD} update brightnessctl-open=${!brightnessctl-open}`
"󰃠")))
(defwidget clipboard []
(label :text clipboard-short :tooltip clipboard :class "clipboard"))
(defpoll clipboard :interval "5s" `scripts/clipboardInfo.zsh all`)
(defpoll clipboard-short :interval "5s" `scripts/clipboardInfo.zsh head`)
(defwidget wifi []
(eventbox
:class "button ${wifi-strength.colour}"
(label
:text {wifi-strength.icon}
:tooltip "Connected To: ${wifi-name}")))
(defpoll wifi-strength :interval "10s" `scripts/wifiInfo.zsh strength`)
(defpoll wifi-name :interval "1m" `scripts/wifiInfo.zsh name`)
(defwidget bluetooth []
(eventbox
:class "bluetooth button ${ bluetooth-name != "" ? "green" : "lavendar" }"
:onclick `blueman-manager &`
(label
:text "${bluetooth-name} 󰂯")))
(defpoll bluetooth-name :interval "10s" `bluetoothctl devices Connected | awk '{print $3}'`)
(defwidget time []
(box
:space-evenly false
:class "time"
:tooltip {time.long}
(label :class "yellow" :text {time.hour})
(label :text ":")
(label :class "yellow" :text {time.minute})))
(defpoll time :interval "1s" `date +'{"long":"%a %b %e %H:%M:%S %Z %Y","hour":"%H","minute":"%M"}'`)
; TODO: make this a package or something, not using rust-script
(defpoll powerstats :interval "2s" `~/Documents/power_bat.rs`)
(defwidget battery []
(box :space-evenly false
:tooltip powerstats
(label
:text "${EWW_BATTERY.BAT1.status == "Charging" ? "󰂄" :
EWW_BATTERY.BAT1.capacity >= 90 ? "󰁹" :
EWW_BATTERY.BAT1.capacity >= 80 ? "󰂂" :
EWW_BATTERY.BAT1.capacity >= 70 ? "󰂁" :
EWW_BATTERY.BAT1.capacity >= 60 ? "󰂀" :
EWW_BATTERY.BAT1.capacity >= 50 ? "󰁿" :
EWW_BATTERY.BAT1.capacity >= 40 ? "󰁾" :
EWW_BATTERY.BAT1.capacity >= 30 ? "󰁽" :
EWW_BATTERY.BAT1.capacity >= 20 ? "󰁼" :
EWW_BATTERY.BAT1.capacity >= 10 ? "󰁻" : "󰁺"
} "
:class "${
EWW_BATTERY.BAT1.capacity >= 80 ? "green" :
EWW_BATTERY.BAT1.capacity >= 50 ? "yellow" :
EWW_BATTERY.BAT1.capacity >= 30 ? "peach" :
EWW_BATTERY.BAT1.capacity >= 10 ? "maroon" : "red"
}")
(label :text "${EWW_BATTERY.BAT1.capacity}%" :class "yellow")))
(defpoll volumevalue :interval "1s" `scripts/sound/getVolume.sh`)
(defpoll volumesink :interval "1s" `scripts/sound/getSink.sh`)
(defwidget volume []
(eventbox :tooltip volumesink
:onclick `pwvucontrol &`
(label :text "${volumevalue.count}%" :class "${volumevalue.color}")))