From d1858c51b53e3ebcd841416490c17f7b22334e6a Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Wed, 26 Aug 2026 04:26:19 +0530 Subject: desktop: replaced waybar with eww - added some basic configuration options for eww - removed waybar --- modules/desktop/eww/yuck.nix | 69 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 modules/desktop/eww/yuck.nix (limited to 'modules/desktop/eww/yuck.nix') diff --git a/modules/desktop/eww/yuck.nix b/modules/desktop/eww/yuck.nix new file mode 100644 index 0000000..d61f70a --- /dev/null +++ b/modules/desktop/eww/yuck.nix @@ -0,0 +1,69 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + config = lib.mkIf config.desktop.enable { + home.file.".config/eww/icons/fallback.svg".text = '' + + + + ''; + + programs.eww.yuckConfig = + let + workspaces = pkgs.writeShellApplication { + name = "eww-workspaces"; + # This automatically adds these packages to the script's PATH + runtimeInputs = with pkgs; [ + niri + jq + ]; + + text = '' + #!/usr/bin/env bash + # Outputs JSON array of workspaces for eww bar + niri msg -j workspaces | jq -c 'sort_by(.idx)' + ''; + }; + in + '' + (defpoll time :interval "10s" "date '+%H:%M'") + (defpoll date :interval "60s" "date '+%d/%m'") + (defpoll workspaces :interval "1s" :initial "[]" "${lib.getExe workspaces}") + (defpoll active-windows :interval "1s" "${lib.getExe config.scripts.eww-active-windows.package}") + + (defwindow bar + :monitor 0 + :geometry (geometry + :x "0px" + :y "0px" + :width "50px" + :height "100%" + :anchor "top right") + :stacking "fg" + :focusable "none" + :reserve (struts :distance "50px" :side "right") + (bar-content)) + + (defwidget bar-content [] + (box :orientation "v" :space-evenly false :class "bar-container" + (box :orientation "v" :space-evenly false :valign "start" :class "top-section" + (workspaces-widget) + (windows-widget)))) + + (defwidget workspaces-widget [] + (box :orientation "v" :space-evenly false :spacing 4 :halign "center" :class "workspaces" + (for ws in workspaces + (button :class {ws.is_active ? "ws-active" : "ws-inactive"} + :onclick "niri msg action focus-workspace ''${ws.idx}" + (label :text "''${ws.idx}"))))) + + (defwidget windows-widget [] + (box :orientation "v" :space-evenly false :spacing 4 :halign "center" :class "windows" + (image :class "win-icon" :path "/tmp/test-icon.svg" :image-width 20 :image-height 20))) + ''; + }; +} -- cgit v1.2.3