diff --git a/.gitignore b/.gitignore index 0ecea57..6f0fbb9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ .weather.json node_modules +prepare @girs + +**/.claude/settings.local.json diff --git a/README.md b/README.md index 9a223dd..3710558 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ dart-sass wl-clipboard upower gvfs +gtksourceview3 +libsoup3 ``` **NOTE: HyprPanel will not run without the required dependencies.** @@ -83,16 +85,8 @@ swww ### Arch -pacman: - ```bash - sudo pacman -S --needed wireplumber libgtop bluez bluez-utils btop networkmanager dart-sass wl-clipboard brightnessctl swww python upower pacman-contrib power-profiles-daemon gvfs -``` - -AUR: - -```bash -yay -S --needed aylurs-gtk-shell-git grimblast-git wf-recorder-git hyprpicker matugen-bin python-gpustat hyprsunset-git +yay -S --needed aylurs-gtk-shell-git wireplumber libgtop bluez bluez-utils btop networkmanager dart-sass wl-clipboard brightnessctl swww python upower pacman-contrib power-profiles-daemon gvfs gtksourceview3 libsoup3 grimblast-git wf-recorder-git hyprpicker matugen-bin python-gpustat hyprsunset-git ``` ### Fedora @@ -155,28 +149,40 @@ If you install the fonts after installing HyperPanel, you will need to restart H ### NixOS & Home-Manager Alternatively, if you're using NixOS and/or Home-Manager, you can setup AGS using the provided Nix Flake. First, add the repository to your Flake's inputs, and enable the overlay. +You can now also just use wrapper as the package directly and ignore this section almost entirely (expect for adding inputs), it's recommended to avoid overlays. ```nix # flake.nix { - inputs.hyprpanel.url = "github:Jas-SinghFSU/HyprPanel"; - # ... + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + hyprpanel = { + url = "github:Jas-SinghFSU/HyprPanel"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; - outputs = { self, nixpkgs, ... }@inputs: - let - # ... - system = "x86_64-linux"; # change to whatever your system should be. - pkgs = import nixpkgs { - inherit system; - # ... - overlays = [ + outputs = + { self, nixpkgs, ... }@inputs: + let + overlays = [ inputs.hyprpanel.overlay - ]; - }; - in { - # ... - } + ]; + in + { + nixosConfigurations = { + nixos = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + }; + modules = [ + ./configuration.nix + { nixpkgs.overlays = [ overlays ]; } + ]; + }; + }; + }; } ``` @@ -188,6 +194,7 @@ Once you've set up the overlay, you can reference HyprPanel with `pkgs.hyprpanel # install it as a system package environment.systemPackages = with pkgs; [ # ... + inputs.hyprpanel.packages.${pkgs.system}.wrapper # this one if you want to avoid overlays/didn't enable them hyprpanel # ... ]; @@ -195,6 +202,7 @@ environment.systemPackages = with pkgs; [ # or install it as a user package users.users..packages = with pkgs; [ # ... + inputs.hyprpanel.packages.${pkgs.system}.wrapper # this one if you want to avoid overlays/didn't enable them hyprpanel # ... ]; @@ -205,6 +213,7 @@ users.users..packages = with pkgs; [ # install it as a user package with home-manager home.packages = with pkgs; [ # ... + inputs.hyprpanel.packages.${pkgs.system}.wrapper # this one if you want to avoid overlays/didn't enable them hyprpanel # ... ]; @@ -212,6 +221,7 @@ home.packages = with pkgs; [ # or reference it directly in your Hyprland configuration wayland.windowManager.hyprland.settings.exec-once = [ "${pkgs.hyprpanel}/bin/hyprpanel" + "${inputs.hyprpanel.packages.${pkgs.system}.wrapper}/bin/hyprpanel" # this one if you want to avoid overlays/didn't enable them ]; ``` diff --git a/app.ts b/app.ts index 4b7f175..aa9ea1d 100644 --- a/app.ts +++ b/app.ts @@ -1,31 +1,27 @@ import './src/lib/session'; -import './src/scss/style'; -import './src/shared/useTheme'; -import './src/shared/wallpaper'; -import './src/shared/systray'; -import './src/shared/dropdown'; -import './src/shared/utilities'; -import './src/components/bar/utils/sideEffects'; - +import './src/style'; +import 'src/core/behaviors/bar'; import AstalHyprland from 'gi://AstalHyprland?version=0.1'; -const hyprland = AstalHyprland.get_default(); - import { Bar } from './src/components/bar'; -import { DropdownMenus, StandardWindows } from './src/components/menus/exports'; import Notifications from './src/components/notifications'; import SettingsDialog from './src/components/settings/index'; -import { bash, forMonitors } from 'src/lib/utils'; -import options from 'src/options'; import OSD from 'src/components/osd/index'; import { App } from 'astal/gtk3'; import { execAsync } from 'astal'; -import { handleRealization } from 'src/components/menus/shared/dropdown/helpers'; -import { isDropdownMenu } from 'src/lib/constants/options.js'; -import { initializeSystemBehaviors } from 'src/lib/behaviors'; -import { runCLI } from 'src/cli/commander'; +import { handleRealization } from 'src/components/menus/shared/dropdown/helpers/helpers'; +import { isDropdownMenu } from 'src/components/settings/constants.js'; +import { initializeSystemBehaviors } from 'src/core/behaviors'; +import { runCLI } from 'src/services/cli/commander'; +import { DropdownMenus, StandardWindows } from 'src/components/menus'; +import { forMonitors } from 'src/components/bar/utils/monitors'; +import options from 'src/configuration'; +import { SystemUtilities } from 'src/core/system/SystemUtilities'; +const hyprland = AstalHyprland.get_default(); const initializeStartupScripts = (): void => { - execAsync(`python3 ${SRC_DIR}/scripts/bluetooth.py`).catch((err) => console.error(err)); + execAsync(`python3 ${SRC_DIR}/scripts/bluetooth.py`).catch((err) => + console.error('Failed to initialize bluetooth script:', err), + ); }; const initializeMenus = (): void => { @@ -38,7 +34,10 @@ const initializeMenus = (): void => { }); DropdownMenus.forEach((window) => { - const windowName = window.name.replace('_default', '').concat('menu').toLowerCase(); + const windowName = window.name + .replace(/_default.*/, '') + .concat('menu') + .toLowerCase(); if (!isDropdownMenu(windowName)) { return; @@ -54,18 +53,22 @@ App.start({ runCLI(request, res); }, async main() { - initializeStartupScripts(); + try { + initializeStartupScripts(); - Notifications(); - OSD(); + Notifications(); + OSD(); - const barsForMonitors = await forMonitors(Bar); - barsForMonitors.forEach((bar: JSX.Element) => bar); + const barsForMonitors = await forMonitors(Bar); + barsForMonitors.forEach((bar: JSX.Element) => bar); - SettingsDialog(); - initializeMenus(); + SettingsDialog(); + initializeMenus(); - initializeSystemBehaviors(); + initializeSystemBehaviors(); + } catch (error) { + console.error('Error during application initialization:', error); + } }, }); @@ -73,6 +76,6 @@ hyprland.connect('monitor-added', () => { const { restartCommand } = options.hyprpanel; if (options.hyprpanel.restartAgs.get()) { - bash(restartCommand.get()); + SystemUtilities.bash(restartCommand.get()); } }); diff --git a/assets/tokyo-night.xml b/assets/tokyo-night.xml new file mode 100644 index 0000000..0b597a7 --- /dev/null +++ b/assets/tokyo-night.xml @@ -0,0 +1,139 @@ + + + + + HyprPanel - Jas Singh + Tokyo Night color scheme for GtkSourceView + + +