mirror of
https://github.com/tuxdotrs/tshell.git
synced 2026-09-19 18:49:02 +05:30
feat: add req handler
This commit is contained in:
14
handler.ts
Normal file
14
handler.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { App } from "astal/gtk4";
|
||||
import { WINDOW_NAME } from "./widgets/bar";
|
||||
|
||||
export const reqHandler = (req: string, res: (res: any) => void) => {
|
||||
switch (req) {
|
||||
case "toggle-bar":
|
||||
const win = App.get_window(WINDOW_NAME);
|
||||
win?.is_visible() ? win.hide() : win?.set_visible(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
res("uknown command");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user