eww widgets and theme cycle with waybar button
This commit is contained in:
21
hypr/2d-workspaces.sh
Normal file
21
hypr/2d-workspaces.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# ~/.config/hypr/2d-workspaces.sh
|
||||
# Outputs current 2D position as Waybar JSON: "3" or "3.2"
|
||||
|
||||
current=$(hyprctl activeworkspace -j | jq -r '.name')
|
||||
|
||||
if [[ "$current" =~ ^([0-9]+)-([0-9]+)$ ]]; then
|
||||
cx="${BASH_REMATCH[1]}"
|
||||
cy="${BASH_REMATCH[2]}"
|
||||
label="${cx}.${cy}"
|
||||
class="sub"
|
||||
elif [[ "$current" =~ ^([0-9]+)$ ]]; then
|
||||
cx="${BASH_REMATCH[1]}"
|
||||
label="${cx}"
|
||||
class="base"
|
||||
else
|
||||
label="?"
|
||||
class="unknown"
|
||||
fi
|
||||
|
||||
printf '{"text": "%s", "class": "%s"}\n' "$label" "$class"
|
||||
Reference in New Issue
Block a user