diff --git a/src/modules/bar.tsx b/src/modules/bar.tsx index e7d9138f..709f9487 100644 --- a/src/modules/bar.tsx +++ b/src/modules/bar.tsx @@ -151,7 +151,7 @@ const MediaPlaying = () => { angle={config.vertical ? 270 : 0} setup={self => players.hookLastPlayer(self, ["notify::title", "notify::artist"], () => { - self.label = ellipsize(getLabel("No media")); // TODO: scroll text + self.label = ellipsize(getLabel("No media"), config.vertical ? 30 : 40); // TODO: scroll text }) } /> diff --git a/src/utils/strings.ts b/src/utils/strings.ts index e5bc43e7..df2f781c 100644 --- a/src/utils/strings.ts +++ b/src/utils/strings.ts @@ -1 +1 @@ -export const ellipsize = (str: string, len = 40) => (str.length > len ? `${str.slice(0, len - 1)}…` : str); +export const ellipsize = (str: string, len: number) => (str.length > len ? `${str.slice(0, len - 1)}…` : str);