From 2e7d8fef4074581b6db0318a2632e737ee91490c Mon Sep 17 00:00:00 2001 From: biscuit Date: Mon, 19 May 2025 12:51:19 -0500 Subject: [PATCH] upd --- packages/ags/custom/app.ts | 1 - packages/ags/custom/widget/Bar.tsx | 42 +++++++++++++++---------- packages/hyprland/custom/autostart.conf | 4 ++- packages/hyprland/custom/keybinds.conf | 2 +- system/astal/default.nix | 6 ++-- 5 files changed, 33 insertions(+), 22 deletions(-) diff --git a/packages/ags/custom/app.ts b/packages/ags/custom/app.ts index ac17f43..4b7ea48 100644 --- a/packages/ags/custom/app.ts +++ b/packages/ags/custom/app.ts @@ -1,7 +1,6 @@ import { App } from "astal/gtk3" import style from "./style.scss" import Bar from "./widget/Bar" -// import NotificationPopups from "./notification/NotificationPopups" App.start({ css: style, diff --git a/packages/ags/custom/widget/Bar.tsx b/packages/ags/custom/widget/Bar.tsx index c30011f..b1fb229 100644 --- a/packages/ags/custom/widget/Bar.tsx +++ b/packages/ags/custom/widget/Bar.tsx @@ -90,27 +90,37 @@ function Media() { } + function Workspaces() { - const hypr = Hyprland.get_default() + const hypr = Hyprland.get_default(); - return - {bind(hypr, "focusedWorkspace").as(fw => { - if (!fw) return null + return ( + + {bind(hypr, "focusedWorkspace").as((fw) => { + if (!fw) return null; - const currentChunkStart = Math.floor((fw.id - 1) / 5) * 5 + 1 - const visibleIds = Array.from({ length: 5 }, (_, i) => currentChunkStart + i) + // Determine the current chunk of 5 visible workspace buttons + const currentChunkStart = Math.floor((fw.id - 1) / 5) * 5 + 1; + const visibleIds = Array.from({ length: 5 }, (_, i) => currentChunkStart + i); - return visibleIds.map(id => { - const ws = hypr.workspaces.find(w => w.id === id) - return - }) - })} + return visibleIds.map((id) => { + // Try to get the real workspace, fall back to a dummy one if it doesn't exist + const ws = + hypr.workspaces.find((w) => w.id === id) ?? + Hyprland.Workspace.dummy(id, null); + + return ( + + ); + }); + })} + ); } function FocusedClient() { diff --git a/packages/hyprland/custom/autostart.conf b/packages/hyprland/custom/autostart.conf index 94d5314..0f51a03 100644 --- a/packages/hyprland/custom/autostart.conf +++ b/packages/hyprland/custom/autostart.conf @@ -8,7 +8,9 @@ $terminal = kitty $bar = ags run $cursor = Bibata-Modern-Ice -exec-once = $terminal exec-once = hyprctl setcursor $cursor 24 exec-once = $bar +exec-once = [workspace 20 silent] firefox +exec-once = [workspace 20 silent] kitty --single-instance --hold fastfetch +exec-once = [workspace 1] kitty --single-instance --hold fastfetch diff --git a/packages/hyprland/custom/keybinds.conf b/packages/hyprland/custom/keybinds.conf index 198a346..bfa1e54 100644 --- a/packages/hyprland/custom/keybinds.conf +++ b/packages/hyprland/custom/keybinds.conf @@ -4,7 +4,7 @@ # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # Sets "Windows" key as main modifier -$terminal = kitty +$terminal = kitty --single-instance $browser = firefox # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more diff --git a/system/astal/default.nix b/system/astal/default.nix index bed3f52..1844d38 100644 --- a/system/astal/default.nix +++ b/system/astal/default.nix @@ -6,8 +6,8 @@ }: { environment.systemPackages = with pkgs; [ astal.io - # astal.gjs - # astal.hyprland - # astal.apps + astal.gjs + astal.hyprland + astal.apps ]; }