diff --git a/steam_saver/main.py b/steam_saver/main.py index 53007b3..8a8e304 100644 --- a/steam_saver/main.py +++ b/steam_saver/main.py @@ -8,12 +8,19 @@ VALID_SURFACES = [ 'steam_screen' ] + def get_screen_resolution(): + """ + Gets the current resolution using xrandr + Returns: + tuple: The current resolution as a tuple. + """ command_output = subprocess.check_output(['xrandr']).decode('utf-8') for line in command_output.split('\n'): if '*' in line: return tuple(map(int, line.split()[0].split('x'))) + def main(windowed_mode=False): """ Main scene manager to display the scenes of the application diff --git a/steam_saver/surfaces/steam_screen.py b/steam_saver/surfaces/steam_screen.py index 0df0475..9f675e3 100644 --- a/steam_saver/surfaces/steam_screen.py +++ b/steam_saver/surfaces/steam_screen.py @@ -6,6 +6,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCALE_RATIO = (0.325 / 800.0) SPEED_RATIO = (2.5 / 800.0) + class SteamLogo(pygame.sprite.Sprite): """ A Pygame sprite representing a Steam logo that moves around the screen. @@ -85,7 +86,7 @@ class SteamLogo(pygame.sprite.Sprite): # If this is a mini logo, make it 80% darker if self.is_mini: color_surface.fill(tuple(int(x / 5) for x in new_color)) - else: # If not, make it the generated color. + else: # If not, make it the generated color. color_surface.fill(new_color) # Replace the drawn image with a copy of the base image and apply the randomly generated color.