Added a cli method to check the visibility of a window. (#301)
This commit is contained in:
1
globals.d.ts
vendored
1
globals.d.ts
vendored
@@ -6,6 +6,7 @@ import { Options, Variable as VariableType } from 'types/variable';
|
|||||||
declare global {
|
declare global {
|
||||||
var globalMousePos: VariableType<number[]>;
|
var globalMousePos: VariableType<number[]>;
|
||||||
var useTheme: (filePath: string) => void;
|
var useTheme: (filePath: string) => void;
|
||||||
|
var isWindowVisible: (windowName: string) => boolean;
|
||||||
var globalWeatherVar: VariableType<Weather>;
|
var globalWeatherVar: VariableType<Weather>;
|
||||||
var options: Options;
|
var options: Options;
|
||||||
var removingNotifications: VariableType<boolean>;
|
var removingNotifications: VariableType<boolean>;
|
||||||
|
|||||||
8
globals/utilities.ts
Normal file
8
globals/utilities.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
globalThis.isWindowVisible = (windowName: string): boolean => {
|
||||||
|
const appWindow = App.getWindow(windowName);
|
||||||
|
|
||||||
|
if (appWindow === undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return appWindow.visible;
|
||||||
|
};
|
||||||
1
main.ts
1
main.ts
@@ -1,6 +1,7 @@
|
|||||||
import 'lib/session';
|
import 'lib/session';
|
||||||
import 'scss/style';
|
import 'scss/style';
|
||||||
import 'globals/useTheme';
|
import 'globals/useTheme';
|
||||||
|
import 'globals/utilities';
|
||||||
import 'globals/mousePos';
|
import 'globals/mousePos';
|
||||||
|
|
||||||
import { Bar } from 'modules/bar/Bar';
|
import { Bar } from 'modules/bar/Bar';
|
||||||
|
|||||||
Reference in New Issue
Block a user