Closed sei40kr closed 3 years ago
I found a suitable Go library though I haven't tested it yet.
I'm not sure if the library does anything else than what's already defined in the dock code. From README:
The package defines sensible defaults for XDG variables which are empty or not present in the environment.
I haven't really tested this, but the XDG dirs should be detected here, if defined.
@nwg-piotr Thanks for your reply.
The paths to the resources under /images
are still hardcoded. For examples:
https://github.com/nwg-piotr/nwg-dock/blob/e2937bd48f92957656743c782f30aa6db6cb7c5a/main.go#L142
https://github.com/nwg-piotr/nwg-dock/blob/e2937bd48f92957656743c782f30aa6db6cb7c5a/main.go#L162
I'm using NixOS and it can't install resources under /usr/share, so I want to install them under /nix/store
, called Nix store.
I see.
The simple patch I added will only work if XDG_DATA_HOME value ends with "/". Does it? If not, I'll have to modify several lines.
Could you try building from the data_home
branch and tell me if it helps?
@nwg-piotr Sorry for late response.
I tried and it works fine! Thank you.
```nix { buildGoModule, fetchFromGitHub, gtk3, gtk-layer-shell, lib, makeWrapper , pkg-config, stdenv, ... }: with lib; buildGoModule rec { pname = "nwg-dock"; version = "v0.1.5"; src = fetchFromGitHub { owner = "nwg-piotr"; repo = "nwg-dock"; rev = version; sha256 = "089c418jz0cs3gw0q17zm2b96bjfb23w9c5ni4zgim8lrxx0lbnk"; }; vendorSha256 = "sha256-HyrjquJ91ddkyS8JijHd9HjtfwSQykXCufa2wzl8RNk="; nativeBuildInputs = [ makeWrapper pkg-config ]; propagatedBuildInputs = [ gtk-layer-shell gtk3 ]; postInstall = '' mkdir -p $out/share/nwg-dock cp -r images $out/share/nwg-dock cp config/* $out/share/nwg-dock wrapProgram $out/bin/nwg-dock --set XDG_DATA_HOME : $out/share ''; meta = { description = "GTK3-based dock for sway"; homepage = "https://github.com/nwg-piotr/nwg-dock"; license = licenses.mit; platforms = platforms.linux; }; } ```
Strictly, XDG_DATA_DIRS
is for system resources and XDG_DATA_HOME
is for user resources. So it would be better to look up both locations. I'll fix it when I have time.
Thank you.
I need to set up Nix one day, for pure curiosity.
Describe the bug I noticed some paths to XDG directories
/usr/share
are hardcoded, which prevents nwg-dock working on some Linux environments that don't obey Linux FHS such as NixOS.To Reproduce Steps to reproduce the behavior:
XDG_DATA_DIRS
orXDG_DATA_HOME
and put the resources thereExpected behavior The dock icons are shown correctly.
Screenshots
Desktop (please complete the following information):
Additional context I found a suitable Go library though I haven't tested it yet. https://github.com/adrg/xdg