Giter Club home page Giter Club logo

Comments (8)

RAVENz46 avatar RAVENz46 commented on July 20, 2024 1

Hey there, @RAVENz46, I appreciate that someone does the nix package!

I don't have experience with nix packages, but can see the error in modifiying the .desktop file: Please change

  --replace 'Exec=€ExecCommand€' 'Exec=${pname}'

to

  --replace '€ExecCommand€' '${pname} %u'

The %u is part of .desktop specification, and is actually placeholder for url that desktop environment substitutes.

Yes! Now, link correctly passed.

Another issue I can see from the video is that none of the browsers are identified as specific browser types, i.e no browser profiles are shown.

There can be two reasons for that:

1. `<app-binary-dir>/resources/lib/application-repository.toml` is not found (be aware that the "lib" here does not refer to standard linux lib folders, and is just a subdirectory for resource files - I might need to rename it to remove confusion).

2. `.desktop` files are not found/named in a standard way for the other browsers

I'm still beginner of nix, so IDK how/able to fix these.
Anyway, I'm fine with it so I close this issue. Thank you!

from browsers.

liias avatar liias commented on July 20, 2024

Hey there, @RAVENz46, I appreciate that someone does the nix package!

I don't have experience with nix packages, but can see the error in modifiying the .desktop file:
Please change

  --replace 'Exec=€ExecCommand€' 'Exec=${pname}'

to

  --replace '€ExecCommand€' '${pname} %u'

The %u is part of .desktop specification, and is actually placeholder for url that desktop environment substitutes.

from browsers.

liias avatar liias commented on July 20, 2024

Another issue I can see from the video is that none of the browsers are identified as specific browser types, i.e no browser profiles are shown.

There can be two reasons for that:

  1. <app-binary-dir>/../resources/lib/application-repository.toml is not found (be aware that the "lib" here does not refer to standard linux lib folders, and is just a subdirectory for resource files - I might need to rename it to remove confusion).
  2. .desktop files are not found/named in a standard way for the other browsers

from browsers.

RAVENz46 avatar RAVENz46 commented on July 20, 2024

I changed $out/lib to $out/resources/lib then, it seems work cause chromium and firefox's name placed bit higher.

Screenshot from 2024-01-31 00-01-38

Final result
{ stdenv
, lib
, fetchzip
, autoPatchelfHook
, cairo
, gdk-pixbuf
, gtk3
}:

stdenv.mkDerivation rec {
  pname = "browsers";
  version = "0.5.0";

  src = fetchzip {
    url = "https://github.com/Browsers-software/browsers/releases/download/${version}/browsers_linux.tar.gz";
    hash = "sha256-5BiJ8G77kLlLZr7Ut0jY/hp4zncWsWO55vyCSp6NPqk=";
    stripRoot=false;
  };

  nativeBuildInputs = [
    autoPatchelfHook
  ];

  buildInputs = [
    stdenv.cc.cc.lib
    cairo
    gdk-pixbuf
    gtk3
  ];

  installPhase = ''
    mkdir -p $out/{bin,share/applications,resources}
    mv x86_64/${pname} $out/bin
    install -m 444 \
        -D software.Browsers.template.desktop \
        -t $out/share/applications
    substituteInPlace \
        $out/share/applications/software.Browsers.template.desktop \
        --replace 'Exec=€ExecCommand€' 'Exec=${pname} %u'
    cp -r lib $out/resources
    for size in 16 32 128 256 512; do
      mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
      cp icons/"$size"x"$size"/software.Browsers.png $out/share/icons/hicolor/"$size"x"$size"/apps/software.Browsers.png
    done
  '';

  meta = with lib; {
    description = "Open the right browser at the right time";
    homepage = "https://github.com/Browsers-software/browsers";
    changelog = "https://github.com/Browsers-software/browsers/blob/${src.rev}/CHANGELOG.md";
    license = with licenses; [ asl20 mit ];
    maintainers = with maintainers; [ ];
    mainProgram = "browsers";
  };
}

from browsers.

liias avatar liias commented on July 20, 2024

I corrected my previous comment about resources location. So the tree should be basically like this:

/usr/share/software.Browsers/
  ├─ bin/
  │  └─ browsers
  └─ resources/
     ├─ i18n/en-US/builtin.ftl
     ├─ icons/512x512/software.Browsers.png
     └─ lib/application-repository.toml

It's also safe to add symlink to the binary if you need it somewhere else.

I can see in your screenshot, that profile names are still not shown, so likely something is still missing (also need to refresh apps from the 3-dot menu).

from browsers.

RAVENz46 avatar RAVENz46 commented on July 20, 2024

Thanks again for all your help.
I add i18n directory, now settings and browser profile seems fine.
Icon directory may be unnecessary under resourses dir, this is because nix specific thing.
But I found something should fix, so let me ask you.

  1. launching browsers from .desktop, dock icon work however, from command line, launcher like rofi and clicking link, dock icon not display( You can see in video).
  2. Browsers appear inside of Browsers(you can also see it in video). However, there are no settings to hide options. This option is not available on linux or my fault?
Kooha-2024-01-31-11-41-41.webm

from browsers.

liias avatar liias commented on July 20, 2024

Thanks again for all your help. I add i18n directory, now settings and browser profile seems fine. Icon directory may be unnecessary under resourses dir, this is because nix specific thing. But I found something should fix, so let me ask you.

Awesome! Only the 512x512 icon is used under resources dir actually, to be shown in About dialog.
FYI, be aware, that in next release resources/lib/ will be renamed to resources/repository/

  1. launching browsers from .desktop, dock icon work however, from command line, launcher like rofi and clicking link, dock icon not display( You can see in video).

Actually, it's designed that dock icon would never be shown (like when you right click or alt+tab, you don't see icons for those dialogs), hopefully the fact that it is shown is small enough to ignore for now ;)

  1. Browsers appear inside of Browsers(you can also see it in video).

There's a very simple filter right now - if the .desktop file is named as software.Browsers.desktop, then it will skip it from the list.

However, there are no settings to hide options. This option is not available on linux or my fault?

Bad design from my side - you need to right click with your mouse on the browser and click "Hide"

from browsers.

RAVENz46 avatar RAVENz46 commented on July 20, 2024

Okay, now almost everything fine.
Thanks!!!

from browsers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.