diff --git a/.gitignore b/.gitignore index 088ab590..4b8a9dcc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ *types/ *build/ result* +*config.js diff --git a/devices/binto/config/ags/config.js b/devices/binto/config/ags/config.js deleted file mode 100644 index aad874f7..00000000 --- a/devices/binto/config/ags/config.js +++ /dev/null @@ -1,3 +0,0 @@ -import { transpileTypeScript } from 'file:///home/matt/.nix/devices/wim/config/ags/js/utils.js'; - -export default (await transpileTypeScript()).default; diff --git a/devices/binto/config/ags/package-lock.json b/devices/binto/config/ags/package-lock.json deleted file mode 100644 index 49bab0e9..00000000 Binary files a/devices/binto/config/ags/package-lock.json and /dev/null differ diff --git a/devices/binto/config/ags/package.json b/devices/binto/config/ags/package.json deleted file mode 100644 index e14b4b6d..00000000 --- a/devices/binto/config/ags/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "main": "config.js", - "dependencies": { - "fzf": "^0.5.2" - }, - "devDependencies": { - "eslint": "^8.52.0", - "@typescript-eslint/eslint-plugin": "^6.9.1", - "@typescript-eslint/parser": "^6.9.1", - "stylelint-config-standard-scss": "^11.0.0", - "@stylistic/eslint-plugin": "^1.4.0", - "@girs/dbusmenugtk3-0.4": "^0.4.0-3.2.0", - "@girs/gudev-1.0": "^1.0.0-3.2.2", - "@girs/gobject-2.0": "^2.76.1-3.2.3", - "@girs/gtk-3.0": "^3.24.39-3.2.2", - "@girs/gvc-1.0": "^1.0.0-3.1.0", - "@girs/nm-1.0": "^1.43.1-3.1.0" - } -} diff --git a/devices/binto/config/ags/scss/main.scss b/devices/binto/config/ags/scss/main.scss deleted file mode 100644 index 7e66a95d..00000000 --- a/devices/binto/config/ags/scss/main.scss +++ /dev/null @@ -1,16 +0,0 @@ -window, -button, -eventbox, -box, -progressbar, -trough, -undershoot { - all: unset; -} - -@import '/home/matt/.nix/devices/wim/config/ags/scss/common'; -@import './widgets/applauncher'; -@import './widgets/bar'; -@import './widgets/notification'; -@import './widgets/notification-center'; -@import './widgets/powermenu'; diff --git a/devices/wim/config/ags/.eslintrc.json b/devices/wim/config/ags/.eslintrc.json deleted file mode 100644 index e6663314..00000000 --- a/devices/wim/config/ags/.eslintrc.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "env": { - "es2021": true - }, - "extends": "eslint:recommended", - "parser": "@typescript-eslint/parser", - "overrides": [], - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": ["@stylistic", "@typescript-eslint"], - "rules": { - "array-callback-return": ["error", { - "allowImplicit": true, - "checkForEach": true - }], - "no-constructor-return": ["error"], - "no-unreachable-loop": ["error", { "ignore": [ - "ForInStatement", "ForOfStatement" - ]}], - "no-use-before-define": ["error", { - "functions": false - }], - - - "block-scoped-var": ["error"], - "capitalized-comments": ["warn", "always", { - "ignoreConsecutiveComments": true - }], - "class-methods-use-this": ["error"], - "curly": ["warn"], - "default-case-last": ["warn"], - "default-param-last": ["error"], - "eqeqeq": ["error", "smart"], - "func-names": ["warn", "never"], - "func-style": ["warn", "expression"], - "logical-assignment-operators": ["warn", "always"], - "no-array-constructor": ["error"], - "no-empty-function": ["warn"], - "no-empty-static-block": ["warn"], - "no-extend-native": ["error"], - "no-extra-bind": ["warn"], - "no-implicit-coercion": ["warn"], - "no-iterator": ["error"], - "no-labels": ["error"], - "no-lone-blocks": ["error"], - "no-lonely-if": ["error"], - "no-loop-func": ["error"], - "no-magic-numbers": ["error", { - "ignore": [-1, 0.1, 0, 1, 2, 3, 10, 33, 66, 100, 255, 360, 450, 1000], - "ignoreDefaultValues": true - }], - "no-multi-assign": ["error"], - "no-new": ["error"], - "no-new-func": ["error"], - "no-new-wrappers": ["error"], - "no-object-constructor": ["error"], - "no-proto": ["error"], - "no-return-assign": ["error"], - "no-sequences": ["error"], - "no-shadow": ["error", { "builtinGlobals": true }], - "no-undef-init": ["warn"], - "no-undefined": ["error"], - "no-useless-constructor": ["warn"], - "no-useless-escape": ["off"], - "no-useless-return": ["error"], - "no-var": ["error"], - "no-void": ["error"], - "no-with": ["error"], - "object-shorthand": ["error", "always"], - "one-var": ["error", "never"], - "operator-assignment": ["warn", "always"], - "prefer-arrow-callback": ["error"], - "prefer-const": ["error"], - "prefer-object-has-own": ["error"], - "prefer-regex-literals": ["error"], - "prefer-template": ["warn"], - - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "warn", - - "@stylistic/array-bracket-newline": ["warn", "consistent"], - "@stylistic/array-bracket-spacing": ["warn", "never"], - "@stylistic/arrow-parens": ["warn", "always"], - "@stylistic/brace-style": ["warn", "stroustrup"], - "@stylistic/comma-dangle": ["warn", "always-multiline"], - "@stylistic/comma-spacing": ["warn", { "before": false, "after": true }], - "@stylistic/comma-style": ["error", "last"], - "@stylistic/dot-location": ["error", "property"], - "@stylistic/function-call-argument-newline": ["warn", "consistent"], - "@stylistic/function-paren-newline": ["warn", "consistent"], - "@stylistic/indent": ["warn", 4, { - "SwitchCase": 1, - "ignoreComments": true - }], - "@stylistic/key-spacing": ["warn", { "beforeColon": false, "afterColon": true }], - "@stylistic/keyword-spacing": ["warn", { "before": true }], - "@stylistic/linebreak-style": ["error", "unix"], - "@stylistic/lines-between-class-members": ["warn", "always", { "exceptAfterSingleLine": true }], - "@stylistic/max-len": ["warn", { - "code": 80, - "ignoreComments": true, - "ignoreTrailingComments": true, - "ignoreUrls": true - }], - "@stylistic/multiline-ternary": ["warn", "always-multiline"], - "@stylistic/new-parens": ["error"], - "@stylistic/no-mixed-operators": ["warn"], - "@stylistic/no-mixed-spaces-and-tabs": ["error"], - "@stylistic/no-multi-spaces": ["error"], - "@stylistic/no-tabs": ["error"], - "@stylistic/no-trailing-spaces": ["error"], - "@stylistic/no-whitespace-before-property": ["warn"], - "@stylistic/nonblock-statement-body-position": ["error", "below"], - "@stylistic/object-curly-newline": ["warn", { "consistent": true }], - "@stylistic/object-curly-spacing": ["warn", "always"], - "@stylistic/operator-linebreak": ["warn", "after"], - "@stylistic/padded-blocks": ["error", "never"], - "@stylistic/padding-line-between-statements": ["warn", - { "blankLine": "always", "prev": "*", "next": "return" }, - { "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"}, - { "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]}, - { "blankLine": "always", "prev": ["case", "default"], "next": "*" } - ], - "@stylistic/quote-props": ["error", "consistent-as-needed"], - "@stylistic/quotes": ["error", "single", { "avoidEscape": true }], - "@stylistic/semi": ["error", "always"], - "@stylistic/semi-spacing": ["warn"], - "@stylistic/space-before-blocks": ["warn"], - "@stylistic/space-before-function-paren": ["warn", "never"], - "@stylistic/space-infix-ops": ["warn"], - "@stylistic/spaced-comment": ["warn", "always"], - "@stylistic/switch-colon-spacing": ["warn"], - "@stylistic/wrap-regex": ["warn"] - }, - "globals": { - "ARGV": "readonly", - "imports": "readonly", - "print": "readonly", - "console": "readonly", - "logError": "readonly", - "setTimeout": "readonly", - "setInterval": "readonly" - } -} diff --git a/devices/wim/config/ags/.stylelintrc.yml b/devices/wim/config/ags/.stylelintrc.yml deleted file mode 100644 index bf5a5120..00000000 --- a/devices/wim/config/ags/.stylelintrc.yml +++ /dev/null @@ -1,17 +0,0 @@ -extends: stylelint-config-standard-scss -ignoreFiles: - - "**/*.js" - - "**/*.ts" -rules: - selector-type-no-unknown: null - selector-class-pattern: null - declaration-empty-line-before: null - no-descending-specificity: null - selector-pseudo-class-no-unknown: null - color-function-notation: legacy - alpha-value-notation: number - scss/operator-no-unspaced: null - scss/no-global-function-names: null - scss/dollar-variable-empty-line-before: null - no-invalid-position-at-import-rule: null - font-family-no-missing-generic-family-keyword: null diff --git a/devices/wim/config/ags/config.js b/devices/wim/config/ags/config.js deleted file mode 100644 index b5a5616c..00000000 --- a/devices/wim/config/ags/config.js +++ /dev/null @@ -1,4 +0,0 @@ -import { transpileTypeScript } from './js/utils.js'; - -// See ./ts/main.ts for actual code -export default (await transpileTypeScript()).default; diff --git a/devices/wim/config/ags/scss/main.scss b/devices/wim/config/ags/scss/main.scss deleted file mode 100644 index 99fbf970..00000000 --- a/devices/wim/config/ags/scss/main.scss +++ /dev/null @@ -1,24 +0,0 @@ -window, -button, -eventbox, -box, -progressbar, -trough, -undershoot { - all: unset; -} - -@import "./common"; -@import "./widgets/powermenu"; -@import "./widgets/traybuttons"; -@import "./widgets/workspaces"; -@import "./widgets/systray"; -@import "./widgets/notification-center"; -@import "./widgets/notification"; -@import "./widgets/date"; -@import "./widgets/quick-settings"; -@import "./widgets/player"; -@import "./widgets/overview"; -@import "./widgets/applauncher"; -@import "./widgets/osd"; -@import "./widgets/osk"; diff --git a/devices/wim/config/ags/tsconfig.json b/devices/wim/config/ags/tsconfig.json deleted file mode 100644 index 506ae24c..00000000 --- a/devices/wim/config/ags/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "ES2022", - "lib": [ - "ES2022" - ], - "allowImportingTsExtensions": true, - "allowJs": true, - "checkJs": true, - "strict": true, - "noImplicitAny": false, - "baseUrl": ".", - "typeRoots": [ - "./types/ags.d.ts", - "./node_modules/@girs" - ], - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - } -} diff --git a/devices/binto/config/ags/.eslintrc.json b/modules/ags/config/.eslintrc.json similarity index 100% rename from devices/binto/config/ags/.eslintrc.json rename to modules/ags/config/.eslintrc.json diff --git a/devices/binto/config/ags/.stylelintrc.yml b/modules/ags/config/.stylelintrc.yml similarity index 100% rename from devices/binto/config/ags/.stylelintrc.yml rename to modules/ags/config/.stylelintrc.yml diff --git a/devices/binto/config/ags/ts/main.ts b/modules/ags/config/binto.ts similarity index 63% rename from devices/binto/config/ags/ts/main.ts rename to modules/ags/config/binto.ts index 64246792..0e6f3ecf 100644 --- a/devices/binto/config/ags/ts/main.ts +++ b/modules/ags/config/binto.ts @@ -1,9 +1,9 @@ -import Pointers from '../../../../wim/config/ags/services/pointers.ts'; +import Pointers from './services/pointers.ts'; -import AppLauncher from '../../../../wim/config/ags/ts/applauncher/main.ts'; -import Bar from './bar/main.ts'; -import { NotifPopups, NotifCenter } from './notifications/main.ts'; -import Powermenu from '../../../../wim/config/ags/ts/powermenu.ts'; +import AppLauncher from './ts/applauncher/main.ts'; +import Bar from './ts/bar/binto.ts'; +import { NotifPopups, NotifCenter } from './ts/notifications/binto.ts'; +import Powermenu from './ts/powermenu.ts'; const closeWinDelay = 800; diff --git a/devices/wim/config/ags/icons/down-large.svg b/modules/ags/config/icons/down-large.svg similarity index 100% rename from devices/wim/config/ags/icons/down-large.svg rename to modules/ags/config/icons/down-large.svg diff --git a/devices/wim/config/ags/js/utils.js b/modules/ags/config/js/utils.js similarity index 73% rename from devices/wim/config/ags/js/utils.js rename to modules/ags/config/js/utils.js index 81741207..6452c2dd 100644 --- a/devices/wim/config/ags/js/utils.js +++ b/modules/ags/config/js/utils.js @@ -2,9 +2,10 @@ import App from 'resource:///com/github/Aylur/ags/app.js'; import { execAsync, monitorFile } from 'resource:///com/github/Aylur/ags/utils.js'; -const watchAndCompileSass = () => { +/** @param {string} host */ +const watchAndCompileSass = (host) => { const reloadCss = () => { - const scss = `${App.configDir}/scss/main.scss`; + const scss = `${App.configDir}/scss/${host}.scss`; const css = '/tmp/ags/style.css'; execAsync(`sassc ${scss} ${css}`).then(() => { @@ -21,9 +22,10 @@ const watchAndCompileSass = () => { reloadCss(); }; -export const transpileTypeScript = async() => { +/** @param {string} host */ +export const transpileTypeScript = async(host) => { await execAsync([ - 'bun', 'build', `${App.configDir}/ts/main.ts`, + 'bun', 'build', `${App.configDir}/${host}.ts`, '--outdir', '/tmp/ags', '--external', 'resource:///*', '--external', 'gi://*', @@ -31,7 +33,7 @@ export const transpileTypeScript = async() => { '--external', '*/fzf.es.js', ]).catch(print); - watchAndCompileSass(); + watchAndCompileSass(host); // The file is going to be there after transpilation // @ts-ignore diff --git a/devices/wim/config/ags/package-lock.json b/modules/ags/config/package-lock.json similarity index 99% rename from devices/wim/config/ags/package-lock.json rename to modules/ags/config/package-lock.json index 118af3f8..d9b767ef 100644 Binary files a/devices/wim/config/ags/package-lock.json and b/modules/ags/config/package-lock.json differ diff --git a/devices/wim/config/ags/package.json b/modules/ags/config/package.json similarity index 92% rename from devices/wim/config/ags/package.json rename to modules/ags/config/package.json index e14b4b6d..3af6a5d3 100644 --- a/devices/wim/config/ags/package.json +++ b/modules/ags/config/package.json @@ -10,7 +10,6 @@ "stylelint-config-standard-scss": "^11.0.0", "@stylistic/eslint-plugin": "^1.4.0", "@girs/dbusmenugtk3-0.4": "^0.4.0-3.2.0", - "@girs/gudev-1.0": "^1.0.0-3.2.2", "@girs/gobject-2.0": "^2.76.1-3.2.3", "@girs/gtk-3.0": "^3.24.39-3.2.2", "@girs/gvc-1.0": "^1.0.0-3.1.0", diff --git a/devices/binto/config/ags/scss/widgets/applauncher.scss b/modules/ags/config/scss/binto-widgets/applauncher.scss similarity index 100% rename from devices/binto/config/ags/scss/widgets/applauncher.scss rename to modules/ags/config/scss/binto-widgets/applauncher.scss diff --git a/devices/binto/config/ags/scss/widgets/bar.scss b/modules/ags/config/scss/binto-widgets/bar.scss similarity index 100% rename from devices/binto/config/ags/scss/widgets/bar.scss rename to modules/ags/config/scss/binto-widgets/bar.scss diff --git a/devices/binto/config/ags/scss/widgets/notification-center.scss b/modules/ags/config/scss/binto-widgets/notification-center.scss similarity index 100% rename from devices/binto/config/ags/scss/widgets/notification-center.scss rename to modules/ags/config/scss/binto-widgets/notification-center.scss diff --git a/devices/binto/config/ags/scss/widgets/notification.scss b/modules/ags/config/scss/binto-widgets/notification.scss similarity index 100% rename from devices/binto/config/ags/scss/widgets/notification.scss rename to modules/ags/config/scss/binto-widgets/notification.scss diff --git a/devices/binto/config/ags/scss/widgets/powermenu.scss b/modules/ags/config/scss/binto-widgets/powermenu.scss similarity index 100% rename from devices/binto/config/ags/scss/widgets/powermenu.scss rename to modules/ags/config/scss/binto-widgets/powermenu.scss diff --git a/modules/ags/config/scss/binto.scss b/modules/ags/config/scss/binto.scss new file mode 100644 index 00000000..b85b9a2d --- /dev/null +++ b/modules/ags/config/scss/binto.scss @@ -0,0 +1,16 @@ +window, +button, +eventbox, +box, +progressbar, +trough, +undershoot { + all: unset; +} + +@import "./common"; +@import './binto-widgets/applauncher'; +@import './binto-widgets/bar'; +@import './binto-widgets/notification'; +@import './binto-widgets/notification-center'; +@import './binto-widgets/powermenu'; diff --git a/devices/wim/config/ags/scss/common.scss b/modules/ags/config/scss/common.scss similarity index 100% rename from devices/wim/config/ags/scss/common.scss rename to modules/ags/config/scss/common.scss diff --git a/devices/wim/config/ags/scss/widgets/applauncher.scss b/modules/ags/config/scss/wim-widgets/applauncher.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/applauncher.scss rename to modules/ags/config/scss/wim-widgets/applauncher.scss diff --git a/devices/wim/config/ags/scss/widgets/date.scss b/modules/ags/config/scss/wim-widgets/date.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/date.scss rename to modules/ags/config/scss/wim-widgets/date.scss diff --git a/devices/wim/config/ags/scss/widgets/notification-center.scss b/modules/ags/config/scss/wim-widgets/notification-center.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/notification-center.scss rename to modules/ags/config/scss/wim-widgets/notification-center.scss diff --git a/devices/wim/config/ags/scss/widgets/notification.scss b/modules/ags/config/scss/wim-widgets/notification.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/notification.scss rename to modules/ags/config/scss/wim-widgets/notification.scss diff --git a/devices/wim/config/ags/scss/widgets/osd.scss b/modules/ags/config/scss/wim-widgets/osd.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/osd.scss rename to modules/ags/config/scss/wim-widgets/osd.scss diff --git a/devices/wim/config/ags/scss/widgets/osk.scss b/modules/ags/config/scss/wim-widgets/osk.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/osk.scss rename to modules/ags/config/scss/wim-widgets/osk.scss diff --git a/devices/wim/config/ags/scss/widgets/overview.scss b/modules/ags/config/scss/wim-widgets/overview.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/overview.scss rename to modules/ags/config/scss/wim-widgets/overview.scss diff --git a/devices/wim/config/ags/scss/widgets/player.scss b/modules/ags/config/scss/wim-widgets/player.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/player.scss rename to modules/ags/config/scss/wim-widgets/player.scss diff --git a/devices/wim/config/ags/scss/widgets/powermenu.scss b/modules/ags/config/scss/wim-widgets/powermenu.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/powermenu.scss rename to modules/ags/config/scss/wim-widgets/powermenu.scss diff --git a/devices/wim/config/ags/scss/widgets/quick-settings.scss b/modules/ags/config/scss/wim-widgets/quick-settings.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/quick-settings.scss rename to modules/ags/config/scss/wim-widgets/quick-settings.scss diff --git a/devices/wim/config/ags/scss/widgets/systray.scss b/modules/ags/config/scss/wim-widgets/systray.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/systray.scss rename to modules/ags/config/scss/wim-widgets/systray.scss diff --git a/devices/wim/config/ags/scss/widgets/traybuttons.scss b/modules/ags/config/scss/wim-widgets/traybuttons.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/traybuttons.scss rename to modules/ags/config/scss/wim-widgets/traybuttons.scss diff --git a/devices/wim/config/ags/scss/widgets/workspaces.scss b/modules/ags/config/scss/wim-widgets/workspaces.scss similarity index 100% rename from devices/wim/config/ags/scss/widgets/workspaces.scss rename to modules/ags/config/scss/wim-widgets/workspaces.scss diff --git a/modules/ags/config/scss/wim.scss b/modules/ags/config/scss/wim.scss new file mode 100644 index 00000000..bf2bd697 --- /dev/null +++ b/modules/ags/config/scss/wim.scss @@ -0,0 +1,24 @@ +window, +button, +eventbox, +box, +progressbar, +trough, +undershoot { + all: unset; +} + +@import "./common"; +@import "./wim-widgets/powermenu"; +@import "./wim-widgets/traybuttons"; +@import "./wim-widgets/workspaces"; +@import "./wim-widgets/systray"; +@import "./wim-widgets/notification-center"; +@import "./wim-widgets/notification"; +@import "./wim-widgets/date"; +@import "./wim-widgets/quick-settings"; +@import "./wim-widgets/player"; +@import "./wim-widgets/overview"; +@import "./wim-widgets/applauncher"; +@import "./wim-widgets/osd"; +@import "./wim-widgets/osk"; diff --git a/devices/wim/config/ags/services/brightness.ts b/modules/ags/config/services/brightness.ts similarity index 100% rename from devices/wim/config/ags/services/brightness.ts rename to modules/ags/config/services/brightness.ts diff --git a/devices/wim/config/ags/services/pointers.ts b/modules/ags/config/services/pointers.ts similarity index 100% rename from devices/wim/config/ags/services/pointers.ts rename to modules/ags/config/services/pointers.ts diff --git a/devices/wim/config/ags/services/tablet.ts b/modules/ags/config/services/tablet.ts similarity index 100% rename from devices/wim/config/ags/services/tablet.ts rename to modules/ags/config/services/tablet.ts diff --git a/devices/wim/config/ags/services/touch-gestures.ts b/modules/ags/config/services/touch-gestures.ts similarity index 100% rename from devices/wim/config/ags/services/touch-gestures.ts rename to modules/ags/config/services/touch-gestures.ts diff --git a/devices/wim/config/ags/ts/applauncher/app-item.ts b/modules/ags/config/ts/applauncher/app-item.ts similarity index 100% rename from devices/wim/config/ags/ts/applauncher/app-item.ts rename to modules/ags/config/ts/applauncher/app-item.ts diff --git a/devices/wim/config/ags/ts/applauncher/main.ts b/modules/ags/config/ts/applauncher/main.ts similarity index 97% rename from devices/wim/config/ags/ts/applauncher/main.ts rename to modules/ags/config/ts/applauncher/main.ts index 1c9045d8..8a2ee0ae 100644 --- a/devices/wim/config/ags/ts/applauncher/main.ts +++ b/modules/ags/config/ts/applauncher/main.ts @@ -2,7 +2,7 @@ import App from 'resource:///com/github/Aylur/ags/app.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; // FIXME: find cleaner way to import this // @ts-expect-error -import { Fzf } from 'file:///home/matt/.config/ags/node_modules/fzf/dist/fzf.es.js'; +import { Fzf } from 'file:///home/matt/.nix/modules/ags/config/node_modules/fzf/dist/fzf.es.js'; import { Box, Entry, Icon, Label, ListBox, Revealer, Scrollable } from 'resource:///com/github/Aylur/ags/widget.js'; diff --git a/devices/binto/config/ags/ts/bar/main.ts b/modules/ags/config/ts/bar/binto.ts similarity index 79% rename from devices/binto/config/ags/ts/bar/main.ts rename to modules/ags/config/ts/bar/binto.ts index 570c2400..8cd47f57 100644 --- a/devices/binto/config/ags/ts/bar/main.ts +++ b/modules/ags/config/ts/bar/binto.ts @@ -1,10 +1,9 @@ import { Box, CenterBox, Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import SysTray from '../../../../../wim/config/ags/ts/bar/items/systray.ts'; -import Separator from '../../../../../wim/config/ags/ts/misc/separator.ts'; -import NotifButton from - '../../../../../wim/config/ags/ts/bar/items/notif-button.ts'; -import Clock from './buttons/clock.ts'; +import SysTray from './items/systray.ts'; +import Separator from '../misc/separator.ts'; +import NotifButton from './items/notif-button.ts'; +import Clock from './items/clock.ts'; const PADDING = 20; diff --git a/devices/wim/config/ags/ts/bar/fullscreen.ts b/modules/ags/config/ts/bar/fullscreen.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/fullscreen.ts rename to modules/ags/config/ts/bar/fullscreen.ts diff --git a/devices/wim/config/ags/ts/bar/hovers/audio.ts b/modules/ags/config/ts/bar/hovers/audio.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/hovers/audio.ts rename to modules/ags/config/ts/bar/hovers/audio.ts diff --git a/devices/wim/config/ags/ts/bar/hovers/bluetooth.ts b/modules/ags/config/ts/bar/hovers/bluetooth.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/hovers/bluetooth.ts rename to modules/ags/config/ts/bar/hovers/bluetooth.ts diff --git a/devices/wim/config/ags/ts/bar/hovers/brightness.ts b/modules/ags/config/ts/bar/hovers/brightness.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/hovers/brightness.ts rename to modules/ags/config/ts/bar/hovers/brightness.ts diff --git a/devices/wim/config/ags/ts/bar/hovers/hover-revealer.ts b/modules/ags/config/ts/bar/hovers/hover-revealer.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/hovers/hover-revealer.ts rename to modules/ags/config/ts/bar/hovers/hover-revealer.ts diff --git a/devices/wim/config/ags/ts/bar/hovers/keyboard-layout.ts b/modules/ags/config/ts/bar/hovers/keyboard-layout.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/hovers/keyboard-layout.ts rename to modules/ags/config/ts/bar/hovers/keyboard-layout.ts diff --git a/devices/wim/config/ags/ts/bar/hovers/network.ts b/modules/ags/config/ts/bar/hovers/network.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/hovers/network.ts rename to modules/ags/config/ts/bar/hovers/network.ts diff --git a/devices/wim/config/ags/ts/bar/items/battery.ts b/modules/ags/config/ts/bar/items/battery.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/battery.ts rename to modules/ags/config/ts/bar/items/battery.ts diff --git a/devices/wim/config/ags/ts/bar/items/clock.ts b/modules/ags/config/ts/bar/items/cal-opener.ts similarity index 54% rename from devices/wim/config/ags/ts/bar/items/clock.ts rename to modules/ags/config/ts/bar/items/cal-opener.ts index 92cd3877..fefcef08 100644 --- a/devices/wim/config/ags/ts/bar/items/clock.ts +++ b/modules/ags/config/ts/bar/items/cal-opener.ts @@ -1,10 +1,7 @@ import App from 'resource:///com/github/Aylur/ags/app.js'; -import { Label } from 'resource:///com/github/Aylur/ags/widget.js'; - -const { DateTime } = imports.gi.GLib; - import CursorBox from '../../misc/cursorbox.ts'; +import Clock from './clock'; export default () => CursorBox({ @@ -20,12 +17,5 @@ export default () => CursorBox({ }); }, - child: Label({ class_name: 'clock' }) - .poll(1000, (self) => { - const time = DateTime.new_now_local(); - - self.label = time.format('%a. ') + - time.get_day_of_month() + - time.format(' %b. %H:%M'); - }), + child: Clock(), }); diff --git a/devices/binto/config/ags/ts/bar/buttons/clock.ts b/modules/ags/config/ts/bar/items/clock.ts similarity index 100% rename from devices/binto/config/ags/ts/bar/buttons/clock.ts rename to modules/ags/config/ts/bar/items/clock.ts diff --git a/devices/wim/config/ags/ts/bar/items/current-window.ts b/modules/ags/config/ts/bar/items/current-window.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/current-window.ts rename to modules/ags/config/ts/bar/items/current-window.ts diff --git a/devices/wim/config/ags/ts/bar/items/heart.ts b/modules/ags/config/ts/bar/items/heart.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/heart.ts rename to modules/ags/config/ts/bar/items/heart.ts diff --git a/devices/wim/config/ags/ts/bar/items/notif-button.ts b/modules/ags/config/ts/bar/items/notif-button.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/notif-button.ts rename to modules/ags/config/ts/bar/items/notif-button.ts diff --git a/devices/wim/config/ags/ts/bar/items/osk-toggle.ts b/modules/ags/config/ts/bar/items/osk-toggle.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/osk-toggle.ts rename to modules/ags/config/ts/bar/items/osk-toggle.ts diff --git a/devices/wim/config/ags/ts/bar/items/quick-settings.ts b/modules/ags/config/ts/bar/items/quick-settings.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/quick-settings.ts rename to modules/ags/config/ts/bar/items/quick-settings.ts diff --git a/devices/wim/config/ags/ts/bar/items/systray.ts b/modules/ags/config/ts/bar/items/systray.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/systray.ts rename to modules/ags/config/ts/bar/items/systray.ts diff --git a/devices/wim/config/ags/ts/bar/items/tablet-toggle.ts b/modules/ags/config/ts/bar/items/tablet-toggle.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/tablet-toggle.ts rename to modules/ags/config/ts/bar/items/tablet-toggle.ts diff --git a/devices/wim/config/ags/ts/bar/items/workspaces.ts b/modules/ags/config/ts/bar/items/workspaces.ts similarity index 100% rename from devices/wim/config/ags/ts/bar/items/workspaces.ts rename to modules/ags/config/ts/bar/items/workspaces.ts diff --git a/devices/wim/config/ags/ts/bar/main.ts b/modules/ags/config/ts/bar/wim.ts similarity index 97% rename from devices/wim/config/ags/ts/bar/main.ts rename to modules/ags/config/ts/bar/wim.ts index 2ea880e3..d22669ba 100644 --- a/devices/wim/config/ags/ts/bar/main.ts +++ b/modules/ags/config/ts/bar/wim.ts @@ -3,7 +3,7 @@ import { Window, CenterBox, Box } from 'resource:///com/github/Aylur/ags/widget. import Separator from '../misc/separator.ts'; import Battery from './items/battery.ts'; -import Clock from './items/clock.ts'; +import Clock from './items/cal-opener.ts'; import CurrentWindow from './items/current-window.ts'; import Heart from './items/heart.ts'; import NotifButton from './items/notif-button.ts'; diff --git a/devices/wim/config/ags/ts/corners/main.ts b/modules/ags/config/ts/corners/main.ts similarity index 100% rename from devices/wim/config/ags/ts/corners/main.ts rename to modules/ags/config/ts/corners/main.ts diff --git a/devices/wim/config/ags/ts/corners/screen-corners.ts b/modules/ags/config/ts/corners/screen-corners.ts similarity index 100% rename from devices/wim/config/ags/ts/corners/screen-corners.ts rename to modules/ags/config/ts/corners/screen-corners.ts diff --git a/devices/wim/config/ags/ts/date.ts b/modules/ags/config/ts/date.ts similarity index 100% rename from devices/wim/config/ags/ts/date.ts rename to modules/ags/config/ts/date.ts diff --git a/devices/wim/config/ags/ts/media-player/gesture.ts b/modules/ags/config/ts/media-player/gesture.ts similarity index 100% rename from devices/wim/config/ags/ts/media-player/gesture.ts rename to modules/ags/config/ts/media-player/gesture.ts diff --git a/devices/wim/config/ags/ts/media-player/mpris.ts b/modules/ags/config/ts/media-player/mpris.ts similarity index 100% rename from devices/wim/config/ags/ts/media-player/mpris.ts rename to modules/ags/config/ts/media-player/mpris.ts diff --git a/devices/wim/config/ags/ts/media-player/player.ts b/modules/ags/config/ts/media-player/player.ts similarity index 100% rename from devices/wim/config/ags/ts/media-player/player.ts rename to modules/ags/config/ts/media-player/player.ts diff --git a/devices/wim/config/ags/ts/misc/audio-icons.ts b/modules/ags/config/ts/misc/audio-icons.ts similarity index 100% rename from devices/wim/config/ags/ts/misc/audio-icons.ts rename to modules/ags/config/ts/misc/audio-icons.ts diff --git a/devices/wim/config/ags/ts/misc/background-fade.ts b/modules/ags/config/ts/misc/background-fade.ts similarity index 100% rename from devices/wim/config/ags/ts/misc/background-fade.ts rename to modules/ags/config/ts/misc/background-fade.ts diff --git a/devices/wim/config/ags/ts/misc/closer.ts b/modules/ags/config/ts/misc/closer.ts similarity index 100% rename from devices/wim/config/ags/ts/misc/closer.ts rename to modules/ags/config/ts/misc/closer.ts diff --git a/devices/wim/config/ags/ts/misc/cursorbox.ts b/modules/ags/config/ts/misc/cursorbox.ts similarity index 100% rename from devices/wim/config/ags/ts/misc/cursorbox.ts rename to modules/ags/config/ts/misc/cursorbox.ts diff --git a/devices/wim/config/ags/ts/misc/persist.ts b/modules/ags/config/ts/misc/persist.ts similarity index 100% rename from devices/wim/config/ags/ts/misc/persist.ts rename to modules/ags/config/ts/misc/persist.ts diff --git a/devices/wim/config/ags/ts/misc/popup.ts b/modules/ags/config/ts/misc/popup.ts similarity index 100% rename from devices/wim/config/ags/ts/misc/popup.ts rename to modules/ags/config/ts/misc/popup.ts diff --git a/devices/wim/config/ags/ts/misc/separator.ts b/modules/ags/config/ts/misc/separator.ts similarity index 100% rename from devices/wim/config/ags/ts/misc/separator.ts rename to modules/ags/config/ts/misc/separator.ts diff --git a/devices/wim/config/ags/ts/notifications/base.ts b/modules/ags/config/ts/notifications/base.ts similarity index 100% rename from devices/wim/config/ags/ts/notifications/base.ts rename to modules/ags/config/ts/notifications/base.ts diff --git a/devices/binto/config/ags/ts/notifications/main.ts b/modules/ags/config/ts/notifications/binto.ts similarity index 62% rename from devices/binto/config/ags/ts/notifications/main.ts rename to modules/ags/config/ts/notifications/binto.ts index b7a6de7b..8dd6bf73 100644 --- a/devices/binto/config/ags/ts/notifications/main.ts +++ b/modules/ags/config/ts/notifications/binto.ts @@ -1,11 +1,9 @@ import { Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import NotifCenterWidget from - '../../../../../wim/config/ags/ts/notifications/center.ts'; -import PopUpsWidget from - '../../../../../wim/config/ags/ts/notifications/popup.ts'; +import NotifCenterWidget from './center.ts'; +import PopUpsWidget from './popup.ts'; -import PopupWindow from '../../../../../wim/config/ags/ts/misc/popup.ts'; +import PopupWindow from '../misc/popup.ts'; export const NotifPopups = () => Window({ diff --git a/devices/wim/config/ags/ts/notifications/center.ts b/modules/ags/config/ts/notifications/center.ts similarity index 100% rename from devices/wim/config/ags/ts/notifications/center.ts rename to modules/ags/config/ts/notifications/center.ts diff --git a/devices/wim/config/ags/ts/notifications/gesture.ts b/modules/ags/config/ts/notifications/gesture.ts similarity index 100% rename from devices/wim/config/ags/ts/notifications/gesture.ts rename to modules/ags/config/ts/notifications/gesture.ts diff --git a/devices/wim/config/ags/ts/notifications/popup.ts b/modules/ags/config/ts/notifications/popup.ts similarity index 100% rename from devices/wim/config/ags/ts/notifications/popup.ts rename to modules/ags/config/ts/notifications/popup.ts diff --git a/devices/wim/config/ags/ts/notifications/main.ts b/modules/ags/config/ts/notifications/wim.ts similarity index 100% rename from devices/wim/config/ags/ts/notifications/main.ts rename to modules/ags/config/ts/notifications/wim.ts diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/gesture.ts b/modules/ags/config/ts/on-screen-keyboard/gesture.ts similarity index 100% rename from devices/wim/config/ags/ts/on-screen-keyboard/gesture.ts rename to modules/ags/config/ts/on-screen-keyboard/gesture.ts diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/keyboard-layouts.ts b/modules/ags/config/ts/on-screen-keyboard/keyboard-layouts.ts similarity index 100% rename from devices/wim/config/ags/ts/on-screen-keyboard/keyboard-layouts.ts rename to modules/ags/config/ts/on-screen-keyboard/keyboard-layouts.ts diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/keyboard.ts b/modules/ags/config/ts/on-screen-keyboard/keyboard.ts similarity index 100% rename from devices/wim/config/ags/ts/on-screen-keyboard/keyboard.ts rename to modules/ags/config/ts/on-screen-keyboard/keyboard.ts diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts b/modules/ags/config/ts/on-screen-keyboard/keys.ts similarity index 100% rename from devices/wim/config/ags/ts/on-screen-keyboard/keys.ts rename to modules/ags/config/ts/on-screen-keyboard/keys.ts diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/main.ts b/modules/ags/config/ts/on-screen-keyboard/main.ts similarity index 100% rename from devices/wim/config/ags/ts/on-screen-keyboard/main.ts rename to modules/ags/config/ts/on-screen-keyboard/main.ts diff --git a/devices/wim/config/ags/ts/osd/ctor.ts b/modules/ags/config/ts/osd/ctor.ts similarity index 100% rename from devices/wim/config/ags/ts/osd/ctor.ts rename to modules/ags/config/ts/osd/ctor.ts diff --git a/devices/wim/config/ags/ts/osd/main.ts b/modules/ags/config/ts/osd/main.ts similarity index 100% rename from devices/wim/config/ags/ts/osd/main.ts rename to modules/ags/config/ts/osd/main.ts diff --git a/devices/wim/config/ags/ts/osd/osds.ts b/modules/ags/config/ts/osd/osds.ts similarity index 100% rename from devices/wim/config/ags/ts/osd/osds.ts rename to modules/ags/config/ts/osd/osds.ts diff --git a/devices/wim/config/ags/ts/overview/clients.ts b/modules/ags/config/ts/overview/clients.ts similarity index 100% rename from devices/wim/config/ags/ts/overview/clients.ts rename to modules/ags/config/ts/overview/clients.ts diff --git a/devices/wim/config/ags/ts/overview/current-workspace.ts b/modules/ags/config/ts/overview/current-workspace.ts similarity index 100% rename from devices/wim/config/ags/ts/overview/current-workspace.ts rename to modules/ags/config/ts/overview/current-workspace.ts diff --git a/devices/wim/config/ags/ts/overview/dragndrop.ts b/modules/ags/config/ts/overview/dragndrop.ts similarity index 100% rename from devices/wim/config/ags/ts/overview/dragndrop.ts rename to modules/ags/config/ts/overview/dragndrop.ts diff --git a/devices/wim/config/ags/ts/overview/main.ts b/modules/ags/config/ts/overview/main.ts similarity index 100% rename from devices/wim/config/ags/ts/overview/main.ts rename to modules/ags/config/ts/overview/main.ts diff --git a/devices/wim/config/ags/ts/overview/variables.ts b/modules/ags/config/ts/overview/variables.ts similarity index 100% rename from devices/wim/config/ags/ts/overview/variables.ts rename to modules/ags/config/ts/overview/variables.ts diff --git a/devices/wim/config/ags/ts/overview/workspaces.ts b/modules/ags/config/ts/overview/workspaces.ts similarity index 100% rename from devices/wim/config/ags/ts/overview/workspaces.ts rename to modules/ags/config/ts/overview/workspaces.ts diff --git a/devices/wim/config/ags/ts/powermenu.ts b/modules/ags/config/ts/powermenu.ts similarity index 100% rename from devices/wim/config/ags/ts/powermenu.ts rename to modules/ags/config/ts/powermenu.ts diff --git a/devices/wim/config/ags/ts/quick-settings/bluetooth.ts b/modules/ags/config/ts/quick-settings/bluetooth.ts similarity index 100% rename from devices/wim/config/ags/ts/quick-settings/bluetooth.ts rename to modules/ags/config/ts/quick-settings/bluetooth.ts diff --git a/devices/wim/config/ags/ts/quick-settings/button-grid.ts b/modules/ags/config/ts/quick-settings/button-grid.ts similarity index 100% rename from devices/wim/config/ags/ts/quick-settings/button-grid.ts rename to modules/ags/config/ts/quick-settings/button-grid.ts diff --git a/devices/wim/config/ags/ts/quick-settings/main.ts b/modules/ags/config/ts/quick-settings/main.ts similarity index 100% rename from devices/wim/config/ags/ts/quick-settings/main.ts rename to modules/ags/config/ts/quick-settings/main.ts diff --git a/devices/wim/config/ags/ts/quick-settings/network.ts b/modules/ags/config/ts/quick-settings/network.ts similarity index 100% rename from devices/wim/config/ags/ts/quick-settings/network.ts rename to modules/ags/config/ts/quick-settings/network.ts diff --git a/devices/wim/config/ags/ts/quick-settings/slider-box.ts b/modules/ags/config/ts/quick-settings/slider-box.ts similarity index 100% rename from devices/wim/config/ags/ts/quick-settings/slider-box.ts rename to modules/ags/config/ts/quick-settings/slider-box.ts diff --git a/devices/wim/config/ags/ts/quick-settings/toggle-button.ts b/modules/ags/config/ts/quick-settings/toggle-button.ts similarity index 100% rename from devices/wim/config/ags/ts/quick-settings/toggle-button.ts rename to modules/ags/config/ts/quick-settings/toggle-button.ts diff --git a/devices/wim/config/ags/ts/setup.ts b/modules/ags/config/ts/setup.ts similarity index 100% rename from devices/wim/config/ags/ts/setup.ts rename to modules/ags/config/ts/setup.ts diff --git a/devices/binto/config/ags/tsconfig.json b/modules/ags/config/tsconfig.json similarity index 100% rename from devices/binto/config/ags/tsconfig.json rename to modules/ags/config/tsconfig.json diff --git a/devices/wim/config/ags/ts/main.ts b/modules/ags/config/wim.ts similarity index 56% rename from devices/wim/config/ags/ts/main.ts rename to modules/ags/config/wim.ts index 69245624..6a2c0449 100644 --- a/devices/wim/config/ags/ts/main.ts +++ b/modules/ags/config/wim.ts @@ -1,15 +1,15 @@ -import Setup from './setup.ts'; -import AppLauncher from './applauncher/main.ts'; -import Bar from './bar/main.ts'; -import BgFade from './misc/background-fade.ts'; -import Calendar from './date.ts'; -import Corners from './corners/main.ts'; -import { NotifPopups, NotifCenter } from './notifications/main.ts'; -import OSD from './osd/main.ts'; -import OSK from './on-screen-keyboard/main.ts'; -import Overview from './overview/main.ts'; -import Powermenu from './powermenu.ts'; -import QSettings from './quick-settings/main.ts'; +import Setup from './ts/setup.ts'; +import AppLauncher from './ts/applauncher/main.ts'; +import Bar from './ts/bar/wim.ts'; +import BgFade from './ts/misc/background-fade.ts'; +import Calendar from './ts/date.ts'; +import Corners from './ts/corners/main.ts'; +import { NotifPopups, NotifCenter } from './ts/notifications/wim.ts'; +import OSD from './ts/osd/main.ts'; +import OSK from './ts/on-screen-keyboard/main.ts'; +import Overview from './ts/overview/main.ts'; +import Powermenu from './ts/powermenu.ts'; +import QSettings from './ts/quick-settings/main.ts'; Setup(); diff --git a/modules/ags/default.nix b/modules/ags/default.nix index 5ecccf9a..1d41f150 100644 --- a/modules/ags/default.nix +++ b/modules/ags/default.nix @@ -4,7 +4,7 @@ pkgs, ... }: let - inherit (config.vars) configDir mainUser; + inherit (config.vars) mainUser hostName; isTouchscreen = config.hardware.sensor.iio.enable; in { services.upower.enable = true; @@ -22,45 +22,56 @@ in { in { programs.ags = { enable = true; - configDir = symlink "${configDir}/ags"; + configDir = symlink /home/${mainUser}/.nix/modules/ags/config; package = ags.packages.${pkgs.system}.default; - extraPackages = with pkgs; [ - libgudev - ]; }; - home.packages = - [config.customPkgs.coloryou] - ++ (with pkgs; [ - # ags - sassc - bun - playerctl + home = { + file = { + ".config/ags/config.js".text = + /* + javascript + */ + '' + import { transpileTypeScript } from './js/utils.js'; - ## gui - pavucontrol # TODO: replace with ags widget - - (writeShellApplication { - name = "updateTypes"; - runtimeInputs = [nodejs_18 typescript git]; - text = '' - if [[ -d /tmp/ags-types ]]; then - rm -r /tmp/ags-types - fi - rm -r ~/.config/ags/types - - git clone https://github.com/Aylur/ags.git /tmp/ags-types - /tmp/ags-types/example/starter-config/setup.sh - - rm -r /tmp/ags-types + export default (await transpileTypeScript("${hostName}")).default; ''; - }) - ]) - ++ (optionals isTouchscreen (with pkgs; [ - lisgd - squeekboard - ydotool - ])); + }; + + packages = + [config.customPkgs.coloryou] + ++ (with pkgs; [ + # ags + sassc + bun + playerctl + + ## gui + pavucontrol # TODO: replace with ags widget + + (writeShellApplication { + name = "updateTypes"; + runtimeInputs = [nodejs_18 typescript git]; + text = '' + if [[ -d /tmp/ags-types ]]; then + rm -r /tmp/ags-types + fi + rm -r ~/.config/ags/types + + git clone https://github.com/Aylur/ags.git /tmp/ags-types + /tmp/ags-types/example/starter-config/setup.sh + + rm -r /tmp/ags-types + ''; + }) + ]) + ++ (optionals isTouchscreen (with pkgs; [ + lisgd + squeekboard + ydotool + ])); + }; }) ]; }