diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-22 21:25:42 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-22 21:25:42 +1100 |
| commit | 6a043ce106dd853da4837a4fa1e68c2a6d67093b (patch) | |
| tree | 6ba54289db310b31da8c6d9c97a3f086c4271b64 /src | |
| parent | config: dynamic service confs (diff) | |
| download | caelestia-shell-6a043ce106dd853da4837a4fa1e68c2a6d67093b.tar.gz caelestia-shell-6a043ce106dd853da4837a4fa1e68c2a6d67093b.tar.bz2 caelestia-shell-6a043ce106dd853da4837a4fa1e68c2a6d67093b.zip | |
config: restore to default if not specified
Restore configs to default if not given in the config file instead of not changing them
Also sideleft configs
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/popdowns/sideleft.tsx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/popdowns/sideleft.tsx b/src/modules/popdowns/sideleft.tsx index fdf3e4f..753026e 100644 --- a/src/modules/popdowns/sideleft.tsx +++ b/src/modules/popdowns/sideleft.tsx @@ -7,6 +7,7 @@ import PopupWindow from "@/widgets/popupwindow"; import { bind, execAsync, GLib, type Binding } from "astal"; import { App, Gtk, type Widget } from "astal/gtk3"; import type cairo from "cairo"; +import { sideleft } from "config"; const fmt = (bytes: number, pow: number) => +(bytes / 1024 ** pow).toFixed(2); const format = ({ total, used }: { total: number; used: number }) => { @@ -62,13 +63,14 @@ const QuickLaunch = () => ( </box> ); -const Location = ({ home, label, num }: { home?: boolean; label: string; num: number }) => ( +const Location = ({ label, num }: { label: Binding<string>; num: number }) => ( <button className={"loc" + num} cursor="pointer" onClicked={self => { self.get_toplevel().hide(); - execAsync(`xdg-open ${HOME}/${home ? "" : label.split(" ").at(-1) + "/"}`).catch(console.error); + const dir = label.get().split(" ").at(-1); + execAsync(`xdg-open ${HOME}/${dir?.toLowerCase() === "home" ? "" : `${dir}/`}`).catch(console.error); }} > <label xalign={0} label={label} /> @@ -78,14 +80,14 @@ const Location = ({ home, label, num }: { home?: boolean; label: string; num: nu const Locations = () => ( <box className="locations"> <box vertical> - <Location label=" Downloads" num={1} /> - <Location label=" Documents" num={2} /> - <Location label=" Music" num={3} /> + <Location label={bind(sideleft.directories.left.top)} num={1} /> + <Location label={bind(sideleft.directories.left.middle)} num={2} /> + <Location label={bind(sideleft.directories.left.bottom)} num={3} /> </box> <box vertical> - <Location label=" Pictures" num={4} /> - <Location label=" Videos" num={5} /> - <Location label=" Home" num={6} home /> + <Location label={bind(sideleft.directories.right.top)} num={4} /> + <Location label={bind(sideleft.directories.right.middle)} num={5} /> + <Location label={bind(sideleft.directories.right.bottom)} num={6} /> </box> </box> ); |