diff options
| author | steven-na <noreply.github@stvnc.dev> | 2026-04-30 01:19:42 -0700 |
|---|---|---|
| committer | steven-na <noreply.github@stvnc.dev> | 2026-04-30 01:19:42 -0700 |
| commit | e97729cd7759051748dbdaa3a9caaf5df3f2bdc0 (patch) | |
| tree | 64388619ae86d0d40f330b9d138d4339ac526a64 /arch/eww/.config | |
| parent | c13c18d60b2e3d1870b3cd592c4391942d8a315b (diff) | |
all around better
Diffstat (limited to 'arch/eww/.config')
| -rw-r--r-- | arch/eww/.config/eww/eww.yuck | 34 | ||||
| -rwxr-xr-x | arch/eww/.config/eww/scripts/active-workspace | 4 | ||||
| -rwxr-xr-x | arch/eww/.config/eww/scripts/active-ws | 2 | ||||
| -rwxr-xr-x | arch/eww/.config/eww/scripts/day-with-suffix | 10 | ||||
| -rwxr-xr-x | arch/eww/.config/eww/scripts/hypr-socket | 24 |
5 files changed, 18 insertions, 56 deletions
diff --git a/arch/eww/.config/eww/eww.yuck b/arch/eww/.config/eww/eww.yuck index 7c80505..79e2fec 100644 --- a/arch/eww/.config/eww/eww.yuck +++ b/arch/eww/.config/eww/eww.yuck @@ -1,17 +1,10 @@ -;; ── Listeners (Hyprland IPC) ────────────────────────────────────────────── -;; hyprland-workspaces emits JSON arrays with {id, name, windows, isActive} -;; on every workspace change — single source of truth for list + active state. - -(deflisten workspaces :initial "[]" - `scripts/workspaces`) - ;; ── Polls ────────────────────────────────────────────────────────────────── (defpoll clock :interval "1s" `date +"%-H:%M"`) (defpoll date-str :interval "60s" - `date +"%a %b %d"`) + `scripts/day-with-suffix`) ;; Show the PLAYING source; fall back to any paused one (defpoll player-status :interval "2s" @@ -48,15 +41,7 @@ (defpoll netspeed :interval "3s" `scripts/netspeed`) -;; ── Left: Workspaces + Music ─────────────────────────────────────────────── - -(defwidget workspaces [] - (box :class "workspaces" :space-evenly false :spacing 5 - (for ws in workspaces - (button - :class {ws.active ? "ws active" : "ws"} - :onclick "hyprctl dispatch workspace ${ws.id}" - {ws.id})))) +;; ── Left: Date + Music ─────────────────────────────────────────────── (defwidget music [] (eventbox @@ -68,12 +53,11 @@ :text {player-status == "Playing" ? "▶" : "⏸"}) (label :class "song" :text player-song :limit-width 30)))) -;; ── Center: Clock ────────────────────────────────────────────────────────── - -(defwidget center-section [] - (box :class "center" :halign "center" :space-evenly false :spacing 8 +(defwidget left-section [] + (box :class "left" :space-evenly false :spacing 8 + (label :class "clock" :text clock) (label :class "date" :text date-str) - (label :class "clock" :text clock))) + (music))) ;; ── Right: Stats ─────────────────────────────────────────────────────────── @@ -130,10 +114,8 @@ (defwidget bar [] (centerbox :class "bar" :orientation "h" - (box :class "left" :halign "start" :space-evenly false :spacing 12 - (workspaces) - (music)) - (center-section) + (left-section) + (box) (right-section))) (defwindow bar diff --git a/arch/eww/.config/eww/scripts/active-workspace b/arch/eww/.config/eww/scripts/active-workspace deleted file mode 100755 index 21795b9..0000000 --- a/arch/eww/.config/eww/scripts/active-workspace +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -hyprctl activeworkspace -j | jq '.id' -socat -u UNIX-CONNECT:"${XDG_RUNTIME_DIR}/hypr/${HYPRLAND_INSTANCE_SIGNATURE}/.socket2.sock" STDOUT \ - | while read -r _; do hyprctl activeworkspace -j | jq '.id'; done diff --git a/arch/eww/.config/eww/scripts/active-ws b/arch/eww/.config/eww/scripts/active-ws deleted file mode 100755 index c7b3f3e..0000000 --- a/arch/eww/.config/eww/scripts/active-ws +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -hyprctl activeworkspace | awk '/^workspace/{print $3}' diff --git a/arch/eww/.config/eww/scripts/day-with-suffix b/arch/eww/.config/eww/scripts/day-with-suffix new file mode 100755 index 0000000..f7c2243 --- /dev/null +++ b/arch/eww/.config/eww/scripts/day-with-suffix @@ -0,0 +1,10 @@ +#!/bin/sh +DaySuffix() { + case `date +%d` in + 1|21|31) echo "st";; + 2|22) echo "nd";; + 3|23) echo "rd";; + *) echo "th";; + esac +} +echo $(date +%d)`DaySuffix` diff --git a/arch/eww/.config/eww/scripts/hypr-socket b/arch/eww/.config/eww/scripts/hypr-socket deleted file mode 100755 index 9012c17..0000000 --- a/arch/eww/.config/eww/scripts/hypr-socket +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 -"""Stream lines from Hyprland's socket2 IPC.""" -import socket, sys, os - -sock_path = ( - os.environ.get("XDG_RUNTIME_DIR", f"/run/user/{os.getuid()}") - + "/hypr/" - + os.environ["HYPRLAND_INSTANCE_SIGNATURE"] - + "/.socket2.sock" -) - -s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) -s.connect(sock_path) - -buf = b"" -while True: - chunk = s.recv(4096) - if not chunk: - break - buf += chunk - while b"\n" in buf: - line, buf = buf.split(b"\n", 1) - sys.stdout.write(line.decode(errors="replace") + "\n") - sys.stdout.flush() |