From bac916e223c69f9d7099a69a6842ddf4851ff6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jezer=20Mej=C3=ADa?= Date: Sun, 14 Jul 2024 06:27:24 -0600 Subject: [PATCH] Fix prettier --- .github/workflows/check.yml | 3 --- .prettierignore | 7 +++++++ .prettierrc.js | 6 +++++- README.md | 14 ++++++++++---- package.json | 4 ++-- 5 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 .prettierignore diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b23a31c..25843d8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -98,9 +98,6 @@ jobs: - name: Run Prettier run: npm run prettier - - - name: Run Prettier for themes - run: npm run prettier:themes package-lock: diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..8e49163 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +themes/ +out/ +build/unpacked +build/nody-asar +.github/ +dist/ +*.json diff --git a/.prettierrc.js b/.prettierrc.js index 15efdd0..9e56d87 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,4 +1,8 @@ -module.exports = { +/** + * @see https://prettier.io/docs/en/configuration.html + * @type {import("prettier").Config} + */ +export default { trailingComma: "es5", tabWidth: 2, semi: true, diff --git a/README.md b/README.md index 13c7119..3b4d9b1 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ sudo node make install This will rebuild **electron** along with **node-gtk**, compile typescript with `npx tsc`, and then build the package root directory inside `build/unpacked`. Later, install it with `node make install`. Also, you can package `build/unpacked` to whatever you want, like **.deb** with: + ```sh dpkg-deb --root-owner-group --build unpacked ``` @@ -78,13 +79,15 @@ dpkg-deb --root-owner-group --build unpacked ### Setting up with LightDM Inside `/etc/lightdm/lightdm.conf`, below a Seat configuration, add: + ``` greeter-session=nody-greeter ``` Afterwards, restart the lightdm service. -> ***Note:*** Be sure that nody-greeter works before restarting lightdm +> [!CAUTION] +> Be sure that nody-greeter works before restarting lightdm ## Theme JavaScript API @@ -99,6 +102,7 @@ npm install nody-greeter-types ## Additional features ### Brightness control + `acpi` is the only tool needed to control the brightness, besides a compatible device. This functionality is based on [acpilight][acpilight] replacement for `xbacklight`. udev rules are needed to be applied before using it, check [acpilight rules][acpilight_rules]. Then, lightdm will need to be allowed to change backlight values, to do so add lightdm user to **video** group: `sudo usermod -a -G video lightdm` @@ -106,11 +110,13 @@ udev rules are needed to be applied before using it, check [acpilight rules][acp You can enable it inside `/etc/lightdm/web-greeter.yml` ### Battery status + `acpi` and `acpi_listen` are the only tools you need (and a battery). This functionality is based on ["bat" widget][bat_widget] from ["lain" awesome-wm library][lain]. You can enable it inside `/etc/lightdm/web-greeter.yml`. ## Debugging + You can run the greeter from within your desktop session if you add the following line to the desktop file for your session located in `/usr/share/xsessions/`: `X-LightDM-Allow-Greeter=true`. You have to log out and log back in after adding that line. Then you can run the greeter from command line. @@ -123,7 +129,8 @@ nody-greeter --debug Check `nody-greeter --help` for more commands. -> ***Note:*** Do not use `lightdm --test-mode` as it is not supported. +> [!NOTE] +> Do not use `lightdm --test-mode` as it is not supported. ## Troubleshooting @@ -133,9 +140,8 @@ Check `nody-greeter --help` for more commands. Make sure you are using a [node-gtk][node-gtk] supported Node.js version. - [web-greeter]: https://github.com/JezerM/web-greeter "Web Greeter" -[nody-greeter-types]: https://github.com/JezerM/nody-greeter-types "nody-greeter-types" +[nody-greeter-types]: https://github.com/JezerM/nody-greeter-types "nody-greeter-types" [web-greeter-docs]: https://jezerm.github.io/web-greeter-page/docs/ "API Documentation" [acpilight]: https://gitlab.com/wavexx/acpilight/ "acpilight" [acpilight_rules]: https://gitlab.com/wavexx/acpilight/-/blob/master/90-backlight.rules "udev rules" diff --git a/package.json b/package.json index 7f3015c..0545fea 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "lint:theme:dracula:fix": "eslint \"themes/themes/dracula/ts/**\" --fix", "lint:themes": "npm run lint:theme:gruvbox && npm run lint:theme:dracula", "lint:themes:fix": "npm run lint:theme:gruvbox:fix && npm run lint:theme:dracula:fix", - "prettier": "prettier --check src/", - "prettier:fix": "prettier --write src/", + "prettier": "prettier --check .", + "prettier:fix": "prettier --write .", "prettier:theme:gruvbox": "prettier --check themes/themes/gruvbox/ts/ ", "prettier:theme:gruvbox:fix": "prettier --write themes/themes/gruvbox/ts/", "prettier:theme:dracula": "prettier --check themes/themes/dracula/ts/ ",