diff options
Diffstat (limited to '.config/ags/widget/dock/FloatingDock.ts')
| -rw-r--r-- | .config/ags/widget/dock/FloatingDock.ts | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/.config/ags/widget/dock/FloatingDock.ts b/.config/ags/widget/dock/FloatingDock.ts index 98ff7cc..369f56f 100644 --- a/.config/ags/widget/dock/FloatingDock.ts +++ b/.config/ags/widget/dock/FloatingDock.ts @@ -1,31 +1,25 @@ -import options from "options" -import Dock from "./Dock.ts" -const hyprland = await Service.import("hyprland") -const apps = await Service.import("applications") +import options from 'options'; +import Dock from './Dock.ts'; +const hyprland = await Service.import('hyprland'); +const apps = await Service.import('applications'); const { Gdk, Gtk } = imports.gi; -import type Gtk from "gi://Gtk?version=3.0"; -import { type WindowProps } from "types/widgets/window"; -import { type RevealerProps } from "types/widgets/revealer"; -import { type EventBoxProps } from "types/widgets/eventbox"; +import type Gtk from 'gi://Gtk?version=3.0'; +import { type WindowProps } from 'types/widgets/window'; +import { type RevealerProps } from 'types/widgets/revealer'; +import { type EventBoxProps } from 'types/widgets/eventbox'; /** @param {number} monitor */ const FloatingDock = (monitor: number): Gtk.Window & WindowProps => { const update = () => { - const ws = hyprland.getWorkspace(hyprland.active.workspace.id); - if (hyprland.getMonitor(monitor)?.name === ws?.monitor) { - revealer.reveal_child = !ws || ws.windows === 0; - } + const ws = Hyprland.getWorkspace(Hyprland.active.workspace.id); + if (Hyprland.getMonitor(monitor)?.name === ws?.monitor) self.reveal_child = ws?.windows === 0; }; - const revealer: Gtk.Revealer & RevealerProps = Widget.Revealer({ transition: 'slide_up', transitionDuration: 90, child: Dock(), - setup: self => self - .hook(hyprland, update, 'client-added') - .hook(hyprland, update, 'client-removed') - .hook(hyprland.active.workspace, update), + setup: self => self.hook(hyprland, update, 'client-added').hook(hyprland, update, 'client-removed').hook(hyprland.active.workspace, update), }); const window = Widget.Window({ @@ -33,14 +27,13 @@ const FloatingDock = (monitor: number): Gtk.Window & WindowProps => { //halign: 'fill', halign: 'end', //layer: "overlay", - layer: "dock", + layer: 'dock', name: `dock${monitor}`, click_through: false, class_name: 'floating-dock', // class_name: 'floating-dock-no-gap', // class_name: "f-dock-wrap", - typeHint: Gdk.WindowTypeHint.DOCK, exclusivity: 'false', @@ -75,4 +68,3 @@ const FloatingDock = (monitor: number): Gtk.Window & WindowProps => { }; export default FloatingDock; - |
