mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
block waydroid entries
This commit is contained in:
parent
410c5ea38f
commit
ba165a69bd
2 changed files with 52 additions and 0 deletions
50
nixcfgs/users/js0ny/programs/block-desktop-entries.nix
Normal file
50
nixcfgs/users/js0ny/programs/block-desktop-entries.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
# TODO: Implement an allow list feature later
|
||||
# allowList = [];
|
||||
blockDesktopEntries = pkgs.writeShellApplication {
|
||||
name = "block-desktop-entries";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
findutils
|
||||
crudini
|
||||
desktop-file-utils
|
||||
];
|
||||
excludeShellChecks = ["SC2016"];
|
||||
text = ''
|
||||
target="''${1:-}"
|
||||
|
||||
if [ -z "$target" ]; then
|
||||
echo "Usage: block-desktop-entries <prefix>"
|
||||
echo "Example: block-desktop-entries waydroid"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
xdg_data="''${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||
app_dir="$xdg_data/applications"
|
||||
|
||||
if [ -d "$app_dir" ]; then
|
||||
echo "Blocking desktop entries starting with: $target in $app_dir"
|
||||
|
||||
find "$app_dir" -type f -name "$target.*.desktop" -exec crudini --set {} "Desktop Entry" NoDisplay true \;
|
||||
|
||||
update-desktop-database "$app_dir"
|
||||
else
|
||||
echo "Applications directory not found: $app_dir"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in {
|
||||
home.packages = [blockDesktopEntries];
|
||||
|
||||
home.activation.blockWaydroidApps = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
if [ -n "$VERBOSE_ARG" ]; then
|
||||
echo "Running block-desktop-entries for Waydroid..."
|
||||
fi
|
||||
|
||||
${lib.getExe blockDesktopEntries} "waydroid"
|
||||
'';
|
||||
}
|
||||
|
|
@ -57,6 +57,8 @@
|
|||
./programs/kitty.nix
|
||||
./programs/wine.nix
|
||||
./programs/anki.nix
|
||||
./programs/libvirt.nix
|
||||
./programs/block-desktop-entries.nix
|
||||
|
||||
# Desktop Linux
|
||||
./programs/desktop/plasma
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue