fix: icons not appearing

This commit is contained in:
tux
2025-06-09 23:12:33 +05:30
parent 2009178b38
commit 1ccd248cc1
2 changed files with 43 additions and 15 deletions

2
app.ts
View File

@@ -3,7 +3,7 @@ import style from "./style.scss";
import windows from "./windows";
import GLib from "gi://GLib?version=2.0";
const icons = `${GLib.get_current_dir()}/assets/icons`;
const icons = `${GLib.get_user_config_dir()}/tpanel/assets/icons`;
App.start({
css: style,

View File

@@ -22,21 +22,49 @@
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.${system} = {
default = ags.lib.bundle {
inherit pkgs;
src = ./.;
name = "tpanel";
entry = "app.ts";
gtk4 = true;
default = let
tpanel = ags.lib.bundle {
inherit pkgs;
src = ./.;
name = "tpanel";
entry = "app.ts";
gtk4 = true;
extraPackages = with ags.packages.${system}; [
hyprland
apps
battery
tray
network
];
};
extraPackages = with ags.packages.${system}; [
hyprland
apps
battery
tray
network
];
};
in
pkgs.runCommand "tpanel" {
nativeBuildInputs = [pkgs.makeWrapper];
} ''
mkdir -p $out/bin
# Copy the bundled app
cp -r ${tpanel}/* $out/
mv $out/bin/tpanel $out/bin/.tpanel-unwrapped
makeWrapper $out/bin/.tpanel-unwrapped $out/bin/tpanel \
--run 'ICONS_DIR="$HOME/.config/tpanel/assets/icons"
# Check if icons directory needs to be set up
if [ ! -d "$ICONS_DIR" ]; then
# Create necessary directories
mkdir -p "$ICONS_DIR"
# Copy icon files if source exists and destination is empty
if [ -d "'"$out"'/share/assets/icons" ]; then
cp -r "'"$out"'/share/assets/icons/"* "$ICONS_DIR/"
echo "Installed tpanel icons to $ICONS_DIR"
fi
fi'
'';
astal = astal.packages.${system};
};