Update FredOS-Gaming.nix
This commit is contained in:
parent
e6c777e924
commit
5adc751bc7
1 changed files with 42 additions and 1 deletions
|
|
@ -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
|
# Bootloader
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue