Skip to content

Commit

Permalink
add current workspace to eww bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-coe-renner committed Aug 21, 2024
1 parent 6d35209 commit f0bd6b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 16 additions & 2 deletions dot_config/eww/eww.yuck
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,29 @@
(defwidget cal []
datetime)

(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")

(defwidget workspace []
current_workspace)

(defwindow bar
:monitor 1
:geometry (geometry :x "0%"
:y "10px"
:width "160px"
;; :width "180px"
:width "200px"
:height "30px"
:anchor "top center")
:stacking "fg"
:exclusive true
:focusable false
(cal)
(box
:spacing 5
:space-evenly false
:halign "center"
:orientation "horizontal"
(workspace)
"|"
(cal)
)
)
7 changes: 7 additions & 0 deletions dot_config/eww/scripts/executable_get-active-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'

socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'

0 comments on commit f0bd6b0

Please sign in to comment.