ags: fmt with prettier

This commit is contained in:
notohh 2024-02-01 17:48:30 -05:00
parent 3a3965b4d9
commit c65b649ff4
Signed by: notohh
GPG key ID: BD47506D475EE86D
8 changed files with 70 additions and 79 deletions

View file

@ -1,26 +1,23 @@
module.exports = { module.exports = {
"env": { env: {
"browser": true, browser: true,
"es2021": true es2021: true
}, },
"extends": "eslint:recommended", extends: "eslint:recommended",
"overrides": [ overrides: [
{ {
"env": { env: {
"node": true node: true
}, },
"files": [ files: [".eslintrc.{js,cjs}"],
".eslintrc.{js,cjs}" parserOptions: {
], sourceType: "script"
"parserOptions": {
"sourceType": "script"
} }
} }
], ],
"parserOptions": { parserOptions: {
"ecmaVersion": "latest", ecmaVersion: "latest",
"sourceType": "module" sourceType: "module"
}, },
"rules": { rules: {}
} };
}

View file

@ -0,0 +1,3 @@
{
"trailingComma" : "none"
}

View file

@ -17,7 +17,5 @@ Utils.monitorFile(`${App.configDir}/scss`, reloadCss, "directory");
export default { export default {
style: css, style: css,
windows: [ windows: [Bar(2)]
Bar(2),
],
}; };

View file

@ -7,23 +7,16 @@ import { Workspaces } from "./widgets/hyprland.js";
const Start = () => const Start = () =>
Widget.Box({ Widget.Box({
hpack: "start", hpack: "start",
children: [ children: [nixosLogo(), Workspaces()]
nixosLogo(),
Workspaces(),
],
}); });
const Center = () => const Center = () =>
Widget.Box({ Widget.Box({
children: [ children: [Media()]
Media(),
],
}); });
const End = () => const End = () =>
Widget.Box({ Widget.Box({
hpack: "end", hpack: "end",
children: [ children: [Time()]
Time(),
],
}); });
const Bar = (monitor) => const Bar = (monitor) =>
@ -35,8 +28,8 @@ const Bar = (monitor) =>
child: Widget.CenterBox({ child: Widget.CenterBox({
startWidget: Start(), startWidget: Start(),
centerWidget: Center(), centerWidget: Center(),
endWidget: End(), endWidget: End()
}), })
}); });
export { Bar }; export { Bar };

View file

@ -8,11 +8,12 @@ const Workspaces = () =>
Widget.Button({ Widget.Button({
on_clicked: () => Hyprland.sendMessage(`dispatch workspace ${id}`), on_clicked: () => Hyprland.sendMessage(`dispatch workspace ${id}`),
child: Widget.Label(`${id}`), child: Widget.Label(`${id}`),
class_name: Hyprland.active.workspace.bind("id") class_name: Hyprland.active.workspace
.transform((i) => `${i === id ? "focused" : ""}`), .bind("id")
.transform((i) => `${i === id ? "focused" : ""}`)
}) })
); );
}), })
}); });
export { Workspaces }; export { Workspaces };

View file

@ -3,14 +3,18 @@ import { Mpris, Widget } from "../../import.js";
const Media = () => const Media = () =>
Widget.Box({ Widget.Box({
class_name: "media", class_name: "media",
child: Widget.Label("-").hook(Mpris, (self) => { child: Widget.Label("-").hook(
Mpris,
(self) => {
if (Mpris.players[0]) { if (Mpris.players[0]) {
const { track_artists, track_title } = Mpris.players[0]; const { track_artists, track_title } = Mpris.players[0];
self.label = `${track_artists.join(", ")} - ${track_title}`; self.label = `${track_artists.join(", ")} - ${track_title}`;
} else { } else {
self.label = "Nothing is playing"; self.label = "Nothing is playing";
} }
}, "player-changed"), },
"player-changed"
)
}); });
export { Media }; export { Media };

View file

@ -3,14 +3,12 @@ import { Utils, Widget } from "../../import.js";
const Time = () => const Time = () =>
Widget.Box({ Widget.Box({
child: Widget.Label({ child: Widget.Label({
className: "date", className: "date"
}).poll( }).poll(1000, (self) =>
1000, Utils.execAsync(["date", "+%a %b %d %H:%M"]).then(
(self) => (time) => (self.label = time)
Utils.execAsync(["date", "+%a %b %d %H:%M"]).then((time) => )
self.label = time )
),
),
}); });
export { Time }; export { Time };

View file

@ -8,8 +8,5 @@
"strictNullChecks": true, "strictNullChecks": true,
"strictFunctionTypes": true "strictFunctionTypes": true
}, },
"exclude": [ "exclude": ["node_modules", "**/node_modules/*"]
"node_modules",
"**/node_modules/*"
]
} }