From dc410ebf595eee4c07b63290d7c5092163894b31 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 31 Dec 2024 23:54:29 -0500 Subject: [PATCH] feat(ags): init gtk4 migration attempt --- modules/ags/gtk4/.envrc | 1 + modules/ags/gtk4/.gitignore | 3 + modules/ags/gtk4/app.ts | 15 + modules/ags/gtk4/env.d.ts | 21 ++ modules/ags/gtk4/eslint.config.ts | 456 ++++++++++++++++++++++++++ modules/ags/gtk4/package-lock.json | Bin 0 -> 73416 bytes modules/ags/gtk4/package.json | 15 + modules/ags/gtk4/style.scss | 20 ++ modules/ags/gtk4/widget/Bar.tsx | 49 +++ modules/ags/gtk4/widget/styled-box.ts | 34 ++ modules/ags/packages.nix | 62 ++-- 11 files changed, 654 insertions(+), 22 deletions(-) create mode 100644 modules/ags/gtk4/.envrc create mode 100644 modules/ags/gtk4/.gitignore create mode 100644 modules/ags/gtk4/app.ts create mode 100644 modules/ags/gtk4/env.d.ts create mode 100644 modules/ags/gtk4/eslint.config.ts create mode 100644 modules/ags/gtk4/package-lock.json create mode 100644 modules/ags/gtk4/package.json create mode 100644 modules/ags/gtk4/style.scss create mode 100644 modules/ags/gtk4/widget/Bar.tsx create mode 100644 modules/ags/gtk4/widget/styled-box.ts diff --git a/modules/ags/gtk4/.envrc b/modules/ags/gtk4/.envrc new file mode 100644 index 00000000..674cafba --- /dev/null +++ b/modules/ags/gtk4/.envrc @@ -0,0 +1 @@ +use flake "$FLAKE#node" diff --git a/modules/ags/gtk4/.gitignore b/modules/ags/gtk4/.gitignore new file mode 100644 index 00000000..be93e7dc --- /dev/null +++ b/modules/ags/gtk4/.gitignore @@ -0,0 +1,3 @@ +@girs +node_modules +tsconfig.json diff --git a/modules/ags/gtk4/app.ts b/modules/ags/gtk4/app.ts new file mode 100644 index 00000000..85ac427c --- /dev/null +++ b/modules/ags/gtk4/app.ts @@ -0,0 +1,15 @@ +import { App } from 'astal/gtk4'; + +import style from './style.scss'; + +import Bar from './widget/Bar'; + + +App.start({ + css: style, + instanceName: 'gtk4', + + main() { + Bar(); + }, +}); diff --git a/modules/ags/gtk4/env.d.ts b/modules/ags/gtk4/env.d.ts new file mode 100644 index 00000000..467c0a41 --- /dev/null +++ b/modules/ags/gtk4/env.d.ts @@ -0,0 +1,21 @@ +declare const SRC: string + +declare module "inline:*" { + const content: string + export default content +} + +declare module "*.scss" { + const content: string + export default content +} + +declare module "*.blp" { + const content: string + export default content +} + +declare module "*.css" { + const content: string + export default content +} diff --git a/modules/ags/gtk4/eslint.config.ts b/modules/ags/gtk4/eslint.config.ts new file mode 100644 index 00000000..c8613917 --- /dev/null +++ b/modules/ags/gtk4/eslint.config.ts @@ -0,0 +1,456 @@ +import eslint from '@eslint/js'; +import jsdoc from 'eslint-plugin-jsdoc'; +import stylistic from '@stylistic/eslint-plugin'; +import tseslint from 'typescript-eslint'; + + +export default tseslint.config({ + files: ['**/*.{js,ts,tsx}'], + ignores: ['node_modules/**', 'types/**'], + + extends: [ + eslint.configs.recommended, + jsdoc.configs['flat/recommended-typescript'], + stylistic.configs['recommended-flat'], + ...tseslint.configs.recommended, + ...tseslint.configs.stylistic, + ], + + rules: { + // JSDoc settings + 'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }], + 'jsdoc/check-line-alignment': ['warn', 'always', { + tags: ['param', 'arg', 'argument', 'property', 'prop'], + }], + 'jsdoc/no-types': 'off', + + // Newer settings + '@typescript-eslint/no-extraneous-class': ['off'], + '@typescript-eslint/no-implied-eval': ['off'], + 'class-methods-use-this': 'off', + '@stylistic/no-multiple-empty-lines': 'off', + '@stylistic/jsx-indent-props': 'off', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'error', + '@stylistic/indent-binary-ops': 'off', + '@stylistic/max-statements-per-line': [ + 'error', + { max: 2 }, + ], + + // Pre-flat config + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'all', + argsIgnorePattern: '^_', + caughtErrors: 'all', + caughtErrorsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_', + varsIgnorePattern: '^_', + ignoreRestSiblings: true, + }, + ], + + 'array-callback-return': [ + 'error', + { + allowImplicit: true, + checkForEach: true, + }, + ], + 'no-constructor-return': [ + 'error', + ], + 'no-unreachable-loop': [ + 'error', + { + ignore: [ + 'ForInStatement', + 'ForOfStatement', + ], + }, + ], + 'block-scoped-var': [ + '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, + 4, + 5, + 10, + 12, + 33, + 66, + 100, + 255, + 360, + 450, + 500, + 1000, + ], + ignoreDefaultValues: true, + ignoreClassFieldInitialValues: true, + }, + ], + */ + 'no-multi-assign': [ + 'error', + ], + 'no-new-wrappers': [ + 'error', + ], + 'no-object-constructor': [ + 'error', + ], + 'no-proto': [ + 'error', + ], + 'no-return-assign': [ + 'error', + ], + 'no-sequences': [ + 'error', + ], + 'no-shadow': [ + 'error', + { + builtinGlobals: true, + allow: [ + 'Window', + ], + }, + ], + 'no-undef-init': [ + 'warn', + ], + 'no-undefined': [ + 'error', + ], + 'no-useless-constructor': [ + 'warn', + ], + 'no-useless-escape': [ + 'off', + ], + 'no-useless-return': [ + 'error', + ], + 'no-var': [ + 'error', + ], + 'no-void': [ + 'off', + ], + '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-prototype-builtins': 'off', + '@typescript-eslint/no-var-requires': [ + 'off', + ], + '@stylistic/array-bracket-newline': [ + 'warn', + 'consistent', + ], + '@stylistic/array-bracket-spacing': [ + 'warn', + 'never', + ], + '@stylistic/arrow-parens': [ + 'warn', + 'always', + ], + '@stylistic/brace-style': [ + 'warn', + 'stroustrup', + { allowSingleLine: true }, + ], + '@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, + ignoredNodes: ['TemplateLiteral > *'], + }, + ], + '@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: 105, + 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', + ], + }, +}); diff --git a/modules/ags/gtk4/package-lock.json b/modules/ags/gtk4/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..2670ba31b6b01a0c483b7aface048c6e91149164 GIT binary patch literal 73416 zcmeIbX}6+UmMHqYe#IH_@%nZM(pux5e5rtGtjX7f1UsL?ared z{}ueZss);-YMx@1z?|>+yB0Z?7uPrW!+mRhhl%qGz2B4n{r2}L&KxU>Ev0_^#ar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M*5GuTLHA|=G_Y*CV6bG zeMn2s2o*ojJiz{rrhtvQ|+PcgED)B!LCs0JB1R2Pqy{Pv*EcB9vRG?m_j$Z&_FYBp3TzMRxtuGnI5x9Q1C(HG z7G2+wn%QF0F%Hz+cB1uUxWq8OrY?z|xI?CtNFN>tTp-Z={~-_WZ&^Ng>U~xZNyMQJM?umU{qg2WyPP$VscQ+wI|b zi0yld1zNelI33RG(4fxLnIljV;jy+=oyhL!Nlntw0nr@!+HbI+K8k<}v3D#kI#cdX zh`kpJZ}R;zO*Ao!Kif=3Y-MOwHk7Czl}y8ac^ajQ4G16c>Y7%L-+?pgau8LeDsPd|++HkK19Z?*gm}D})aQaVwegJ- zCA2vX_Hz!L;Z9p*tL~7(tZmm~xEuFd@HC4evEhWRiJ{)uERdQvlhPm+w^6sf zTH5w@7<;m4ghRTPZHUlZLUzK?`$Jz^iQNse#C$^v2KktmriUQ4TPl7ro1>mtEcW$s@P7U!7TUhLDrU zdk=Y0b5?m~Nt5K9zk_7Cq+HX1|#hziv zY(g_gu(TKcGGN7pjI_g*!tkh&N*LD0l*eRpBQ97G2`^RwUN>UjN5!#0yCg*_x{Mbv z05UGFfYS)%N>#lRF6?L*c|4`|>%Q4l@VzlkGoI8;joL>RHzeJC!qnrsJ6de}S~^Zf zuxoLFz)q~GAq*%^+jHnpYjqZq5k~~;^6SQL3#9yvxl}TOUOuX&;KTp;xBvLJ{|}VG B@!|jg literal 0 HcmV?d00001 diff --git a/modules/ags/gtk4/package.json b/modules/ags/gtk4/package.json new file mode 100644 index 00000000..3c89ae93 --- /dev/null +++ b/modules/ags/gtk4/package.json @@ -0,0 +1,15 @@ +{ + "name": "ags", + "version": "0.0.0", + "main": "app.ts", + "dependencies": { + "@eslint/js": "9.17.0", + "@stylistic/eslint-plugin": "2.12.1", + "@types/node": "22.10.2", + "eslint": "9.17.0", + "eslint-plugin-jsdoc": "50.6.1", + "fzf": "0.5.2", + "jiti": "2.4.2", + "typescript-eslint": "8.19.0" + } +} diff --git a/modules/ags/gtk4/style.scss b/modules/ags/gtk4/style.scss new file mode 100644 index 00000000..1d0d3a9f --- /dev/null +++ b/modules/ags/gtk4/style.scss @@ -0,0 +1,20 @@ +// https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/theme/Adwaita/_colors-public.scss +$fg-color: #{"@theme_fg_color"}; +$bg-color: #{"@theme_bg_color"}; + +window.Bar { + background: transparent; + color: $fg-color; + font-weight: bold; + + >centerbox { + background: $bg-color; + border-radius: 10px; + margin: 8px; + } + + button { + border-radius: 8px; + margin: 2px; + } +} diff --git a/modules/ags/gtk4/widget/Bar.tsx b/modules/ags/gtk4/widget/Bar.tsx new file mode 100644 index 00000000..dc39b8e2 --- /dev/null +++ b/modules/ags/gtk4/widget/Bar.tsx @@ -0,0 +1,49 @@ +import { App, Astal, Gtk } from 'astal/gtk4'; +import { Variable } from 'astal'; + +import { StyledBox } from './styled-box'; + +const { EXCLUSIVE } = Astal.Exclusivity; +const { TOP, LEFT, RIGHT } = Astal.WindowAnchor; +const { CENTER } = Gtk.Align; + + +const time = Variable(0); + +setInterval(() => { + time.set(time.get() + 1); +}, 1000); + +export default () => { + const styledBox = ( + `* { background: red; min-height: 10px; min-width: ${t}px; }`)} + /> + ) as StyledBox; + + return ( + + + + + {styledBox} + + + + + + ); +}; diff --git a/modules/ags/gtk4/widget/styled-box.ts b/modules/ags/gtk4/widget/styled-box.ts new file mode 100644 index 00000000..20452186 --- /dev/null +++ b/modules/ags/gtk4/widget/styled-box.ts @@ -0,0 +1,34 @@ +import { astalify, Gtk } from 'astal/gtk4'; +import { property, register } from 'astal'; + + +@register({ GTypeName: 'StyledBox' }) +class StyledBoxClass extends Gtk.Box { + declare private _css: string | undefined; + declare private _provider: Gtk.CssProvider | undefined; + + @property(String) + get css(): string | undefined { + return this._css; + } + + set css(value: string) { + if (!this._provider) { + this._provider = new Gtk.CssProvider(); + + this.get_style_context().add_provider( + this._provider, + Gtk.STYLE_PROVIDER_PRIORITY_USER, + ); + } + + this._css = value; + this._provider.load_from_string(value); + } +} + +export type StyledBox = StyledBoxClass; +export const StyledBox = astalify< + StyledBoxClass, + Gtk.Box.ConstructorProps & { css: string } +>(StyledBoxClass); diff --git a/modules/ags/packages.nix b/modules/ags/packages.nix index ff2a5560..7e8fb9a5 100644 --- a/modules/ags/packages.nix +++ b/modules/ags/packages.nix @@ -15,6 +15,7 @@ self: { cfg = config.programs.ags; cfgDesktop = osConfig.roles.desktop; + gtk4ConfigDir = "${cfg.configDir}/../gtk4"; mainPkg = pkgs.writeShellApplication { name = "ags"; @@ -79,6 +80,13 @@ in { packages = [ mainPkg + (pkgs.writeShellApplication { + name = "ags4"; + runtimeInputs = [cfg.package]; + text = '' + exec ags run ~/${gtk4ConfigDir}/app.ts --gtk4 + ''; + }) (pkgs.writeShellApplication { name = "agsConf"; runtimeInputs = [cfg.package]; @@ -108,38 +116,48 @@ in { buildNodeModules buildGirTypes ; + + mkTsConf = gtkVer: let + inherit (ags.packages.${pkgs.system}) gjs; + in + pkgs.writers.writeJSON "tsconfig.json" { + "$schema" = "https://json.schemastore.org/tsconfig"; + "compilerOptions" = { + "experimentalDecorators" = true; + "strict" = true; + "target" = "ES2022"; + "module" = "ES2022"; + "moduleResolution" = "Bundler"; + "noEmit" = true; + "jsx" = "react-jsx"; + "jsxImportSource" = "${gjs}/share/astal/gjs/gtk${toString gtkVer}"; + "paths" = { + "astal" = ["${gjs}/share/astal/gjs"]; + "astal/*" = ["${gjs}/share/astal/gjs/*"]; + }; + }; + }; in ( (buildGirTypes { pname = "ags"; configPath = "${cfg.configDir}/@girs"; packages = cfg.astalLibs; }) + // (buildGirTypes { + pname = "ags"; + configPath = "${gtk4ConfigDir}/@girs"; + packages = cfg.astalLibs; + }) // { "${cfg.configDir}/node_modules".source = buildNodeModules ./config (import ./config).npmDepsHash; - "${cfg.configDir}/tsconfig.json".source = let - inherit (ags.packages.${pkgs.system}) gjs; - in - pkgs.writers.writeJSON "tsconfig.json" { - "$schema" = "https://json.schemastore.org/tsconfig"; - "compilerOptions" = { - "experimentalDecorators" = true; - "strict" = true; - "target" = "ES2023"; - "moduleResolution" = "Bundler"; - "jsx" = "react-jsx"; - "jsxImportSource" = "${gjs}/share/astal/gjs/gtk3"; - "paths" = { - "astal" = ["${gjs}/share/astal/gjs"]; - "astal/*" = ["${gjs}/share/astal/gjs/*"]; - }; - "skipLibCheck" = true; - "module" = "ES2022"; - "lib" = ["ES2023"]; - "noEmit" = true; - }; - }; + "${gtk4ConfigDir}/node_modules".source = + buildNodeModules ./config (import ./config).npmDepsHash; + + "${cfg.configDir}/tsconfig.json".source = mkTsConf 3; + + "${gtk4ConfigDir}/tsconfig.json".source = mkTsConf 4; "${cfg.configDir}/widgets/lockscreen/vars.ts".text = # javascript