This commit is contained in:
biscuit
2025-05-19 12:51:19 -05:00
parent e193f075e2
commit 2e7d8fef40
5 changed files with 33 additions and 22 deletions
-1
View File
@@ -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,
+26 -16
View File
@@ -90,27 +90,37 @@ function Media() {
</box>
}
function Workspaces() {
const hypr = Hyprland.get_default()
const hypr = Hyprland.get_default();
return <box className="Workspaces">
{bind(hypr, "focusedWorkspace").as(fw => {
if (!fw) return null
return (
<box className="Workspaces">
{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 <button
className={fw.id === id ? "focused" : ""}
// onClick={() => Utils.exec(`hyprctl dispatch workspace ${id}`)}
onClick={() => ws?.focus()}>
{id}
</button>
})
})}
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 (
<button
className={fw.id === id ? "focused" : ""}
onClick={() => ws.focus()}
>
{id}
</button>
);
});
})}
</box>
);
}
function FocusedClient() {
+3 -1
View File
@@ -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
+1 -1
View File
@@ -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
+3 -3
View File
@@ -6,8 +6,8 @@
}: {
environment.systemPackages = with pkgs; [
astal.io
# astal.gjs
# astal.hyprland
# astal.apps
astal.gjs
astal.hyprland
astal.apps
];
}