Compare commits

...

No commits in common. "0b38a75977ead0fff06f1fd67048c52ec5d289df" and "90d12289c530ce187405d10367ff15c58314a70f" have entirely different histories.

View file

@ -10,10 +10,10 @@
recursive = true;
};
systemd.user.services = {
"adwaita-for-steam-install" = {
systemd.user = {
services."adwaita-for-steam-css-patcher" = {
Unit = {
Description = "Install Adwaita for Steam";
Description = "Adwaita for Steam CSS Patcher";
};
Install = {
WantedBy = [ "default.target" ];
@ -23,46 +23,26 @@
cd ~/.local/share/Steam/steamui/css/
if ! test -f "library.css"; then
echo "Steam library.css not found, make sure that you have succesfully executed Steam once!"
exit 1;
echo "Steam library.css not found, make sure that you have succesfully executed Steam once!"
exit 1;
fi
if ! ${pkgs.gnugrep}/bin/grep -Fxq "/*patched*/" library.css; then
echo "Patching steam library..."
${pkgs.coreutils}/bin/mv library.css library.original.css
${pkgs.coreutils}/bin/touch library.css
echo "/*patched*/
@import url("https://steamloopback.host/css/library.original.css");
@import url("https://steamloopback.host/libraryroot.custom.css");" >> library.css
echo "Patching steam library..."
${pkgs.coreutils}/bin/mv library.css library.original.css
${pkgs.coreutils}/bin/touch library.css
echo "/*patched*/
@import url("https://steamloopback.host/css/library.original.css");
@import url("https://steamloopback.host/libraryroot.custom.css");" >> library.css
# Pad new library file until it has the same size as the original
${pkgs.coreutils}/bin/truncate -r library.original.css library.css
# Pad new library file until it has the same size as the original
${pkgs.coreutils}/bin/truncate -r library.original.css library.css
echo "Done."
else
echo "Steam library is already patched, nothing to do."
echo "Steam library is already patched, nothing to do."
fi
'';
};
};
"adwaita-for-steam-uninstall" = {
Unit = {
Description = "Uninstall Adwaita for Steam";
};
Service = {
ExecStart = pkgs.writeShellScript "adwaita-for-steam-uninstaller" ''
cd ~/.local/share/Steam/steamui/css/
if ! test -f "library.original.css"; then
echo "Original library.css not found, nothing to undo."
exit 0
fi
echo "Restoring original Steam library.css..."
${pkgs.coreutils}/bin/mv library.original.css library.css
echo "Done."
'';
};
};
};
}