diff --git a/home/ags/config/.eslintrc.js b/home/ags/config/.eslintrc.js index bee4612..ffc4af4 100644 --- a/home/ags/config/.eslintrc.js +++ b/home/ags/config/.eslintrc.js @@ -1,26 +1,23 @@ module.exports = { - "env": { - "browser": true, - "es2021": true - }, - "extends": "eslint:recommended", - "overrides": [ - { - "env": { - "node": true - }, - "files": [ - ".eslintrc.{js,cjs}" - ], - "parserOptions": { - "sourceType": "script" - } - } - ], - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { + env: { + browser: true, + es2021: true + }, + extends: "eslint:recommended", + overrides: [ + { + env: { + node: true + }, + files: [".eslintrc.{js,cjs}"], + parserOptions: { + sourceType: "script" + } } -} + ], + parserOptions: { + ecmaVersion: "latest", + sourceType: "module" + }, + rules: {} +}; diff --git a/home/ags/config/.prettierrc.json b/home/ags/config/.prettierrc.json new file mode 100644 index 0000000..62f13f3 --- /dev/null +++ b/home/ags/config/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "trailingComma" : "none" +} \ No newline at end of file diff --git a/home/ags/config/config.js b/home/ags/config/config.js index 2376a82..52af89f 100644 --- a/home/ags/config/config.js +++ b/home/ags/config/config.js @@ -7,17 +7,15 @@ const css = App.configDir + "/style.css"; Utils.exec(`sass ${scss} ${css}`); function reloadCss() { - console.log("scss updating"); - Utils.exec(`sass ${scss} ${css}`); - App.resetCss(); - App.applyCss(css); + console.log("scss updating"); + Utils.exec(`sass ${scss} ${css}`); + App.resetCss(); + App.applyCss(css); } Utils.monitorFile(`${App.configDir}/scss`, reloadCss, "directory"); export default { - style: css, - windows: [ - Bar(2), - ], -}; \ No newline at end of file + style: css, + windows: [Bar(2)] +}; diff --git a/home/ags/config/js/main.js b/home/ags/config/js/main.js index e247c3a..8ff61fc 100644 --- a/home/ags/config/js/main.js +++ b/home/ags/config/js/main.js @@ -7,23 +7,16 @@ import { Workspaces } from "./widgets/hyprland.js"; const Start = () => Widget.Box({ hpack: "start", - children: [ - nixosLogo(), - Workspaces(), - ], + children: [nixosLogo(), Workspaces()] }); const Center = () => Widget.Box({ - children: [ - Media(), - ], + children: [Media()] }); const End = () => Widget.Box({ hpack: "end", - children: [ - Time(), - ], + children: [Time()] }); const Bar = (monitor) => @@ -35,8 +28,8 @@ const Bar = (monitor) => child: Widget.CenterBox({ startWidget: Start(), centerWidget: Center(), - endWidget: End(), - }), + endWidget: End() + }) }); export { Bar }; diff --git a/home/ags/config/js/widgets/hyprland.js b/home/ags/config/js/widgets/hyprland.js index 9591fcf..46d77f5 100644 --- a/home/ags/config/js/widgets/hyprland.js +++ b/home/ags/config/js/widgets/hyprland.js @@ -8,11 +8,12 @@ const Workspaces = () => Widget.Button({ on_clicked: () => Hyprland.sendMessage(`dispatch workspace ${id}`), child: Widget.Label(`${id}`), - class_name: Hyprland.active.workspace.bind("id") - .transform((i) => `${i === id ? "focused" : ""}`), + class_name: Hyprland.active.workspace + .bind("id") + .transform((i) => `${i === id ? "focused" : ""}`) }) ); - }), + }) }); export { Workspaces }; diff --git a/home/ags/config/js/widgets/music.js b/home/ags/config/js/widgets/music.js index 135f138..f99a145 100644 --- a/home/ags/config/js/widgets/music.js +++ b/home/ags/config/js/widgets/music.js @@ -3,14 +3,18 @@ import { Mpris, Widget } from "../../import.js"; const Media = () => Widget.Box({ class_name: "media", - child: Widget.Label("-").hook(Mpris, (self) => { - if (Mpris.players[0]) { - const { track_artists, track_title } = Mpris.players[0]; - self.label = `${track_artists.join(", ")} - ${track_title}`; - } else { - self.label = "Nothing is playing"; - } - }, "player-changed"), + child: Widget.Label("-").hook( + Mpris, + (self) => { + if (Mpris.players[0]) { + const { track_artists, track_title } = Mpris.players[0]; + self.label = `${track_artists.join(", ")} - ${track_title}`; + } else { + self.label = "Nothing is playing"; + } + }, + "player-changed" + ) }); export { Media }; diff --git a/home/ags/config/js/widgets/time.js b/home/ags/config/js/widgets/time.js index 3103c17..31786b7 100644 --- a/home/ags/config/js/widgets/time.js +++ b/home/ags/config/js/widgets/time.js @@ -3,14 +3,12 @@ import { Utils, Widget } from "../../import.js"; const Time = () => Widget.Box({ child: Widget.Label({ - className: "date", - }).poll( - 1000, - (self) => - Utils.execAsync(["date", "+%a %b %d %H:%M"]).then((time) => - self.label = time - ), - ), + className: "date" + }).poll(1000, (self) => + Utils.execAsync(["date", "+%a %b %d %H:%M"]).then( + (time) => (self.label = time) + ) + ) }); -export { Time }; \ No newline at end of file +export { Time }; diff --git a/home/ags/config/jsconfig.json b/home/ags/config/jsconfig.json index 961a4a5..fbf490f 100644 --- a/home/ags/config/jsconfig.json +++ b/home/ags/config/jsconfig.json @@ -1,15 +1,12 @@ { - "compilerOptions": { - "module": "ESNext", - "moduleResolution": "Node", - "target": "ES2020", - "jsx": "react", - "allowImportingTsExtensions": true, - "strictNullChecks": true, - "strictFunctionTypes": true - }, - "exclude": [ - "node_modules", - "**/node_modules/*" - ] -} \ No newline at end of file + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "Node", + "target": "ES2020", + "jsx": "react", + "allowImportingTsExtensions": true, + "strictNullChecks": true, + "strictFunctionTypes": true + }, + "exclude": ["node_modules", "**/node_modules/*"] +}