refactor(ags): move wim and binto configs together under modules
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-01-17 19:18:41 -05:00
parent 39f98b657b
commit a0014161ce
108 changed files with 122 additions and 332 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@
*types/
*build/
result*
*config.js

View file

@ -1,3 +0,0 @@
import { transpileTypeScript } from 'file:///home/matt/.nix/devices/wim/config/ags/js/utils.js';
export default (await transpileTypeScript()).default;

Binary file not shown.

View file

@ -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"
}
}

View file

@ -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';

View file

@ -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"
}
}

View file

@ -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

View file

@ -1,4 +0,0 @@
import { transpileTypeScript } from './js/utils.js';
// See ./ts/main.ts for actual code
export default (await transpileTypeScript()).default;

View file

@ -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";

View file

@ -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
}
}

View file

@ -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;

View file

Before

Width:  |  Height:  |  Size: 879 B

After

Width:  |  Height:  |  Size: 879 B

View file

@ -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

View file

@ -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",

View file

@ -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';

View file

@ -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";

View file

@ -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';

View file

@ -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;

View file

@ -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(),
});

View file

@ -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';

View file

@ -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({

Some files were not shown because too many files have changed in this diff Show more