Update FredOS-Gaming.nix

This commit is contained in:
ediblerope 2026-01-05 09:43:56 +00:00 committed by GitHub
parent e6c777e924
commit 5adc751bc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,7 +16,48 @@
];
};
};
# Steam icon fix script
systemd.user.services.steam-icon-fix = {
description = "Fix Steam Proton game icons";
wantedBy = [ "default.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = false;
};
script = ''
STEAM_DIR="$HOME/.local/share/Steam"
DESKTOP_DIR="$HOME/.local/share/applications"
# Wait a bit for Steam to create desktop files
sleep 5
for desktop_file in "$DESKTOP_DIR"/steam_app_*.desktop; do
[ -f "$desktop_file" ] || continue
app_id=$(basename "$desktop_file" | sed 's/steam_app_\(.*\)\.desktop/\1/')
icon_file=$(find "$STEAM_DIR/appcache/librarycache/$app_id" -name "*.jpg" 2>/dev/null | head -n 1)
if [ -f "$icon_file" ]; then
${pkgs.gnused}/bin/sed -i "s|Icon=steam_icon_$app_id|Icon=$icon_file|" "$desktop_file"
echo "Fixed icon for App ID: $app_id"
fi
done
'';
};
# Path watcher to trigger the fix when desktop files change
systemd.user.paths.steam-icon-fix-watcher = {
wantedBy = [ "default.target" ];
pathConfig = {
PathChanged = "%h/.local/share/applications";
Unit = "steam-icon-fix.service";
};
};
# Bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;