Skip to content

Instantly share code, notes, and snippets.

@nothub
Last active February 20, 2023 13:40
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nothub/91ff81bd945eb8f1e6af08492a13ff75 to your computer and use it in GitHub Desktop.
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

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
Copy link
Author

nothub commented Sep 15, 2022

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

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

@nothub
Copy link
Author

nothub commented Nov 4, 2022

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
Copy link

planet36 commented Dec 9, 2022

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
Copy link
Author

nothub commented Jan 9, 2023

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
Copy link
Author

nothub commented Jan 9, 2023

@planet36 Thanks 👍 added in the latest revision.

@phanirithvij
Copy link

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
Copy link
Author

nothub commented Feb 19, 2023

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

@nothub
Copy link
Author

nothub commented Feb 19, 2023

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