Skip to content

Instantly share code, notes, and snippets.

@nothub
Last active February 20, 2023 13:40
Show Gist options
  • Select an option

  • Save nothub/91ff81bd945eb8f1e6af08492a13ff75 to your computer and use it in GitHub Desktop.

Select an option

Save nothub/91ff81bd945eb8f1e6af08492a13ff75 to your computer and use it in GitHub Desktop.
updated asciiquarium
This project has moved to: https://github.com/nothub/asciiquarium
@latipun7

Copy link
Copy Markdown

Thank you.
For Arch users, this could be installed with:

yay -S asciiquarium-transparent-git

See: https://aur.archlinux.org/packages/asciiquarium-transparent-git

@nothub

nothub commented Sep 15, 2022

Copy link
Copy Markdown
Author

Thank you. For Arch users, this could be installed with:

yay -S asciiquarium-transparent-git

See: https://aur.archlinux.org/packages/asciiquarium-transparent-git

Oh cool :) 👍

@quantenzitrone

Copy link
Copy Markdown

This version of asciiquarium doesn't reload automatically when the screen size changes. Is that intentional?

@nothub

nothub commented Nov 4, 2022

Copy link
Copy Markdown
Author

This version of asciiquarium doesn't reload automatically when the screen size changes. Is that intentional?

No, this is not intentional. Thanks for the report.

@planet36

planet36 commented Dec 9, 2022

Copy link
Copy Markdown

This version of asciiquarium doesn't reload automatically when the screen size changes. Is that intentional?

No, this is not intentional. Thanks for the report.

This fixes it for me.
Change
elsif ($in eq 'r') {last;} # Redraw (will recreate all objects)
to
elsif ($in eq 'r' || $in eq KEY_RESIZE()) {last;} # Redraw (will recreate all objects)

Version 1.1 fixed this.
https://robobunny.com/projects/asciiquarium/html/?page=1

@nothub

nothub commented Jan 9, 2023

Copy link
Copy Markdown
Author

This version of asciiquarium doesn't reload automatically when the screen size changes. Is that intentional?

No, this is not intentional. Thanks for the report.

This fixes it for me. Change elsif ($in eq 'r') {last;} # Redraw (will recreate all objects) to elsif ($in eq 'r' || $in eq KEY_RESIZE()) {last;} # Redraw (will recreate all objects)

Version 1.1 fixed this. https://robobunny.com/projects/asciiquarium/html/?page=1

Oh perfect, thanks for your help! I gonna apply this change soon when I have some spare time.

@nothub

nothub commented Jan 9, 2023

Copy link
Copy Markdown
Author

@planet36 Thanks 👍 added in the latest revision.

@phanirithvij

Copy link
Copy Markdown

How to make it so any keypress (other than r, p) will quit it?
Edit: Found a way. Added elsif ($in ne '-1') {quit();}, is that correct? Works for me.

patch (also including a commandline option)
--- asciiquarium.pl	2023-02-19 20:38:49.837074714 +0530
+++ /usr/bin/asciiquarium	2023-02-19 20:51:34.291968027 +0530
@@ -116,13 +116,15 @@
 
 my $classic = 0;
 my $transparent = 0;
+my $screensaver = 0;
 my $print_version = 0;
 
 GetOptions(
     'classic'     => \$classic,
     'transparent' => \$transparent,
+    'screensaver' => \$screensaver,
     'version'     => \$print_version,
-) or die "Try: $0 --classic --transparent\n";
+) or die "Try: $0 --classic --transparent --screensaver\n";
 
 if ($print_version) {
     VERSION_MESSAGE();
@@ -201,6 +203,7 @@
             if    ($in eq 'q') {quit();}  # Exit
             elsif ($in eq 'r' || $in eq KEY_RESIZE()) {last;}  # Redraw (will recreate all objects)
             elsif ($in eq 'p') {$paused = !$paused;}
+            elsif ($screensaver && $in ne '-1') {quit();} # Exit for any key (screensaver mode)
 
             $anim->animate() unless ($paused);
         }

@nothub

nothub commented Feb 19, 2023

Copy link
Copy Markdown
Author

Oh cool, thanks a lot @phanirithvij! I gonna add your patch to the application.

@nothub

nothub commented Feb 19, 2023

Copy link
Copy Markdown
Author

I have moved the file to its own git repo so contributions can be added in a cleaner way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment