Compare commits

..

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

View file

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