mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 12:51:54 +05:30
fix: icons not appearing
This commit is contained in:
2
app.ts
2
app.ts
@@ -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,
|
||||
|
56
flake.nix
56
flake.nix
@@ -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};
|
||||
};
|
||||
|
Reference in New Issue
Block a user