layout-status.sh 523 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. # Script to output the current Hyprland layout for Waybar
  3. # Icons:  (Master)  (Monocle)  (Dwindle)
  4. LAYOUT=$(hyprctl -j activeworkspace | jq -r '.tiledLayout')
  5. # If layout is empty/null, default to whatever the general config says
  6. if [ -z "$LAYOUT" ] || [ "$LAYOUT" = "null" ]; then
  7. LAYOUT=$(hyprctl -j getoption general:layout | jq -r '.str')
  8. fi
  9. case "$LAYOUT" in
  10. "master")
  11. echo ""
  12. ;;
  13. "monocle")
  14. echo ""
  15. ;;
  16. "dwindle")
  17. echo ""
  18. ;;
  19. *)
  20. echo "$LAYOUT"
  21. ;;
  22. esac