From b0ed3dfd16a9c61cb5d835adbea1e93c267b75ff Mon Sep 17 00:00:00 2001 From: Ry2X <45420571+ry2x@users.noreply.github.com> Date: Tue, 11 Aug 2026 19:02:18 +0900 Subject: [PATCH] refactor: separate source and runtime layout --- .envrc | 8 + .gitignore | 5 +- README.md | 36 ++-- .../config.json.template | 0 debug/run-memory-scenarios.sh | 14 +- eslint.config.mjs | 194 +++++++++--------- knip.json | 2 +- launch.sh | 17 -- package.json | 7 +- scripts/build.sh | 10 + scripts/deploy-user.sh | 45 ++++ scripts/dev.sh | 25 +++ app.ts => src/app.ts | 10 +- env.d.ts => src/env.d.ts | 0 requestHandler.ts => src/ipc.ts | 0 {lib => src/lib}/config.ts | 5 +- {lib => src/lib}/css.ts | 48 +++-- {lib => src/lib}/image.ts | 0 {lib => src/lib}/motion.ts | 0 {lib => src/lib}/notification.ts | 5 +- {lib => src/lib}/paths.ts | 12 ++ {stores => src/stores}/application.ts | 0 {stores => src/stores}/audio.ts | 0 {stores => src/stores}/brightness.ts | 0 {stores => src/stores}/caffeine.ts | 0 {stores => src/stores}/launcherImage.ts | 9 +- {stores => src/stores}/mprisThumbnail.ts | 0 {stores => src/stores}/network.ts | 0 {stores => src/stores}/notification.ts | 0 {stores => src/stores}/powerProfile.ts | 0 {stores => src/stores}/recording.ts | 0 {stores => src/stores}/system.ts | 0 {stores => src/stores}/time.ts | 0 {stores => src/stores}/update.ts | 0 {stores => src/stores}/wallpaper.ts | 0 {stores => src/stores}/weather.ts | 0 {stores => src/stores}/wifi.ts | 0 {stores => src/stores}/wifiPasswordDialog.ts | 0 {stores => src/stores}/windowManager.ts | 0 {widget => src/widget}/app-launcher/index.tsx | 0 .../widget}/app-launcher/widget/AppItem.ts | 0 .../widget}/app-launcher/widget/AppList.tsx | 0 .../app-launcher/widget/SearchGoogleBtn.tsx | 0 .../app-launcher/widget/SearchInput.tsx | 0 {widget => src/widget}/bar/BarReserve.tsx | 0 .../widget}/bar/PanelBackground.tsx | 9 +- {widget => src/widget}/bar/index.tsx | 0 {widget => src/widget}/bar/widget/Clock.tsx | 0 .../widget}/bar/widget/RecordIndicator.tsx | 0 .../widget}/bar/widget/ScrollerIndicator.tsx | 0 .../widget}/bar/widget/SysMetrics.tsx | 0 {widget => src/widget}/bar/widget/Tray.tsx | 0 {widget => src/widget}/bar/widget/Updates.tsx | 0 {widget => src/widget}/bar/widget/Volume.tsx | 0 {widget => src/widget}/bar/widget/Weather.tsx | 0 .../widget}/bar/widget/Workspaces.tsx | 0 .../widget}/common/AnimatedList.tsx | 0 .../widget}/common/CircularProgress.tsx | 0 .../widget}/common/NotificationCard.tsx | 0 {widget => src/widget}/common/lucide.tsx | 0 .../widget}/control-center/index.tsx | 0 .../widget/BrightnessSlider.tsx | 0 .../widget/Connectivity/BluetoothPage.tsx | 0 .../widget/Connectivity/Shared.tsx | 0 .../widget/Connectivity/WifiPage.tsx | 0 .../Connectivity/WifiPasswordDialog.tsx | 0 .../widget/Connectivity/index.tsx | 0 .../widget/MediaCard/CavaWidget.tsx | 0 .../widget/MediaCard/PlayerCard.tsx | 0 .../control-center/widget/MediaCard/index.tsx | 0 .../control-center/widget/QuickToggles.tsx | 0 .../control-center/widget/ScreenCapture.tsx | 0 .../widget/Sound/DeviceSelector.tsx | 0 .../control-center/widget/Sound/SoundPage.tsx | 0 .../control-center/widget/Sound/index.tsx | 0 .../control-center/widget/SystemMetrics.tsx | 0 .../control-center/widget/UpdatesCard.tsx | 0 .../control-center/widget/VolumeSlider.tsx | 0 {widget => src/widget}/date-weather/index.tsx | 0 .../widget}/date-weather/widget/ClockCard.tsx | 0 .../date-weather/widget/NotificationList.tsx | 0 .../date-weather/widget/ProfileCard.tsx | 0 .../date-weather/widget/WeatherCard.tsx | 0 .../date-weather/widget/WorldClockCard.tsx | 0 .../widget}/notification-popups/index.tsx | 0 .../widget}/wallpaper-selector/index.tsx | 0 .../wallpaper-selector/widget/CoverFlow.tsx | 0 .../widget/WallpaperCard.ts | 0 styles/default/theme.scss | 51 +++++ {scss => styles/scss}/_applauncher.scss | 0 {scss => styles/scss}/_bar.scss | 0 {scss => styles/scss}/_connectivity.scss | 0 {scss => styles/scss}/_control_center.scss | 0 {scss => styles/scss}/_date_weather.scss | 0 {scss => styles/scss}/_notifications.scss | 0 {scss => styles/scss}/_sound.scss | 0 {scss => styles/scss}/_variables.scss | 4 +- .../scss}/_wallpaper_selector.scss | 0 style.scss => styles/style.scss | 0 99 files changed, 342 insertions(+), 174 deletions(-) create mode 100644 .envrc rename config.json.template => config/config.json.template (100%) delete mode 100755 launch.sh create mode 100755 scripts/build.sh create mode 100755 scripts/deploy-user.sh create mode 100755 scripts/dev.sh rename app.ts => src/app.ts (79%) rename env.d.ts => src/env.d.ts (100%) rename requestHandler.ts => src/ipc.ts (100%) rename {lib => src/lib}/config.ts (93%) rename {lib => src/lib}/css.ts (61%) rename {lib => src/lib}/image.ts (100%) rename {lib => src/lib}/motion.ts (100%) rename {lib => src/lib}/notification.ts (80%) rename {lib => src/lib}/paths.ts (70%) rename {stores => src/stores}/application.ts (100%) rename {stores => src/stores}/audio.ts (100%) rename {stores => src/stores}/brightness.ts (100%) rename {stores => src/stores}/caffeine.ts (100%) rename {stores => src/stores}/launcherImage.ts (72%) rename {stores => src/stores}/mprisThumbnail.ts (100%) rename {stores => src/stores}/network.ts (100%) rename {stores => src/stores}/notification.ts (100%) rename {stores => src/stores}/powerProfile.ts (100%) rename {stores => src/stores}/recording.ts (100%) rename {stores => src/stores}/system.ts (100%) rename {stores => src/stores}/time.ts (100%) rename {stores => src/stores}/update.ts (100%) rename {stores => src/stores}/wallpaper.ts (100%) rename {stores => src/stores}/weather.ts (100%) rename {stores => src/stores}/wifi.ts (100%) rename {stores => src/stores}/wifiPasswordDialog.ts (100%) rename {stores => src/stores}/windowManager.ts (100%) rename {widget => src/widget}/app-launcher/index.tsx (100%) rename {widget => src/widget}/app-launcher/widget/AppItem.ts (100%) rename {widget => src/widget}/app-launcher/widget/AppList.tsx (100%) rename {widget => src/widget}/app-launcher/widget/SearchGoogleBtn.tsx (100%) rename {widget => src/widget}/app-launcher/widget/SearchInput.tsx (100%) rename {widget => src/widget}/bar/BarReserve.tsx (100%) rename {widget => src/widget}/bar/PanelBackground.tsx (94%) rename {widget => src/widget}/bar/index.tsx (100%) rename {widget => src/widget}/bar/widget/Clock.tsx (100%) rename {widget => src/widget}/bar/widget/RecordIndicator.tsx (100%) rename {widget => src/widget}/bar/widget/ScrollerIndicator.tsx (100%) rename {widget => src/widget}/bar/widget/SysMetrics.tsx (100%) rename {widget => src/widget}/bar/widget/Tray.tsx (100%) rename {widget => src/widget}/bar/widget/Updates.tsx (100%) rename {widget => src/widget}/bar/widget/Volume.tsx (100%) rename {widget => src/widget}/bar/widget/Weather.tsx (100%) rename {widget => src/widget}/bar/widget/Workspaces.tsx (100%) rename {widget => src/widget}/common/AnimatedList.tsx (100%) rename {widget => src/widget}/common/CircularProgress.tsx (100%) rename {widget => src/widget}/common/NotificationCard.tsx (100%) rename {widget => src/widget}/common/lucide.tsx (100%) rename {widget => src/widget}/control-center/index.tsx (100%) rename {widget => src/widget}/control-center/widget/BrightnessSlider.tsx (100%) rename {widget => src/widget}/control-center/widget/Connectivity/BluetoothPage.tsx (100%) rename {widget => src/widget}/control-center/widget/Connectivity/Shared.tsx (100%) rename {widget => src/widget}/control-center/widget/Connectivity/WifiPage.tsx (100%) rename {widget => src/widget}/control-center/widget/Connectivity/WifiPasswordDialog.tsx (100%) rename {widget => src/widget}/control-center/widget/Connectivity/index.tsx (100%) rename {widget => src/widget}/control-center/widget/MediaCard/CavaWidget.tsx (100%) rename {widget => src/widget}/control-center/widget/MediaCard/PlayerCard.tsx (100%) rename {widget => src/widget}/control-center/widget/MediaCard/index.tsx (100%) rename {widget => src/widget}/control-center/widget/QuickToggles.tsx (100%) rename {widget => src/widget}/control-center/widget/ScreenCapture.tsx (100%) rename {widget => src/widget}/control-center/widget/Sound/DeviceSelector.tsx (100%) rename {widget => src/widget}/control-center/widget/Sound/SoundPage.tsx (100%) rename {widget => src/widget}/control-center/widget/Sound/index.tsx (100%) rename {widget => src/widget}/control-center/widget/SystemMetrics.tsx (100%) rename {widget => src/widget}/control-center/widget/UpdatesCard.tsx (100%) rename {widget => src/widget}/control-center/widget/VolumeSlider.tsx (100%) rename {widget => src/widget}/date-weather/index.tsx (100%) rename {widget => src/widget}/date-weather/widget/ClockCard.tsx (100%) rename {widget => src/widget}/date-weather/widget/NotificationList.tsx (100%) rename {widget => src/widget}/date-weather/widget/ProfileCard.tsx (100%) rename {widget => src/widget}/date-weather/widget/WeatherCard.tsx (100%) rename {widget => src/widget}/date-weather/widget/WorldClockCard.tsx (100%) rename {widget => src/widget}/notification-popups/index.tsx (100%) rename {widget => src/widget}/wallpaper-selector/index.tsx (100%) rename {widget => src/widget}/wallpaper-selector/widget/CoverFlow.tsx (100%) rename {widget => src/widget}/wallpaper-selector/widget/WallpaperCard.ts (100%) create mode 100644 styles/default/theme.scss rename {scss => styles/scss}/_applauncher.scss (100%) rename {scss => styles/scss}/_bar.scss (100%) rename {scss => styles/scss}/_connectivity.scss (100%) rename {scss => styles/scss}/_control_center.scss (100%) rename {scss => styles/scss}/_date_weather.scss (100%) rename {scss => styles/scss}/_notifications.scss (100%) rename {scss => styles/scss}/_sound.scss (100%) rename {scss => styles/scss}/_variables.scss (89%) rename {scss => styles/scss}/_wallpaper_selector.scss (100%) rename style.scss => styles/style.scss (100%) diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3082a58 --- /dev/null +++ b/.envrc @@ -0,0 +1,8 @@ +export RYSTAL_SHELL_CONFIG_DIR="$PWD/.dev/config" +export RYSTAL_SHELL_DATA_DIR="$PWD" +export RYSTAL_SHELL_INSTANCE="rystal-shell-dev" +export RYPRLAND_CACHE_DIR="$PWD/.dev/cache" +export RYPRLAND_STATE_DIR="$PWD/.dev/state" +export RYPRLAND_RUNTIME_DIR="$PWD/.dev/runtime" + +PATH_add node_modules/.bin diff --git a/.gitignore b/.gitignore index 1529f04..e08b5c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,15 @@ node_modules/ +.generated/ @girs/ - -themes/matugen.scss +.dev/ config.json assets/launcher_bg*.png assets/icons/hicolor/icon-theme.cache +dist/ start-ags oneshot/style.css diff --git a/README.md b/README.md index fce4be9..770b9de 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ https://github.com/user-attachments/assets/8cb65a27-2284-4302-b0b1-8c1be2ef4631 ## Requirements -When you install Ryprland, this repository is cloned as a submodule and included in the Ryprland configuration. -So, you don't need to install it separately. +When you install Ryprland, this repository is cloned as a submodule and deployed by the +Ryprland configuration. The source tree is separate from the runtime installation. If you want to use this shell in your own configuration, you can clone this repository and use it as a part of your configuration. @@ -24,19 +24,21 @@ If you want to use this shell in your own configuration, you can clone this repo paru -S aylurs-gtk-shell-git libastal-meta ``` -### How to Start +### Build, Deploy, and Start These are pre-configured in Ryprland's configuration, so normally you don't need to start it manually. -Make sure you have created a `~/.config/ags` directory and copied the contents of this repository into it. - -Run the following command to start the shell: +Build and deploy the runtime bundle, static assets, and styles to +`${XDG_DATA_HOME:-$HOME/.local/share}/rystal-shell`: ```sh -cd ~/.config/ags -./launch.sh +pnpm install +pnpm deploy:user ``` +Place user configuration in `${XDG_CONFIG_HOME:-$HOME/.config}/rystal-shell`, then start the +deployed shell through the `rystal-shell` launcher supplied by Ryprland-dot. + In practice, it relies on Hyprland's autostart capabilities. When doing so, you need to account for the lag associated with loading the modules. Therefore, you must introduce a startup delay as shown below: @@ -45,7 +47,7 @@ Therefore, you must introduce a startup delay as shown below: -- hyprland.lua hl.on("hyprland.start", function() - hl.exec_cmd("sleep 5; ~/.config/ags/launch.sh") + hl.exec_cmd("sleep 5; rystal-shell") hl.exec_cmd("sleep 10; blueman-applet") end ) @@ -55,10 +57,12 @@ hl.on("hyprland.start", There are several configurable items in this shell. -First, copy the [config template](./config.json.template) using the following command: +First, copy the [config template](./config/config.json.template): ```sh -cp ./config.json.template ./config.json +mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/rystal-shell" +cp ./config/config.json.template \ + "${XDG_CONFIG_HOME:-$HOME/.config}/rystal-shell/config.json" ``` By modifying each setting in that file, you can alter the shell's behavior and some of the displayed information. @@ -103,14 +107,16 @@ Rystal-shell uses subdirectories below these roots for wallpaper thumbnails, media artwork, application history, compiled CSS, and Caffeine state. The same roots are also used by Ryprland's theme-switching scripts. -## Development Note +## Development + +`pnpm dev` starts the `rystal-shell-dev` AGS instance with config, cache, state, and runtime +data isolated below `.dev/`. Optionally run `direnv allow` to load the same environment while +working in the repository. Run the static checks before submitting changes: ```sh -pnpm lint -pnpm knip -pnpm tsc +pnpm check pnpm build ``` diff --git a/config.json.template b/config/config.json.template similarity index 100% rename from config.json.template rename to config/config.json.template diff --git a/debug/run-memory-scenarios.sh b/debug/run-memory-scenarios.sh index 1a42804..d34705a 100755 --- a/debug/run-memory-scenarios.sh +++ b/debug/run-memory-scenarios.sh @@ -5,6 +5,8 @@ set -euo pipefail SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) ROOT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd) COLLECTOR="$SCRIPT_DIR/collect-memory.sh" +AGS_INSTANCE="${RYSTAL_SHELL_INSTANCE:-rystal-shell-dev}" +export RYSTAL_SHELL_INSTANCE="$AGS_INSTANCE" usage() { cat <<'EOF' @@ -103,9 +105,9 @@ snapshot() { ags_request() { if "$dry_run"; then - printf '+ ags request %q\n' "$1" + printf '+ ags request -i %q %q\n' "$AGS_INSTANCE" "$1" else - ags request "$1" + ags request -i "$AGS_INSTANCE" "$1" fi } @@ -119,17 +121,17 @@ randomize_theme() { stop_ags() { if "$dry_run"; then - printf '+ killall gjs ags\n' + printf '+ ags quit -i %q\n' "$AGS_INSTANCE" else - killall gjs ags >/dev/null 2>&1 || true + ags quit -i "$AGS_INSTANCE" >/dev/null 2>&1 || true fi } start_ags() { if "$dry_run"; then - printf '+ ags run\n' + printf '+ %q/scripts/dev.sh\n' "$ROOT_DIR" else - ags run >/dev/null 2>&1 & + "$ROOT_DIR/scripts/dev.sh" >/dev/null 2>&1 & fi wait_for_settle "$settle_seconds" } diff --git a/eslint.config.mjs b/eslint.config.mjs index 9f3e958..2a56dc7 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,63 +1,63 @@ -import eslint from "@eslint/js" -import tseslint from "typescript-eslint" -import prettierConfig from "eslint-config-prettier" +import eslint from '@eslint/js'; +import prettierConfig from 'eslint-config-prettier'; +import tseslint from 'typescript-eslint'; export default tseslint.config( eslint.configs.recommended, ...tseslint.configs.recommended, prettierConfig, { - ignores: ["node_modules/", "dist/", "@girs/"], + ignores: ['node_modules/', 'dist/', '.generated/', '@girs/'], }, { languageOptions: { globals: { - ARGV: "readonly", - Debugger: "readonly", - GIRepositoryGType: "readonly", - globalThis: "readonly", - imports: "readonly", - Intl: "readonly", - log: "readonly", - logError: "readonly", - pkg: "readonly", - print: "readonly", - printerr: "readonly", - window: "readonly", - TextEncoder: "readonly", - TextDecoder: "readonly", - console: "readonly", - setTimeout: "readonly", - setInterval: "readonly", - clearTimeout: "readonly", - clearInterval: "readonly", + ARGV: 'readonly', + Debugger: 'readonly', + GIRepositoryGType: 'readonly', + globalThis: 'readonly', + imports: 'readonly', + Intl: 'readonly', + log: 'readonly', + logError: 'readonly', + pkg: 'readonly', + print: 'readonly', + printerr: 'readonly', + window: 'readonly', + TextEncoder: 'readonly', + TextDecoder: 'readonly', + console: 'readonly', + setTimeout: 'readonly', + setInterval: 'readonly', + clearTimeout: 'readonly', + clearInterval: 'readonly', // GNOME Shell Only - global: "readonly", - _: "readonly", - C_: "readonly", - N_: "readonly", - ngettext: "readonly", + global: 'readonly', + _: 'readonly', + C_: 'readonly', + N_: 'readonly', + ngettext: 'readonly', }, parserOptions: { ecmaVersion: 2022, - sourceType: "module", + sourceType: 'module', }, }, rules: { // See: https://eslint.org/docs/latest/rules/#possible-problems - "array-callback-return": "error", - "no-await-in-loop": "error", - "no-constant-binary-expression": "error", - "no-constructor-return": "error", - "no-new-native-nonconstructor": "error", - "no-promise-executor-return": "error", - "no-self-compare": "error", - "no-template-curly-in-string": "error", - "no-unmodified-loop-condition": "error", - "no-unreachable-loop": "error", - "no-unused-private-class-members": "error", - "no-use-before-define": [ - "error", + 'array-callback-return': 'error', + 'no-await-in-loop': 'error', + 'no-constant-binary-expression': 'error', + 'no-constructor-return': 'error', + 'no-new-native-nonconstructor': 'error', + 'no-promise-executor-return': 'error', + 'no-self-compare': 'error', + 'no-template-curly-in-string': 'error', + 'no-unmodified-loop-condition': 'error', + 'no-unreachable-loop': 'error', + 'no-unused-private-class-members': 'error', + 'no-use-before-define': [ + 'error', { functions: false, classes: true, @@ -66,89 +66,89 @@ export default tseslint.config( }, ], // See: https://eslint.org/docs/latest/rules/#suggestions - "block-scoped-var": "error", - complexity: "warn", - "consistent-return": "error", - "default-param-last": "error", - eqeqeq: "error", - "no-array-constructor": "error", - "no-caller": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-extra-label": "error", - "no-iterator": "error", - "no-label-var": "error", - "no-loop-func": "error", - "no-multi-assign": "warn", - "no-new-object": "error", - "no-new-wrappers": "error", - "no-proto": "error", - "no-shadow": "warn", - "@typescript-eslint/no-unused-vars": [ - "error", + 'block-scoped-var': 'error', + 'complexity': 'warn', + 'consistent-return': 'error', + 'default-param-last': 'error', + 'eqeqeq': 'error', + 'no-array-constructor': 'error', + 'no-caller': 'error', + 'no-extend-native': 'error', + 'no-extra-bind': 'error', + 'no-extra-label': 'error', + 'no-iterator': 'error', + 'no-label-var': 'error', + 'no-loop-func': 'error', + 'no-multi-assign': 'warn', + 'no-new-object': 'error', + 'no-new-wrappers': 'error', + 'no-proto': 'error', + 'no-shadow': 'warn', + '@typescript-eslint/no-unused-vars': [ + 'error', { - varsIgnorePattern: "^_", - argsIgnorePattern: "^_", + varsIgnorePattern: '^_', + argsIgnorePattern: '^_', }, ], - "no-var": "warn", - "unicode-bom": "error", + 'no-var': 'warn', + 'unicode-bom': 'error', // GJS Restrictions - "no-restricted-globals": [ - "error", + 'no-restricted-globals': [ + 'error', { - name: "Debugger", - message: "Internal use only", + name: 'Debugger', + message: 'Internal use only', }, { - name: "GIRepositoryGType", - message: "Internal use only", + name: 'GIRepositoryGType', + message: 'Internal use only', }, { - name: "log", - message: "Use console.log()", + name: 'log', + message: 'Use console.log()', }, { - name: "logError", - message: "Use console.warn() or console.error()", + name: 'logError', + message: 'Use console.warn() or console.error()', }, ], - "no-restricted-properties": [ - "error", + 'no-restricted-properties': [ + 'error', { - object: "imports", - property: "format", - message: "Use template strings", + object: 'imports', + property: 'format', + message: 'Use template strings', }, { - object: "pkg", - property: "initFormat", - message: "Use template strings", + object: 'pkg', + property: 'initFormat', + message: 'Use template strings', }, { - object: "Lang", - property: "copyProperties", - message: "Use Object.assign()", + object: 'Lang', + property: 'copyProperties', + message: 'Use Object.assign()', }, { - object: "Lang", - property: "bind", - message: "Use arrow notation or Function.prototype.bind()", + object: 'Lang', + property: 'bind', + message: 'Use arrow notation or Function.prototype.bind()', }, { - object: "Lang", - property: "Class", - message: "Use ES6 classes", + object: 'Lang', + property: 'Class', + message: 'Use ES6 classes', }, ], - "no-restricted-syntax": [ - "error", + 'no-restricted-syntax': [ + 'error', { selector: 'MethodDefinition[key.name="_init"] CallExpression[arguments.length<=1][callee.object.type="Super"][callee.property.name="_init"]', - message: "Use constructor() and super()", + message: 'Use constructor() and super()', }, ], }, }, -) +); diff --git a/knip.json b/knip.json index de5a86b..fe44e95 100644 --- a/knip.json +++ b/knip.json @@ -1,7 +1,7 @@ { "$schema": "https://unpkg.com/knip@6/schema.json", "tags": ["-lintignore"], - "entry": ["app.ts"], + "entry": ["src/app.ts"], "ignoreDependencies": ["gi", "system"], "ignoreBinaries": ["ags"] } diff --git a/launch.sh b/launch.sh deleted file mode 100755 index 1b89914..0000000 --- a/launch.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Get the directory where this script is located -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "$DIR" || exit 1 - -# Check if start-ags exists -if [ ! -f "start-ags" ]; then - echo "start-ags not found. Bundling AGS entrypoint..." - ags bundle app.ts start-ags -fi - -# Prefer Vulkan for normal use while allowing per-launch renderer overrides. -export GSK_RENDERER="${GSK_RENDERER:-vulkan}" - -# Execute start-ags with any passed arguments -exec ./start-ags "$@" diff --git a/package.json b/package.json index f0db13f..fab743c 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,15 @@ "typescript-eslint": "^8.62.0" }, "scripts": { - "generate-type": "ags types", + "generate-type": "ags types -d .generated/types", "lint": "eslint .", "format": "prettier --write \"./**/*.{js,ts,tsx,json,css,scss,md,html}\" \"./*.{js,ts,tsx,json}\"", "tsc": "tsc --noEmit", "knip": "knip", - "build": "ags bundle app.ts start-ags" + "check": "pnpm lint && pnpm knip && pnpm tsc", + "build": "./scripts/build.sh", + "dev": "./scripts/dev.sh", + "deploy:user": "./scripts/deploy-user.sh" }, "name": "rystal-shell", "license": "GPL-3.0-or-later", diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..4a13f05 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$repo_dir" + +mkdir -p dist +ags bundle src/app.ts dist/start-ags --root "$repo_dir" +sass --load-path styles/default styles/style.scss dist/default.css diff --git a/scripts/deploy-user.sh b/scripts/deploy-user.sh new file mode 100755 index 0000000..82e255f --- /dev/null +++ b/scripts/deploy-user.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +data_home="${XDG_DATA_HOME:-$HOME/.local/share}" +target="$data_home/rystal-shell" +backup="$data_home/rystal-shell.previous" + +case "$target" in + */rystal-shell) ;; + *) + printf 'Refusing unexpected deployment target: %s\n' "$target" >&2 + exit 1 + ;; +esac + +cd "$repo_dir" +"$repo_dir/scripts/build.sh" + +mkdir -p "$data_home" +stage="$(mktemp -d "$data_home/.rystal-shell.stage.XXXXXX")" +trap 'rm -rf -- "$stage"' EXIT + +install -Dm755 dist/start-ags "$stage/start-ags" +install -Dm644 dist/default.css "$stage/styles/default.css" +cp -a assets "$stage/assets" +cp -a styles/. "$stage/styles/" +rm -f -- "$stage"/assets/launcher_bg*.png +rm -f -- "$stage/assets/icons/hicolor/icon-theme.cache" + +rm -rf -- "$backup" +if [[ -e "$target" || -L "$target" ]]; then + mv -- "$target" "$backup" +fi + +if ! mv -- "$stage" "$target"; then + if [[ -e "$backup" || -L "$backup" ]]; then + mv -- "$backup" "$target" + fi + exit 1 +fi + +trap - EXIT +printf 'Deployed Rystal-shell to %s\n' "$target" diff --git a/scripts/dev.sh b/scripts/dev.sh new file mode 100755 index 0000000..cd34f10 --- /dev/null +++ b/scripts/dev.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +dev_dir="$repo_dir/.dev" + +export RYSTAL_SHELL_CONFIG_DIR="${RYSTAL_SHELL_CONFIG_DIR:-$dev_dir/config}" +export RYSTAL_SHELL_DATA_DIR="${RYSTAL_SHELL_DATA_DIR:-$repo_dir}" +export RYSTAL_SHELL_INSTANCE="${RYSTAL_SHELL_INSTANCE:-rystal-shell-dev}" +export RYPRLAND_CACHE_DIR="${RYPRLAND_CACHE_DIR:-$dev_dir/cache}" +export RYPRLAND_STATE_DIR="${RYPRLAND_STATE_DIR:-$dev_dir/state}" +export RYPRLAND_RUNTIME_DIR="${RYPRLAND_RUNTIME_DIR:-$dev_dir/runtime}" + +mkdir -p \ + "$RYSTAL_SHELL_CONFIG_DIR" \ + "$RYPRLAND_CACHE_DIR" \ + "$RYPRLAND_STATE_DIR" \ + "$RYPRLAND_RUNTIME_DIR" + +if [[ ! -e "$RYSTAL_SHELL_CONFIG_DIR/config.json" ]]; then + cp "$repo_dir/config/config.json.template" "$RYSTAL_SHELL_CONFIG_DIR/config.json" +fi + +exec ags run "$repo_dir/src/app.ts" "$@" diff --git a/app.ts b/src/app.ts similarity index 79% rename from app.ts rename to src/app.ts index 7ae2436..be316d0 100644 --- a/app.ts +++ b/src/app.ts @@ -1,10 +1,9 @@ import { Gdk, Gtk } from 'ags/gtk4'; import app from 'ags/gtk4/app'; -import GLib from 'gi://GLib'; - +import { requestHandler } from './ipc'; import { initCss } from './lib/css'; -import { requestHandler } from './requestHandler'; +import { rystalShellDataDir, rystalShellInstance } from './lib/paths'; import AppLauncher from './widget/app-launcher'; import Bar from './widget/bar'; import ControlCenter from './widget/control-center'; @@ -14,6 +13,7 @@ import NotificationPopups from './widget/notification-popups'; import WallpaperSelector from './widget/wallpaper-selector'; app.start({ + instanceName: rystalShellInstance, requestHandler, main() { initCss(); @@ -21,9 +21,7 @@ app.start({ // Add lucide symbolic icons to GTK Icon Theme search path const display = Gdk.Display.get_default(); if (display) { - Gtk.IconTheme.get_for_display(display).add_search_path( - `${GLib.get_user_config_dir()}/ags/assets/icons`, - ); + Gtk.IconTheme.get_for_display(display).add_search_path(`${rystalShellDataDir}/assets/icons`); } app.get_monitors().forEach((m) => { diff --git a/env.d.ts b/src/env.d.ts similarity index 100% rename from env.d.ts rename to src/env.d.ts diff --git a/requestHandler.ts b/src/ipc.ts similarity index 100% rename from requestHandler.ts rename to src/ipc.ts diff --git a/lib/config.ts b/src/lib/config.ts similarity index 93% rename from lib/config.ts rename to src/lib/config.ts index d06be20..89b56e2 100644 --- a/lib/config.ts +++ b/src/lib/config.ts @@ -1,5 +1,7 @@ import GLib from 'gi://GLib?version=2.0'; +import { rystalShellConfigDir } from './paths'; + export interface AppConfig { brightness?: { backend?: 'auto' | 'ddcutil' | 'brightnessctl'; @@ -56,8 +58,7 @@ const DEFAULT_CONFIG: AppConfig = { function loadConfig(): AppConfig { try { - const configDir = `${GLib.get_user_config_dir()}/ags`; - const configPath = `${configDir}/config.json`; + const configPath = `${rystalShellConfigDir}/config.json`; if (GLib.file_test(configPath, GLib.FileTest.EXISTS)) { const [success, bytes] = GLib.file_get_contents(configPath); if (success && bytes) { diff --git a/lib/css.ts b/src/lib/css.ts similarity index 61% rename from lib/css.ts rename to src/lib/css.ts index 4a70017..4ee4762 100644 --- a/lib/css.ts +++ b/src/lib/css.ts @@ -3,16 +3,15 @@ import { exec, execAsync } from 'ags/process'; import GLib from 'gi://GLib'; -import style from '../style.scss'; - import { reloadLauncherBackground } from '../stores/launcherImage'; import { forceRedrawBar } from '../widget/bar'; -import { ryprlandRuntimeDir } from './paths'; +import { ryprlandRuntimeDir, rystalShellConfigDir, rystalShellDataDir } from './paths'; let globalCssProvider: Gtk.CssProvider | null = null; let lastCompiledCss: string | null = null; -const configDir = `${GLib.get_user_config_dir()}/ags`; -const scssPath = `${configDir}/style.scss`; +const styleEntry = `${rystalShellDataDir}/styles/style.scss`; +const defaultThemeDir = `${rystalShellDataDir}/styles/default`; +const defaultCssPath = `${rystalShellDataDir}/styles/default.css`; const runtimeDir = `${ryprlandRuntimeDir}/rystal-shell`; const cssPath = `${runtimeDir}/style.css`; @@ -20,10 +19,10 @@ function ensureRuntimeDir() { GLib.mkdir_with_parents(runtimeDir, 0o700); } -function readCompiledCss() { - const [success, bytes] = GLib.file_get_contents(cssPath); +function readCss(path: string) { + const [success, bytes] = GLib.file_get_contents(path); if (!success || !bytes) { - throw new Error(`Cannot read compiled CSS: ${cssPath}`); + throw new Error(`Cannot read CSS: ${path}`); } return new TextDecoder().decode(bytes); } @@ -54,37 +53,50 @@ function reloadCss(cssInput: string) { ); globalCssProvider = nextProvider; - reloadLauncherBackground(); forceRedrawBar(); } +function sassCommand() { + return [ + 'sass', + '--load-path', + rystalShellConfigDir, + '--load-path', + defaultThemeDir, + styleEntry, + cssPath, + ]; +} + export function compileAndReloadCss(): Promise { ensureRuntimeDir(); - return execAsync(`sass ${scssPath} ${cssPath}`) + return execAsync(sassCommand()) .then(() => { - const css = readCompiledCss(); + const css = readCss(cssPath); if (css === lastCompiledCss) return; reloadCss(css); lastCompiledCss = css; }) .catch((err) => { - console.error(`Error compiling SCSS: ${err}`); + console.error(`Error compiling CSS; keeping the active stylesheet: ${err}`); throw err; }); } export function initCss() { + ensureRuntimeDir(); try { - ensureRuntimeDir(); - exec(['sass', scssPath, cssPath]); - const css = readCompiledCss(); + exec(sassCommand()); + const css = readCss(cssPath); reloadCss(css); lastCompiledCss = css; } catch (error) { - console.error(`Error compiling initial SCSS, using bundled CSS: ${error}`); - reloadCss(style); - lastCompiledCss = style; + console.error(`Error compiling initial SCSS: ${error}`); + const fallbackPath = GLib.file_test(cssPath, GLib.FileTest.EXISTS) ? cssPath : defaultCssPath; + const css = readCss(fallbackPath); + reloadCss(css); + lastCompiledCss = css; } } diff --git a/lib/image.ts b/src/lib/image.ts similarity index 100% rename from lib/image.ts rename to src/lib/image.ts diff --git a/lib/motion.ts b/src/lib/motion.ts similarity index 100% rename from lib/motion.ts rename to src/lib/motion.ts diff --git a/lib/notification.ts b/src/lib/notification.ts similarity index 80% rename from lib/notification.ts rename to src/lib/notification.ts index f033e8e..566fe0a 100644 --- a/lib/notification.ts +++ b/src/lib/notification.ts @@ -1,8 +1,9 @@ import Notifd from 'gi://AstalNotifd'; -import GLib from 'gi://GLib'; + +import { rystalShellDataDir } from './paths'; const APP_NAME = 'Rystal Shell'; -const APP_ICON = `${GLib.get_user_config_dir()}/ags/assets/icon.png`; +const APP_ICON = `${rystalShellDataDir}/assets/icon.png`; export function sendNotification(properties: Partial) { const notification = new Notifd.Notification({ diff --git a/lib/paths.ts b/src/lib/paths.ts similarity index 70% rename from lib/paths.ts rename to src/lib/paths.ts index 382219b..cbf074f 100644 --- a/lib/paths.ts +++ b/src/lib/paths.ts @@ -6,6 +6,18 @@ function configuredDirectory(name: string, fallback: string) { return GLib.getenv(name) || fallback; } +export const rystalShellConfigDir = configuredDirectory( + 'RYSTAL_SHELL_CONFIG_DIR', + `${GLib.get_user_config_dir()}/rystal-shell`, +); + +export const rystalShellDataDir = configuredDirectory( + 'RYSTAL_SHELL_DATA_DIR', + `${GLib.get_user_data_dir()}/rystal-shell`, +); + +export const rystalShellInstance = configuredDirectory('RYSTAL_SHELL_INSTANCE', 'rystal-shell'); + export const ryprlandCacheDir = configuredDirectory( 'RYPRLAND_CACHE_DIR', `${GLib.get_user_cache_dir()}/${IDENTIFIER}`, diff --git a/stores/application.ts b/src/stores/application.ts similarity index 100% rename from stores/application.ts rename to src/stores/application.ts diff --git a/stores/audio.ts b/src/stores/audio.ts similarity index 100% rename from stores/audio.ts rename to src/stores/audio.ts diff --git a/stores/brightness.ts b/src/stores/brightness.ts similarity index 100% rename from stores/brightness.ts rename to src/stores/brightness.ts diff --git a/stores/caffeine.ts b/src/stores/caffeine.ts similarity index 100% rename from stores/caffeine.ts rename to src/stores/caffeine.ts diff --git a/stores/launcherImage.ts b/src/stores/launcherImage.ts similarity index 72% rename from stores/launcherImage.ts rename to src/stores/launcherImage.ts index aa09f09..bbe7bb4 100644 --- a/stores/launcherImage.ts +++ b/src/stores/launcherImage.ts @@ -3,15 +3,20 @@ import { Gdk, Gtk } from 'ags/gtk4'; import GLib from 'gi://GLib'; import { loadTextureFromUri } from '../lib/image'; +import { rystalShellConfigDir, rystalShellDataDir } from '../lib/paths'; -const BACKGROUND_PATH = `${GLib.get_user_config_dir()}/ags/assets/launcher_bg.png`; +const configuredBackgroundPath = `${rystalShellConfigDir}/assets/launcher_bg.png`; +const defaultBackgroundPath = `${rystalShellDataDir}/assets/icon.png`; const pictures = new Set(); let texture: Gdk.Texture | null = null; let backgroundDirty = true; function loadBackground() { try { - return loadTextureFromUri(`file://${BACKGROUND_PATH}`, 500, 500); + const path = GLib.file_test(configuredBackgroundPath, GLib.FileTest.EXISTS) + ? configuredBackgroundPath + : defaultBackgroundPath; + return loadTextureFromUri(`file://${path}`, 500, 500); } catch (error) { console.error('Failed to load launcher background:', error); return null; diff --git a/stores/mprisThumbnail.ts b/src/stores/mprisThumbnail.ts similarity index 100% rename from stores/mprisThumbnail.ts rename to src/stores/mprisThumbnail.ts diff --git a/stores/network.ts b/src/stores/network.ts similarity index 100% rename from stores/network.ts rename to src/stores/network.ts diff --git a/stores/notification.ts b/src/stores/notification.ts similarity index 100% rename from stores/notification.ts rename to src/stores/notification.ts diff --git a/stores/powerProfile.ts b/src/stores/powerProfile.ts similarity index 100% rename from stores/powerProfile.ts rename to src/stores/powerProfile.ts diff --git a/stores/recording.ts b/src/stores/recording.ts similarity index 100% rename from stores/recording.ts rename to src/stores/recording.ts diff --git a/stores/system.ts b/src/stores/system.ts similarity index 100% rename from stores/system.ts rename to src/stores/system.ts diff --git a/stores/time.ts b/src/stores/time.ts similarity index 100% rename from stores/time.ts rename to src/stores/time.ts diff --git a/stores/update.ts b/src/stores/update.ts similarity index 100% rename from stores/update.ts rename to src/stores/update.ts diff --git a/stores/wallpaper.ts b/src/stores/wallpaper.ts similarity index 100% rename from stores/wallpaper.ts rename to src/stores/wallpaper.ts diff --git a/stores/weather.ts b/src/stores/weather.ts similarity index 100% rename from stores/weather.ts rename to src/stores/weather.ts diff --git a/stores/wifi.ts b/src/stores/wifi.ts similarity index 100% rename from stores/wifi.ts rename to src/stores/wifi.ts diff --git a/stores/wifiPasswordDialog.ts b/src/stores/wifiPasswordDialog.ts similarity index 100% rename from stores/wifiPasswordDialog.ts rename to src/stores/wifiPasswordDialog.ts diff --git a/stores/windowManager.ts b/src/stores/windowManager.ts similarity index 100% rename from stores/windowManager.ts rename to src/stores/windowManager.ts diff --git a/widget/app-launcher/index.tsx b/src/widget/app-launcher/index.tsx similarity index 100% rename from widget/app-launcher/index.tsx rename to src/widget/app-launcher/index.tsx diff --git a/widget/app-launcher/widget/AppItem.ts b/src/widget/app-launcher/widget/AppItem.ts similarity index 100% rename from widget/app-launcher/widget/AppItem.ts rename to src/widget/app-launcher/widget/AppItem.ts diff --git a/widget/app-launcher/widget/AppList.tsx b/src/widget/app-launcher/widget/AppList.tsx similarity index 100% rename from widget/app-launcher/widget/AppList.tsx rename to src/widget/app-launcher/widget/AppList.tsx diff --git a/widget/app-launcher/widget/SearchGoogleBtn.tsx b/src/widget/app-launcher/widget/SearchGoogleBtn.tsx similarity index 100% rename from widget/app-launcher/widget/SearchGoogleBtn.tsx rename to src/widget/app-launcher/widget/SearchGoogleBtn.tsx diff --git a/widget/app-launcher/widget/SearchInput.tsx b/src/widget/app-launcher/widget/SearchInput.tsx similarity index 100% rename from widget/app-launcher/widget/SearchInput.tsx rename to src/widget/app-launcher/widget/SearchInput.tsx diff --git a/widget/bar/BarReserve.tsx b/src/widget/bar/BarReserve.tsx similarity index 100% rename from widget/bar/BarReserve.tsx rename to src/widget/bar/BarReserve.tsx diff --git a/widget/bar/PanelBackground.tsx b/src/widget/bar/PanelBackground.tsx similarity index 94% rename from widget/bar/PanelBackground.tsx rename to src/widget/bar/PanelBackground.tsx index 3a8c3bf..471fca6 100644 --- a/widget/bar/PanelBackground.tsx +++ b/src/widget/bar/PanelBackground.tsx @@ -3,12 +3,14 @@ import { Gdk, Gtk } from 'ags/gtk4'; import GLib from 'gi://GLib'; import Cairo from 'gi://cairo'; +import { rystalShellConfigDir, rystalShellDataDir } from '../../lib/paths'; import { activeSidePanel, setAnimBottomHeight, setAnimDx } from '../../stores/windowManager'; const BORDER_WIDTH = 3; const BAR_WIDTH = 47; const WALLPAPER_PANEL_HEIGHT = 390; -const MATUGEN_PATH = `${GLib.get_user_config_dir()}/ags/themes/matugen.scss`; +const configuredThemePath = `${rystalShellConfigDir}/theme.scss`; +const defaultThemePath = `${rystalShellDataDir}/styles/default/theme.scss`; // --- Color parsing --- function hexToRgba(hex: string): [number, number, number, number] { @@ -34,7 +36,10 @@ function hexToRgba(hex: string): [number, number, number, number] { function readMatugenColors(): { surface: string; primary: string } { try { - const [ok, bytes] = GLib.file_get_contents(MATUGEN_PATH); + const themePath = GLib.file_test(configuredThemePath, GLib.FileTest.EXISTS) + ? configuredThemePath + : defaultThemePath; + const [ok, bytes] = GLib.file_get_contents(themePath); if (!ok || !bytes) throw new Error('read failed'); const contents = new TextDecoder().decode(bytes); diff --git a/widget/bar/index.tsx b/src/widget/bar/index.tsx similarity index 100% rename from widget/bar/index.tsx rename to src/widget/bar/index.tsx diff --git a/widget/bar/widget/Clock.tsx b/src/widget/bar/widget/Clock.tsx similarity index 100% rename from widget/bar/widget/Clock.tsx rename to src/widget/bar/widget/Clock.tsx diff --git a/widget/bar/widget/RecordIndicator.tsx b/src/widget/bar/widget/RecordIndicator.tsx similarity index 100% rename from widget/bar/widget/RecordIndicator.tsx rename to src/widget/bar/widget/RecordIndicator.tsx diff --git a/widget/bar/widget/ScrollerIndicator.tsx b/src/widget/bar/widget/ScrollerIndicator.tsx similarity index 100% rename from widget/bar/widget/ScrollerIndicator.tsx rename to src/widget/bar/widget/ScrollerIndicator.tsx diff --git a/widget/bar/widget/SysMetrics.tsx b/src/widget/bar/widget/SysMetrics.tsx similarity index 100% rename from widget/bar/widget/SysMetrics.tsx rename to src/widget/bar/widget/SysMetrics.tsx diff --git a/widget/bar/widget/Tray.tsx b/src/widget/bar/widget/Tray.tsx similarity index 100% rename from widget/bar/widget/Tray.tsx rename to src/widget/bar/widget/Tray.tsx diff --git a/widget/bar/widget/Updates.tsx b/src/widget/bar/widget/Updates.tsx similarity index 100% rename from widget/bar/widget/Updates.tsx rename to src/widget/bar/widget/Updates.tsx diff --git a/widget/bar/widget/Volume.tsx b/src/widget/bar/widget/Volume.tsx similarity index 100% rename from widget/bar/widget/Volume.tsx rename to src/widget/bar/widget/Volume.tsx diff --git a/widget/bar/widget/Weather.tsx b/src/widget/bar/widget/Weather.tsx similarity index 100% rename from widget/bar/widget/Weather.tsx rename to src/widget/bar/widget/Weather.tsx diff --git a/widget/bar/widget/Workspaces.tsx b/src/widget/bar/widget/Workspaces.tsx similarity index 100% rename from widget/bar/widget/Workspaces.tsx rename to src/widget/bar/widget/Workspaces.tsx diff --git a/widget/common/AnimatedList.tsx b/src/widget/common/AnimatedList.tsx similarity index 100% rename from widget/common/AnimatedList.tsx rename to src/widget/common/AnimatedList.tsx diff --git a/widget/common/CircularProgress.tsx b/src/widget/common/CircularProgress.tsx similarity index 100% rename from widget/common/CircularProgress.tsx rename to src/widget/common/CircularProgress.tsx diff --git a/widget/common/NotificationCard.tsx b/src/widget/common/NotificationCard.tsx similarity index 100% rename from widget/common/NotificationCard.tsx rename to src/widget/common/NotificationCard.tsx diff --git a/widget/common/lucide.tsx b/src/widget/common/lucide.tsx similarity index 100% rename from widget/common/lucide.tsx rename to src/widget/common/lucide.tsx diff --git a/widget/control-center/index.tsx b/src/widget/control-center/index.tsx similarity index 100% rename from widget/control-center/index.tsx rename to src/widget/control-center/index.tsx diff --git a/widget/control-center/widget/BrightnessSlider.tsx b/src/widget/control-center/widget/BrightnessSlider.tsx similarity index 100% rename from widget/control-center/widget/BrightnessSlider.tsx rename to src/widget/control-center/widget/BrightnessSlider.tsx diff --git a/widget/control-center/widget/Connectivity/BluetoothPage.tsx b/src/widget/control-center/widget/Connectivity/BluetoothPage.tsx similarity index 100% rename from widget/control-center/widget/Connectivity/BluetoothPage.tsx rename to src/widget/control-center/widget/Connectivity/BluetoothPage.tsx diff --git a/widget/control-center/widget/Connectivity/Shared.tsx b/src/widget/control-center/widget/Connectivity/Shared.tsx similarity index 100% rename from widget/control-center/widget/Connectivity/Shared.tsx rename to src/widget/control-center/widget/Connectivity/Shared.tsx diff --git a/widget/control-center/widget/Connectivity/WifiPage.tsx b/src/widget/control-center/widget/Connectivity/WifiPage.tsx similarity index 100% rename from widget/control-center/widget/Connectivity/WifiPage.tsx rename to src/widget/control-center/widget/Connectivity/WifiPage.tsx diff --git a/widget/control-center/widget/Connectivity/WifiPasswordDialog.tsx b/src/widget/control-center/widget/Connectivity/WifiPasswordDialog.tsx similarity index 100% rename from widget/control-center/widget/Connectivity/WifiPasswordDialog.tsx rename to src/widget/control-center/widget/Connectivity/WifiPasswordDialog.tsx diff --git a/widget/control-center/widget/Connectivity/index.tsx b/src/widget/control-center/widget/Connectivity/index.tsx similarity index 100% rename from widget/control-center/widget/Connectivity/index.tsx rename to src/widget/control-center/widget/Connectivity/index.tsx diff --git a/widget/control-center/widget/MediaCard/CavaWidget.tsx b/src/widget/control-center/widget/MediaCard/CavaWidget.tsx similarity index 100% rename from widget/control-center/widget/MediaCard/CavaWidget.tsx rename to src/widget/control-center/widget/MediaCard/CavaWidget.tsx diff --git a/widget/control-center/widget/MediaCard/PlayerCard.tsx b/src/widget/control-center/widget/MediaCard/PlayerCard.tsx similarity index 100% rename from widget/control-center/widget/MediaCard/PlayerCard.tsx rename to src/widget/control-center/widget/MediaCard/PlayerCard.tsx diff --git a/widget/control-center/widget/MediaCard/index.tsx b/src/widget/control-center/widget/MediaCard/index.tsx similarity index 100% rename from widget/control-center/widget/MediaCard/index.tsx rename to src/widget/control-center/widget/MediaCard/index.tsx diff --git a/widget/control-center/widget/QuickToggles.tsx b/src/widget/control-center/widget/QuickToggles.tsx similarity index 100% rename from widget/control-center/widget/QuickToggles.tsx rename to src/widget/control-center/widget/QuickToggles.tsx diff --git a/widget/control-center/widget/ScreenCapture.tsx b/src/widget/control-center/widget/ScreenCapture.tsx similarity index 100% rename from widget/control-center/widget/ScreenCapture.tsx rename to src/widget/control-center/widget/ScreenCapture.tsx diff --git a/widget/control-center/widget/Sound/DeviceSelector.tsx b/src/widget/control-center/widget/Sound/DeviceSelector.tsx similarity index 100% rename from widget/control-center/widget/Sound/DeviceSelector.tsx rename to src/widget/control-center/widget/Sound/DeviceSelector.tsx diff --git a/widget/control-center/widget/Sound/SoundPage.tsx b/src/widget/control-center/widget/Sound/SoundPage.tsx similarity index 100% rename from widget/control-center/widget/Sound/SoundPage.tsx rename to src/widget/control-center/widget/Sound/SoundPage.tsx diff --git a/widget/control-center/widget/Sound/index.tsx b/src/widget/control-center/widget/Sound/index.tsx similarity index 100% rename from widget/control-center/widget/Sound/index.tsx rename to src/widget/control-center/widget/Sound/index.tsx diff --git a/widget/control-center/widget/SystemMetrics.tsx b/src/widget/control-center/widget/SystemMetrics.tsx similarity index 100% rename from widget/control-center/widget/SystemMetrics.tsx rename to src/widget/control-center/widget/SystemMetrics.tsx diff --git a/widget/control-center/widget/UpdatesCard.tsx b/src/widget/control-center/widget/UpdatesCard.tsx similarity index 100% rename from widget/control-center/widget/UpdatesCard.tsx rename to src/widget/control-center/widget/UpdatesCard.tsx diff --git a/widget/control-center/widget/VolumeSlider.tsx b/src/widget/control-center/widget/VolumeSlider.tsx similarity index 100% rename from widget/control-center/widget/VolumeSlider.tsx rename to src/widget/control-center/widget/VolumeSlider.tsx diff --git a/widget/date-weather/index.tsx b/src/widget/date-weather/index.tsx similarity index 100% rename from widget/date-weather/index.tsx rename to src/widget/date-weather/index.tsx diff --git a/widget/date-weather/widget/ClockCard.tsx b/src/widget/date-weather/widget/ClockCard.tsx similarity index 100% rename from widget/date-weather/widget/ClockCard.tsx rename to src/widget/date-weather/widget/ClockCard.tsx diff --git a/widget/date-weather/widget/NotificationList.tsx b/src/widget/date-weather/widget/NotificationList.tsx similarity index 100% rename from widget/date-weather/widget/NotificationList.tsx rename to src/widget/date-weather/widget/NotificationList.tsx diff --git a/widget/date-weather/widget/ProfileCard.tsx b/src/widget/date-weather/widget/ProfileCard.tsx similarity index 100% rename from widget/date-weather/widget/ProfileCard.tsx rename to src/widget/date-weather/widget/ProfileCard.tsx diff --git a/widget/date-weather/widget/WeatherCard.tsx b/src/widget/date-weather/widget/WeatherCard.tsx similarity index 100% rename from widget/date-weather/widget/WeatherCard.tsx rename to src/widget/date-weather/widget/WeatherCard.tsx diff --git a/widget/date-weather/widget/WorldClockCard.tsx b/src/widget/date-weather/widget/WorldClockCard.tsx similarity index 100% rename from widget/date-weather/widget/WorldClockCard.tsx rename to src/widget/date-weather/widget/WorldClockCard.tsx diff --git a/widget/notification-popups/index.tsx b/src/widget/notification-popups/index.tsx similarity index 100% rename from widget/notification-popups/index.tsx rename to src/widget/notification-popups/index.tsx diff --git a/widget/wallpaper-selector/index.tsx b/src/widget/wallpaper-selector/index.tsx similarity index 100% rename from widget/wallpaper-selector/index.tsx rename to src/widget/wallpaper-selector/index.tsx diff --git a/widget/wallpaper-selector/widget/CoverFlow.tsx b/src/widget/wallpaper-selector/widget/CoverFlow.tsx similarity index 100% rename from widget/wallpaper-selector/widget/CoverFlow.tsx rename to src/widget/wallpaper-selector/widget/CoverFlow.tsx diff --git a/widget/wallpaper-selector/widget/WallpaperCard.ts b/src/widget/wallpaper-selector/widget/WallpaperCard.ts similarity index 100% rename from widget/wallpaper-selector/widget/WallpaperCard.ts rename to src/widget/wallpaper-selector/widget/WallpaperCard.ts diff --git a/styles/default/theme.scss b/styles/default/theme.scss new file mode 100644 index 0000000..35db8d2 --- /dev/null +++ b/styles/default/theme.scss @@ -0,0 +1,51 @@ +// ┳┳┓┏┓┏┳┓┳┳┏┓┏┓┳┓ ┏┓┏┓┏┓ +// ┃┃┃┣┫ ┃ ┃┃┃┓┣ ┃┃━━┣┫┃┓┗┓ +// ┛ ┗┛┗ ┻ ┗┛┗┛┗┛┛┗ ┛┗┗┛┗┛ + +$primary: #edc06c; +$primary-fixed: #ffdea7; +$primary-fixed-alpha: rgba(255, 222, 167, 0.2); +$primary-fixed-dim: #edc06c; +$on-primary: #412d00; +$on-primary-fixed: #271900; +$on-primary-fixed-variant: #5e4200; +$primary-container: #5e4200; +$on-primary-container: #ffdea7; +$secondary: #dac4a0; +$secondary-fixed: #f7dfbb; +$secondary-fixed-dim: #dac4a0; +$on-secondary: #3c2e15; +$on-secondary-fixed: #251a04; +$on-secondary-fixed-variant: #54452a; +$secondary-container: #54452a; +$on-secondary-container: #f7dfbb; +$tertiary: #b3cea6; +$tertiary-fixed: #ceebc1; +$tertiary-fixed-dim: #b3cea6; +$on-tertiary: #203619; +$on-tertiary-fixed: #0b2007; +$on-tertiary-fixed-variant: #354d2e; +$tertiary-container: #354d2e; +$on-tertiary-container: #ceebc1; +$error: #ffb4ab; +$on-error: #690005; +$error-container: #93000a; +$on-error-container: #ffdad6; +$surface: #17130b; +$surface-alpha: rgba(23, 19, 11, 0.7); +$on-surface: #ece1d4; +$on-surface-variant: #d1c5b4; +$outline: #9a8f80; +$outline-variant: #4e4639; +$shadow: #000000; +$scrim: #000000; +$inverse-surface: #ece1d4; +$inverse-on-surface: #353027; +$inverse-primary: #7a580c; +$surface-dim: #17130b; +$surface-bright: #3e382f; +$surface-container-lowest: #120e07; +$surface-container-low: #201b13; +$surface-container: #241f17; +$surface-container-high: #2f2921; +$surface-container-highest: #3a342b; diff --git a/scss/_applauncher.scss b/styles/scss/_applauncher.scss similarity index 100% rename from scss/_applauncher.scss rename to styles/scss/_applauncher.scss diff --git a/scss/_bar.scss b/styles/scss/_bar.scss similarity index 100% rename from scss/_bar.scss rename to styles/scss/_bar.scss diff --git a/scss/_connectivity.scss b/styles/scss/_connectivity.scss similarity index 100% rename from scss/_connectivity.scss rename to styles/scss/_connectivity.scss diff --git a/scss/_control_center.scss b/styles/scss/_control_center.scss similarity index 100% rename from scss/_control_center.scss rename to styles/scss/_control_center.scss diff --git a/scss/_date_weather.scss b/styles/scss/_date_weather.scss similarity index 100% rename from scss/_date_weather.scss rename to styles/scss/_date_weather.scss diff --git a/scss/_notifications.scss b/styles/scss/_notifications.scss similarity index 100% rename from scss/_notifications.scss rename to styles/scss/_notifications.scss diff --git a/scss/_sound.scss b/styles/scss/_sound.scss similarity index 100% rename from scss/_sound.scss rename to styles/scss/_sound.scss diff --git a/scss/_variables.scss b/styles/scss/_variables.scss similarity index 89% rename from scss/_variables.scss rename to styles/scss/_variables.scss index fa2aef7..99ff7f9 100644 --- a/scss/_variables.scss +++ b/styles/scss/_variables.scss @@ -1,6 +1,6 @@ -@forward '../themes/matugen'; +@forward 'theme'; @use 'sass:color'; -@use '../themes/matugen' as *; +@use 'theme' as *; // Base colors $bg: color.adjust($surface, $alpha: -0.25); diff --git a/scss/_wallpaper_selector.scss b/styles/scss/_wallpaper_selector.scss similarity index 100% rename from scss/_wallpaper_selector.scss rename to styles/scss/_wallpaper_selector.scss diff --git a/style.scss b/styles/style.scss similarity index 100% rename from style.scss rename to styles/style.scss