From 8fab7d4b65cd16769d3ef48e44da3f8ed75582ed Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 31 Mar 2025 23:02:52 +1100 Subject: feat: fake screen rounding --- src/modules/bar.tsx | 121 ++++++++++++++++++++++++------------------ src/modules/screencorners.tsx | 24 +++++++++ src/widgets/screencorner.tsx | 49 +++++++++++++++++ 3 files changed, 142 insertions(+), 52 deletions(-) create mode 100644 src/modules/screencorners.tsx create mode 100644 src/widgets/screencorner.tsx (limited to 'src') diff --git a/src/modules/bar.tsx b/src/modules/bar.tsx index 995d3a3..29f4f88 100644 --- a/src/modules/bar.tsx +++ b/src/modules/bar.tsx @@ -8,6 +8,7 @@ import { bindCurrentTime, osIcon } from "@/utils/system"; import type { AstalWidget } from "@/utils/types"; import { setupCustomTooltip } from "@/utils/widgets"; import type PopupWindow from "@/widgets/popupwindow"; +import ScreenCorner from "@/widgets/screencorner"; import { execAsync, Variable } from "astal"; import Binding, { bind, kebabify } from "astal/binding"; import { App, Astal, Gtk } from "astal/gtk3"; @@ -560,63 +561,79 @@ const bindWidget = (module: keyof typeof config.modules, Widget: () => JSX.Eleme const bindCompositeWidget = (module: keyof typeof config.modules, binding: Binding) => bind(Variable.derive([config.modules[module].enabled, binding], (e, w) => (e ? w : ))); -export default ({ monitor }: { monitor: Monitor }) => { +const Bar = ({ monitor }: { monitor: Monitor }) => { const className = Variable.derive( [bind(config.vertical), bind(config.style)], (v, s) => `bar ${v ? "vertical" : " horizontal"} ${s}` ); return ( - - Astal.WindowAnchor.TOP | - Astal.WindowAnchor.LEFT | - (v ? Astal.WindowAnchor.BOTTOM : Astal.WindowAnchor.RIGHT) - )} - exclusivity={Astal.Exclusivity.EXCLUSIVE} - > - className.drop()}> - - {bindWidget("osIcon", OSIcon)} - {bindWidget("activeWindow", ActiveWindow)} - {bindWidget("mediaPlaying", MediaPlaying)} -