upd
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { App } from "astal/gtk3"
|
import { App } from "astal/gtk3"
|
||||||
import style from "./style.scss"
|
import style from "./style.scss"
|
||||||
import Bar from "./widget/Bar"
|
import Bar from "./widget/Bar"
|
||||||
// import NotificationPopups from "./notification/NotificationPopups"
|
|
||||||
|
|
||||||
App.start({
|
App.start({
|
||||||
css: style,
|
css: style,
|
||||||
|
|||||||
@@ -90,27 +90,37 @@ function Media() {
|
|||||||
</box>
|
</box>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Workspaces() {
|
function Workspaces() {
|
||||||
const hypr = Hyprland.get_default()
|
const hypr = Hyprland.get_default();
|
||||||
|
|
||||||
return <box className="Workspaces">
|
return (
|
||||||
{bind(hypr, "focusedWorkspace").as(fw => {
|
<box className="Workspaces">
|
||||||
if (!fw) return null
|
{bind(hypr, "focusedWorkspace").as((fw) => {
|
||||||
|
if (!fw) return null;
|
||||||
|
|
||||||
const currentChunkStart = Math.floor((fw.id - 1) / 5) * 5 + 1
|
// Determine the current chunk of 5 visible workspace buttons
|
||||||
const visibleIds = Array.from({ length: 5 }, (_, i) => currentChunkStart + i)
|
const currentChunkStart = Math.floor((fw.id - 1) / 5) * 5 + 1;
|
||||||
|
const visibleIds = Array.from({ length: 5 }, (_, i) => currentChunkStart + i);
|
||||||
|
|
||||||
return visibleIds.map(id => {
|
return visibleIds.map((id) => {
|
||||||
const ws = hypr.workspaces.find(w => w.id === id)
|
// Try to get the real workspace, fall back to a dummy one if it doesn't exist
|
||||||
return <button
|
const ws =
|
||||||
className={fw.id === id ? "focused" : ""}
|
hypr.workspaces.find((w) => w.id === id) ??
|
||||||
// onClick={() => Utils.exec(`hyprctl dispatch workspace ${id}`)}
|
Hyprland.Workspace.dummy(id, null);
|
||||||
onClick={() => ws?.focus()}>
|
|
||||||
{id}
|
return (
|
||||||
</button>
|
<button
|
||||||
})
|
className={fw.id === id ? "focused" : ""}
|
||||||
})}
|
onClick={() => ws.focus()}
|
||||||
|
>
|
||||||
|
{id}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
})}
|
||||||
</box>
|
</box>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function FocusedClient() {
|
function FocusedClient() {
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ $terminal = kitty
|
|||||||
$bar = ags run
|
$bar = ags run
|
||||||
$cursor = Bibata-Modern-Ice
|
$cursor = Bibata-Modern-Ice
|
||||||
|
|
||||||
exec-once = $terminal
|
|
||||||
exec-once = hyprctl setcursor $cursor 24
|
exec-once = hyprctl setcursor $cursor 24
|
||||||
exec-once = $bar
|
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
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||||
$mainMod = SUPER # Sets "Windows" key as main modifier
|
$mainMod = SUPER # Sets "Windows" key as main modifier
|
||||||
$terminal = kitty
|
$terminal = kitty --single-instance
|
||||||
$browser = firefox
|
$browser = firefox
|
||||||
|
|
||||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
}: {
|
}: {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
astal.io
|
astal.io
|
||||||
# astal.gjs
|
astal.gjs
|
||||||
# astal.hyprland
|
astal.hyprland
|
||||||
# astal.apps
|
astal.apps
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user