From c2e03775dba9aedbb52c9bf1135a2290faaa21bf Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:53:49 +1100 Subject: better config + notifpopups max popups Use a config file --- config.ts | 21 +++++++++++++++++++++ modules/bar.tsx | 12 ++++++------ modules/launcher.tsx | 36 ++++++------------------------------ modules/notifpopups.tsx | 20 +++++++++++--------- 4 files changed, 44 insertions(+), 45 deletions(-) create mode 100644 config.ts diff --git a/config.ts b/config.ts new file mode 100644 index 0000000..ccfa08a --- /dev/null +++ b/config.ts @@ -0,0 +1,21 @@ +export const bar = { + wsPerGroup: 10, + dateTimeFormat: "%d/%m/%y %R", +}; + +export const launcher = { + maxResults: 15, + fdOpts: ["-a", "-t", "f"], + pins: [ + ["firefox", "waterfox", "google-chrome", "chromium", "brave-browser", "vivaldi-stable", "vivaldi-snapshot"], + ["foot", "alacritty", "kitty", "wezterm"], + ["thunar", "nemo", "nautilus"], + ["codium", "code", "clion", "intellij-idea-ultimate-edition"], + ["spotify-adblock", "spotify", "audacious", "elisa"], + ], +}; + +export const notifpopups = { + maxPopups: -1, + expire: false, +}; diff --git a/modules/bar.tsx b/modules/bar.tsx index bf1bb9f..ed888db 100644 --- a/modules/bar.tsx +++ b/modules/bar.tsx @@ -4,6 +4,7 @@ import { App, Astal, astalify, Gdk, Gtk, type ConstructProps } from "astal/gtk3" import AstalHyprland from "gi://AstalHyprland"; import AstalNotifd from "gi://AstalNotifd"; import AstalTray from "gi://AstalTray"; +import { bar as config } from "../config"; import Players from "../services/players"; import { getAppCategoryIcon } from "../utils/icons"; import { ellipsize } from "../utils/strings"; @@ -12,8 +13,6 @@ import { setupCustomTooltip } from "../utils/widgets"; const hyprland = AstalHyprland.get_default(); -const wsPerGroup = 10; - const hookFocusedClientProp = ( self: any, // Ugh why is there no base Widget type prop: keyof AstalHyprland.Client, @@ -99,7 +98,7 @@ const MediaPlaying = () => { }; const Workspace = ({ idx }: { idx: number }) => { - let wsId = Math.floor((hyprland.focusedWorkspace.id - 1) / wsPerGroup) * wsPerGroup + idx; + let wsId = Math.floor((hyprland.focusedWorkspace.id - 1) / config.wsPerGroup) * config.wsPerGroup + idx; return (