Added the options to allow workspaces to be indicated as active on multiple monitors. (#289)

* Added the options to allow workspaces to be indicated as active on multiple monitors.

* Add subtitle
This commit is contained in:
Jas Singh
2024-09-28 17:09:15 -07:00
committed by GitHub
parent a3ae60f621
commit 19a0ccf150
5 changed files with 55 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import { range } from 'lib/utils';
import { BoxWidget } from 'lib/types/widget';
import { getWsColor, renderClassnames, renderLabel } from '../utils';
import { WorkspaceIconMap } from 'lib/types/workspace';
import { Monitor } from 'types/service/hyprland';
const { workspaces, monitorSpecific, workspaceMask, spacing, ignored } = options.bar.workspaces;
export const defaultWses = (monitor: number): BoxWidget => {
@@ -42,6 +43,7 @@ export const defaultWses = (monitor: number): BoxWidget => {
options.bar.workspaces.workspaceIconMap.bind('value'),
options.theme.matugen.bind('value'),
options.theme.bar.buttons.workspaces.smartHighlight.bind('value'),
hyprland.bind('monitors'),
hyprland.active.workspace.bind('id'),
],
(
@@ -50,10 +52,11 @@ export const defaultWses = (monitor: number): BoxWidget => {
workspaceIconMap: WorkspaceIconMap,
matugen: boolean,
smartHighlight: boolean,
monitors: Monitor[],
) => {
return (
`margin: 0rem ${0.375 * sp}rem;` +
`${showWsIcons && !matugen ? getWsColor(workspaceIconMap, i, smartHighlight) : ''}`
`${showWsIcons && !matugen ? getWsColor(workspaceIconMap, i, smartHighlight, monitor, monitors) : ''}`
);
},
),
@@ -64,6 +67,7 @@ export const defaultWses = (monitor: number): BoxWidget => {
options.bar.workspaces.numbered_active_indicator.bind('value'),
options.bar.workspaces.showWsIcons.bind('value'),
options.theme.bar.buttons.workspaces.smartHighlight.bind('value'),
hyprland.bind('monitors'),
options.bar.workspaces.icons.available.bind('value'),
options.bar.workspaces.icons.active.bind('value'),
hyprland.active.workspace.bind('id'),
@@ -74,6 +78,7 @@ export const defaultWses = (monitor: number): BoxWidget => {
numberedActiveIndicator: string,
showWsIcons: boolean,
smartHighlight: boolean,
monitors: Monitor[],
) => {
return renderClassnames(
showIcons,
@@ -81,6 +86,8 @@ export const defaultWses = (monitor: number): BoxWidget => {
numberedActiveIndicator,
showWsIcons,
smartHighlight,
monitor,
monitors,
i,
);
},
@@ -94,6 +101,7 @@ export const defaultWses = (monitor: number): BoxWidget => {
options.bar.workspaces.workspaceIconMap.bind('value'),
options.bar.workspaces.showWsIcons.bind('value'),
workspaceMask.bind('value'),
hyprland.bind('monitors'),
hyprland.active.workspace.bind('id'),
],
(
@@ -104,6 +112,7 @@ export const defaultWses = (monitor: number): BoxWidget => {
wsIconMap: WorkspaceIconMap,
showWsIcons: boolean,
workspaceMask: boolean,
monitors: Monitor[],
) => {
return renderLabel(
showIcons,
@@ -116,6 +125,7 @@ export const defaultWses = (monitor: number): BoxWidget => {
i,
index,
monitor,
monitors,
);
},
),