From ed17459e2a041950e7a286710082b4a65a124583 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 14 Apr 2025 16:17:21 +0200 Subject: [PATCH] [Launcher] Improve type definitions --- build/render.js | 4 ++- .../ags/launcher/definitions/components.d.ts | 21 +++++++++++--- config/ags/launcher/definitions/job.d.ts | 0 .../ags/launcher/definitions/rendering.d.ts | 2 +- config/ags/launcher/util/file.ts | 2 ++ config/ags/launcher/util/subprocessRunner.ts | 6 ++-- install | 28 +++++++++++++++++++ notes.md | 5 ++++ 8 files changed, 59 insertions(+), 9 deletions(-) delete mode 100644 config/ags/launcher/definitions/job.d.ts diff --git a/build/render.js b/build/render.js index 59dd49b..5c20fbb 100644 --- a/build/render.js +++ b/build/render.js @@ -57,7 +57,9 @@ const build = ( wallpaper, lockpaper, theme ) => { // recursively index files from config directory -> Maybe add a file to each // directory to indicate whether or not to index files in it? - const fileList = util.treeWalker( path.join( __dirname, '/../config/' ), '*', [ 'node_modules', '@girs', '.gitignore', '.git' ] ); + const fileList = util.treeWalker( path.join( __dirname, '/../config/' ), '*', [ 'node_modules', '@girs', '.gitignore', '.git', 'flavours' ] ); + + // TODO: Copy missing files over directly console.log( fileList ); for (let index = 0; index < fileList.length; index++) { try { diff --git a/config/ags/launcher/definitions/components.d.ts b/config/ags/launcher/definitions/components.d.ts index 7f8d342..1cd1dd7 100644 --- a/config/ags/launcher/definitions/components.d.ts +++ b/config/ags/launcher/definitions/components.d.ts @@ -19,17 +19,30 @@ export interface App extends ResultElement { // TODO: Finish export interface DictionaryEntry extends ResultElement { + /** + * Execute no command + */ + action: null; + + /** + * The dictionary definition + */ + definition: string; } -// TODO: Finish export interface CMDOutput extends ResultElement { - + /** + * Stdout from the command that was run + */ + result: string; } -// TODO: Finish export interface Calculation extends ResultElement { - + /** + * THe calculation result + */ + result: string; } diff --git a/config/ags/launcher/definitions/job.d.ts b/config/ags/launcher/definitions/job.d.ts deleted file mode 100644 index e69de29..0000000 diff --git a/config/ags/launcher/definitions/rendering.d.ts b/config/ags/launcher/definitions/rendering.d.ts index 035186f..97c6e8e 100644 --- a/config/ags/launcher/definitions/rendering.d.ts +++ b/config/ags/launcher/definitions/rendering.d.ts @@ -57,4 +57,4 @@ export interface ResultElement { fontSize: number | undefined; } -type Action = ''; +type Action = '' | null; diff --git a/config/ags/launcher/util/file.ts b/config/ags/launcher/util/file.ts index 39a0f1d..d7f79dc 100644 --- a/config/ags/launcher/util/file.ts +++ b/config/ags/launcher/util/file.ts @@ -8,3 +8,5 @@ */ import { readFileAsync, writeFileAsync, monitorFile } from "astal"; + + diff --git a/config/ags/launcher/util/subprocessRunner.ts b/config/ags/launcher/util/subprocessRunner.ts index a74877e..2946c88 100644 --- a/config/ags/launcher/util/subprocessRunner.ts +++ b/config/ags/launcher/util/subprocessRunner.ts @@ -20,9 +20,9 @@ import { subprocess, execAsync, Process } from "astal/process"; * @returns [TODO:return] */ const startSubProcess = ( - cmd: string | string[], - onOut: (stdout: string) => void, - onErr: (stderr: string) => void | undefined, + cmd: string | string[], + onOut: (stdout: string) => void, + onErr: (stderr: string) => void | undefined, ): Process => { return subprocess( cmd, onOut, onErr ); }; diff --git a/install b/install index 9c6cd0e..067f03d 100755 --- a/install +++ b/install @@ -7,3 +7,31 @@ read -p "Choose the configs to install, Laptop or Desktop (l/D): " platform # Install yazi plugins using ya pack -a ndtoan96/ouch and ya pack -a boydaihungst/restore # # TODO: get configs from current setup +# Hyprland +yay -S hyprland hypridle hyprfreeze hyprlock plymouth aylurs-gtk-shell-git brightnessctl pulsemixer xdg-desktop-portal-hyprland + +# Audio, drivers, tools +yay -S pipewire pipewire-alsa pipewire-pulse pipewire-jack mesa fish thunar yazi wireplumber grimblast wl-clipboard wget vimiv zoxide trash-cli fzf ouch zathura + +# Set up yazi +ya pack -a ndtoan96/ouch +ya pack -a boydaihungst/restore + +# Fonts +yay -S adobe-source-code-pro-fonts gnome-font-viewer gnome-characters gnome-tweaks lxappearance kvantum gnome-keyring smartmontools ffmpeg polkit-gnome swaybg network-manager-applet polkit-kde-agent cpupower-gui ttf-fantasque-nerd ttf-jetbrains-mono-nerd ttf-fluentui-system-icons ttf-comfortaa + +# Programming +yay -S meld docker vscodium kitty fish docker terminator ghex nodejs npm python-pip git-credential-manager-core-bin wine kate rustup cargo filezilla typescript-language-server php jdk vscode-css-languageserver vscode-html-languageserver bash-language-server lazygit +sudo npm i -g @vue/typescript-plugin + +# nvim +yay -S neovim lua lua-language-server tree-sitter texlab stylua luarocks jdtls perl julia autojump pyright + +# Internet +yay -S librewolf-bin webcord-bin thunderbird rustdesk brave-bin + +# Utilities +yay -S okular vlc nextcloud-client p7zip zip unzip gnome-keyring noto-fonts thunderbird pamixer pavucontrol light neofetch bashtop hugo sddm uxplay upower + +# LaTeX +yay -S texlive biber diff --git a/notes.md b/notes.md index 12ccc6e..5436dab 100644 --- a/notes.md +++ b/notes.md @@ -57,3 +57,8 @@ - [ ] Installer for configs - [ ] Vivado cleanup (run after vivado and hope vivado is blocking (or simply execute vivado in /tmp)) - [ ] migrate to zoxide from autojump + + +Using astal (https://aylur.github.io/astal, which is gjs based), write a component that takes as argument a UIComponent array (pre-defined interface) and depending on what subclass of that interface it is renders a different component for each element. +I have the type definitions of UIComponent below. The possible subclasses are LargeUIComponent, MediumUIComponent, ListUIComponent and CalculationUIComponent. +Design-wise, I would like to have something similar to GNOME's layout.