Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/bamf: generate bamf-2.index #55470

Closed
wants to merge 2 commits into from

Conversation

worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Feb 9, 2019

Bamf wants this index of certain desktop file keys
so it can match application windows to desktop files.

I'm guessing it's obviously faster than enumerating all
the directories for them.

See: https://git.launchpad.net/bamf/tree/src/bamf-matcher.c

Motivation for this change

Recalled that I probably should be doing this.
However I think that the index won't have any data
from programs installed with nix-env.

Not sure what I'd need to do to fix this (activation script?).

Things done
  • Built Pantheon in a vm and checked that the system result had the index
I probably need to check if bamfdaemon is actually using the index and this isn't naive.
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@worldofpeace worldofpeace added the 6.topic: pantheon The Pantheon desktop environment label Feb 10, 2019
@worldofpeace
Copy link
Contributor Author

@jtojnar Any advice for

However I think that the index won't have any data
from programs installed with nix-env.
Not sure what I'd need to do to fix this (activation script?).

?

@jtojnar
Copy link
Contributor

jtojnar commented Feb 11, 2019

I have no idea how nix-env works.

@worldofpeace
Copy link
Contributor Author

Ahh never mind, this should be fine since this fragment will be inherited into the user environment

${config.environment.extraSetup}

inherit (config.system.path) ignoreCollisions postBuild;

Bamf wants this index of certain desktop file keys
so I can match application windows to desktop files.

I'm guessing it's obviously faster than enumerating all
the directories for them.

See:  https://git.launchpad.net/bamf/tree/src/bamf-matcher.c
@mmahut
Copy link
Member

mmahut commented Aug 20, 2019

Are there any updates on this pull request, please?

bamf_matcher_add_new_monitored_directory (self, directory);

- bamf_file = g_build_filename (directory, BAMF_INDEX_NAME, NULL);
+ bamf_file = g_build_filename ("/run/current-system/sw/share/applications", BAMF_INDEX_NAME, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break the package on other distros?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was to lazy to patch it to probably construct file names in $XDG_DATA_DIRS/applications/bamf.index.
Loading a bamf index won't work on other distros, but further down in the code it can load the table from a directory if the file doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also have no motivation to support bamf on non-nixos linux.

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 3, 2020
@stale
Copy link

stale bot commented Apr 7, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 7, 2021
@bobby285271 bobby285271 added 2.status: wait-for-upstream Waiting for upstream fix (or their other action). 6.topic: pantheon The Pantheon desktop environment labels Sep 5, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 5, 2021
@bobby285271
Copy link
Member

bobby285271 commented Sep 5, 2021

Pantheon will probably drop BAMF in a future release, see elementary/wingpanel-indicator-power#208.

Since this is only used in Pantheon, adding the Pantheon label for this PR so I can recheck this when packaging 6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants