Merge branch 'Jas-SinghFSU:master' into master
This commit is contained in:
1
env.d.ts
vendored
1
env.d.ts
vendored
@@ -1,4 +1,5 @@
|
|||||||
declare const SRC: string;
|
declare const SRC: string;
|
||||||
|
declare const DATADIR: string;
|
||||||
|
|
||||||
declare module 'inline:*' {
|
declare module 'inline:*' {
|
||||||
const content: string;
|
const content: string;
|
||||||
|
|||||||
50
meson.build
50
meson.build
@@ -1,57 +1,37 @@
|
|||||||
project('hyprpanel')
|
project(
|
||||||
|
'hyprpanel',
|
||||||
|
default_options: [
|
||||||
|
'prefix=/usr',
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
bindir = get_option('prefix') / get_option('bindir')
|
prefix = get_option('prefix')
|
||||||
datadir = get_option('prefix') / get_option('datadir') / 'hyprpanel'
|
bindir = prefix / get_option('bindir')
|
||||||
|
datadir = prefix / get_option('datadir') / meson.project_name()
|
||||||
|
|
||||||
ags = find_program('ags', required: true)
|
ags = find_program('ags', required: true)
|
||||||
find_program('gjs', required: true)
|
find_program('gjs', required: true)
|
||||||
|
|
||||||
src_file_list_process = run_command(
|
|
||||||
'find',
|
|
||||||
'src',
|
|
||||||
'-type', 'f',
|
|
||||||
'(',
|
|
||||||
'-name', '*.ts',
|
|
||||||
'-o',
|
|
||||||
'-name', '*.tsx',
|
|
||||||
'-o',
|
|
||||||
'-name', '*.scss',
|
|
||||||
')',
|
|
||||||
)
|
|
||||||
|
|
||||||
if src_file_list_process.returncode() != 0
|
|
||||||
error('Failed to find source files.')
|
|
||||||
endif
|
|
||||||
|
|
||||||
src_file_list = src_file_list_process.stdout().split('\n')
|
|
||||||
|
|
||||||
all_sources = []
|
|
||||||
|
|
||||||
foreach file : src_file_list
|
|
||||||
file_stripped = file.strip()
|
|
||||||
if file_stripped != ''
|
|
||||||
all_sources += meson.project_source_root() / file_stripped
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
custom_target(
|
custom_target(
|
||||||
'hyprpanel_bundle',
|
'hyprpanel_bundle',
|
||||||
input: all_sources,
|
input: files('app.ts'),
|
||||||
command: [
|
command: [
|
||||||
ags,
|
ags,
|
||||||
'bundle',
|
'bundle',
|
||||||
|
'--define', 'DATADIR="' + datadir + '"',
|
||||||
|
'--root', meson.project_source_root(),
|
||||||
meson.project_source_root() / 'app.ts',
|
meson.project_source_root() / 'app.ts',
|
||||||
'@OUTPUT@',
|
'@OUTPUT@',
|
||||||
'--src', meson.project_source_root(),
|
|
||||||
],
|
],
|
||||||
output: 'hyprpanel.js',
|
output: meson.project_name() + '.js',
|
||||||
install: true,
|
install: true,
|
||||||
install_dir: datadir,
|
install_dir: datadir,
|
||||||
|
build_always_stale: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
input: 'scripts/hyprpanel_launcher.sh.in',
|
input: 'scripts/hyprpanel_launcher.sh.in',
|
||||||
output: 'hyprpanel',
|
output: meson.project_name(),
|
||||||
configuration: {'DATADIR': datadir},
|
configuration: {'DATADIR': datadir},
|
||||||
install: true,
|
install: true,
|
||||||
install_dir: bindir,
|
install_dir: bindir,
|
||||||
|
|||||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -8,6 +8,9 @@
|
|||||||
"name": "hyprpanel",
|
"name": "hyprpanel",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"astal": "/usr/share/astal/gjs"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^22.5.4",
|
"@types/node": "^22.5.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
||||||
@@ -21,6 +24,9 @@
|
|||||||
"typescript": "^5.6.2"
|
"typescript": "^5.6.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"../../../../usr/share/astal/gjs": {
|
||||||
|
"license": "LGPL-2.1"
|
||||||
|
},
|
||||||
"node_modules/@eslint-community/eslint-utils": {
|
"node_modules/@eslint-community/eslint-utils": {
|
||||||
"version": "4.4.0",
|
"version": "4.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
|
||||||
@@ -593,6 +599,10 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/astal": {
|
||||||
|
"resolved": "../../../../usr/share/astal/gjs",
|
||||||
|
"link": true
|
||||||
|
},
|
||||||
"node_modules/available-typed-arrays": {
|
"node_modules/available-typed-arrays": {
|
||||||
"version": "1.0.7",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
"name": "hyprpanel",
|
"name": "hyprpanel",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A customizable panel built for Hyprland.",
|
"description": "A customizable panel built for Hyprland.",
|
||||||
"main": "config.js",
|
"main": "app.ts",
|
||||||
"directories": {
|
|
||||||
"lib": "lib"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint --config .eslintrc.js .",
|
"lint": "eslint --config .eslintrc.js .",
|
||||||
"lint:fix": "eslint --config .eslintrc.js . --fix",
|
"lint:fix": "eslint --config .eslintrc.js . --fix",
|
||||||
@@ -14,6 +11,9 @@
|
|||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"astal": "/usr/share/astal/gjs"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^22.5.4",
|
"@types/node": "^22.5.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
export HYPRPANEL_DATADIR="@DATADIR@"
|
|
||||||
|
|
||||||
if [ "$#" -eq 0 ]; then
|
if [ "$#" -eq 0 ]; then
|
||||||
exec gjs -m "@DATADIR@/hyprpanel.js"
|
exec gjs -m "@DATADIR@/hyprpanel.js"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -28,11 +28,13 @@ export function ensureFile(path: string): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dataDir = typeof DATADIR !== 'undefined' ? DATADIR : SRC;
|
||||||
|
|
||||||
Object.assign(globalThis, {
|
Object.assign(globalThis, {
|
||||||
CONFIG: `${GLib.get_user_config_dir()}/hyprpanel/config.json`,
|
CONFIG: `${GLib.get_user_config_dir()}/hyprpanel/config.json`,
|
||||||
TMP: `${GLib.get_tmp_dir()}/hyprpanel`,
|
TMP: `${GLib.get_tmp_dir()}/hyprpanel`,
|
||||||
USER: GLib.get_user_name(),
|
USER: GLib.get_user_name(),
|
||||||
SRC_DIR: GLib.getenv('HYPRPANEL_DATADIR') ?? SRC,
|
SRC_DIR: dataDir,
|
||||||
});
|
});
|
||||||
|
|
||||||
ensureDirectory(TMP);
|
ensureDirectory(TMP);
|
||||||
|
|||||||
@@ -19,11 +19,6 @@
|
|||||||
"types": [],
|
"types": [],
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"jsxImportSource": "/usr/share/astal/gjs/gtk3",
|
"jsxImportSource": "astal/gtk3"
|
||||||
"paths": {
|
}
|
||||||
"astal": ["/usr/share/astal/gjs"],
|
|
||||||
"astal/*": ["/usr/share/astal/gjs/*"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"exclude": ["astal/gtk3/jsx-runtime.ts"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user