[HN Gopher] Let it snow in your terminal
       ___________________________________________________________________
        
       Let it snow in your terminal
        
       Author : ensocode
       Score  : 153 points
       Date   : 2023-12-15 08:56 UTC (14 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | tambourine_man wrote:
       | Screen captures?
        
         | andrelaszlo wrote:
         | https://github.com/sontek/snowmachine#snowmachine
         | 
         | There are some asciinema recording links in the Github readme.
        
           | tambourine_man wrote:
           | Awesome, thanks
        
       | sliken wrote:
       | I'm running ubuntu 23.10 and was pleased to see that xsnow (apt
       | install xsnow) has been updated and "just works". A nice update
       | on xsnow from decades back, but there's a vintage mode for the
       | nostalgic.
       | 
       | The new xsnow added stars, aurora, birds, moon, stars, wind,
       | blowing snow, moose, meteors, reindeer, snow that builds up
       | slowly (the flakes compress) etc. Sadly snow builds up on the
       | settings window, but with weyland it doesn't build up on normal
       | windows.
        
         | readingnews wrote:
         | Time marches on, but I wonder how many new linux users will
         | never see so many cool old programs as they just do not know
         | about them.
         | 
         | Does that thing everyone keeps trying to get us all to move to
         | (I am a hardcore ICEwm / *boxwm user) support all of the old X
         | stuff like xsnow, xscreensaver, etc?
         | 
         | I was sad to realize that xroach is no longer in Debian (or
         | Gentoo, there is a bug report from 2009), however, others still
         | exist:
         | https://unix.stackexchange.com/questions/204241/x-windows-sp...
         | 
         | As SE says, do not forget the "santa" option to xsnow. I forgot
         | about it.
         | 
         | This always reminds me, anyone remember Koules?
         | https://www.ucw.cz/~hubicka/koules/English/koules.html
        
           | globular-toast wrote:
           | There is xwayland, yes.
        
             | funcDropShadow wrote:
             | How does xwayland help here? In order to see what xsnow is
             | about look here [1]. From my understanding such a program
             | is fundamentally against wayland design philosophy. I feed
             | it will be just impossible with Wayland unless you
             | implement it as part of the display server.
             | 
             | [1]: https://www.youtube.com/watch?v=T2Mzg2i6t0I
        
               | Someone wrote:
               | > From my understanding such a program is fundamentally
               | against wayland design philosophy
               | 
               | Against the philosophy but, I think, not completely
               | impossible. Wayland is "just a protocol", so somebody
               | could write a Wayland server that runs in a Wayland
               | window. Then, you could draw anywhere in the outer
               | window, including outside of the inner one(s).
               | 
               | Make the outer window not have a title bar, etc. and run
               | in full screen, and you're done.
               | 
               | Isn't that what XWayland does, except for the fact that
               | it runs X Windows windows inside a full screen Wayland
               | window?
        
           | jmclnx wrote:
           | Yes, I remember koules, played that a lot.
           | 
           | That is the saddest thing about Wayland, a lot of cool little
           | X applications will stop working and be forgotten about.
           | 
           | There is xfishtank, I posted this screen to remind people
           | about it years ago. I kick that off every so often for fun.
           | 
           | https://old.reddit.com/r/unixporn/comments/m9gk2l/ctwm_on_sl.
           | ..
           | 
           | There are many many more of these little clients that will
           | disappear once Linux disables X. Never mind other cool
           | things, a couple I remember: lavaclock, bubblefishymon,
           | catclock, xplanet.
        
             | hollerith wrote:
             | I think only the parts of X that talk directly to the
             | graphics hardware are being abandoned and that many of the
             | things you mention will continue to work.
        
               | jmclnx wrote:
               | Some may, but xfishtank, xplanet and xscreensaver on root
               | window will not.
               | 
               | You can do this to get a matrix wallpaper, this will work
               | with many xscreensaver "utilities"
               | 
               | /usr/libexec/xscreensaver/xmatrix --root
               | 
               | where this is on your distro may be different.
        
               | csdvrx wrote:
               | On wayland, I have an animated wallpaper of a forest: htt
               | ps://www.reddit.com/r/unixporn/comments/11w3zzj/hyprland_
               | ...
               | 
               | Why can't we bring the apps you mention to wayland as a
               | background?
               | 
               | For the foreground, the compositor could even use the
               | alpha channel to draw see through snowflakes: I have foot
               | in quaketerm mode showing what's behind. Replace foot by
               | a smaller snowflake, make more than one of them, and it
               | should be the same!
               | 
               | Or am I missing something?
        
         | wkat4242 wrote:
         | I always loved xfishtank. I still have a strong preference for
         | animated root windows today.
        
         | bee_rider wrote:
         | What a cute program.
         | 
         | It doesn't work very well in i3, sadly. I'm not sure what I
         | expected it to do in a tiling window manager, but it only
         | produces snow on empty workspaces, I guess because otherwise
         | the screen is fully occupied (no room for snowflakes). Also the
         | menu seems to follow me around.
         | 
         | Still neat, though. Maybe I'll try out a non-tiling WM for the
         | holidays...
        
           | sliken wrote:
           | Under settings there is a a button in the center that says
           | "below windows". Click it. It should put the snow in front of
           | the windows. Notice that it will say click again to confirm.
        
             | bee_rider wrote:
             | Hmm, odd, I found that button but it is greyed out.
             | 
             | Thanks for the suggestion though. If I want to see
             | snowflakes I'll can switch to another workspace or look out
             | the window and wait a few days. :)
             | 
             | Edit: When I turn on a compositor, picom, the option
             | becomes clickable. But when I turn on picom, the flakes
             | stop rendering for some reason. It looks like somebody came
             | up with a patched version for i3 + picom, so I guess this
             | is a problem that people have worked on already.
        
         | fl7305 wrote:
         | xsnow even works well under Windows WSL. The whole screen was
         | full with snowflakes, birds, etc.
         | 
         | Impressive that the X11 XShape (Nonrectangular Window Shape
         | Extension) works so well.
        
       | lynx23 wrote:
       | snowjob, haha. Reminds me of the notorious pronview flamewar on
       | debian-devel. Nice to see that language police hasn't fully
       | overtaken FLOSS yet.
        
         | galangalalgol wrote:
         | https://dictionary.cambridge.org/us/dictionary/english/snow-...
        
           | WarOnPrivacy wrote:
           | Young people today.
        
       | stabbles wrote:
       | It's impressive that this can be done in a few lines of bash:
       | 
       | https://gist.github.com/sontek/1505483
        
         | WarOnPrivacy wrote:
         | Script runs in my WSL/Ubuntu but it seems
         | u274$[($RANDOM%6)+3]
         | 
         | wasn't understood properly. I got question boxes. The Slow Rain
         | of Unknowns works for me tho.
        
           | ensocode wrote:
           | could you try 0x274?
        
           | mminer237 wrote:
           | Sounds like an issue with Windows Console Host, not WSL
           | itself as it works for me in WSL in WezTerm.
        
       | schiffern wrote:
       | > You can pass -stack if you want the snow to pile up
       | 
       | The flag is --stack of course (I checked), but somewhere a
       | _helpful_ formatting engine replaced two hyphens with an en dash.
        
         | tux3 wrote:
         | Your experience has been Improved by a smart feature. Pray they
         | don't improve it further!
        
       | chewz wrote:
       | > ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S=["2743".to_i(16)].
       | pack("U*");a={};puts
       | "\033[2J";loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print
       | "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S}
       | \033[0;0H"};$stdout.flush;sleep 0.1}'
        
         | ensocode wrote:
         | awesome!
        
         | SnowingXIV wrote:
         | Saving that alias as I love things done in ruby, really nice.
         | If anyone else was curious about a breakdown on some of the
         | parts.
         | 
         | ruby -e:
         | 
         | This command tells the system to execute the following Ruby
         | code.
         | 
         | C=`stty size`.scan(/\d+/)[1].to_i This part gets the size of
         | the terminal window. stty size returns the dimensions of the
         | terminal (rows and columns) .scan(/\d+/) extracts the numbers
         | from this output, and[1] gets the second number, which
         | represents the number of columns and then to_i converts this
         | number to an integer. The result is stored in the variable C.
         | 
         | S=["2743".to_i(16)].pack("U*") This line creates the snowflake
         | character. "2743".to_i(16) converts the hexadecimal number 2743
         | (which represents the Unicode code point for a snowflake) into
         | an integer, and .pack("U*") converts this integer into a UTF-8
         | character.
         | 
         | a={} Initializes an empty hash a. This hash will keep track of
         | the position of each snowflake.
         | 
         | puts "\033[2J" This ANSI escape code clears the terminal
         | screen.
         | 
         | loop{...} An infinite loop to keep the animation going.
         | 
         | Inside the loop.
         | 
         | a[rand(C)]=0 Randomly places a new snowflake in the top row at
         | a random column.
         | 
         | a.each{|x,o|;...} Iterates over each snowflake.
         | 
         | Inside the iteration.
         | 
         | a[x]+=1 Moves the snowflake down one row. print
         | "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S} \033[0;0H" This part
         | uses ANSI escape codes to move the cursor and draw the
         | snowflakes. It moves the cursor to the old position of the
         | snowflake, prints a space (to erase the old snowflake), then
         | moves to the new position and prints the snowflake character.
         | $stdout.flush Flushes the standard output buffer, ensuring that
         | all output is displayed immediately. sleep 0.1 Pauses the loop
         | for a short time (0.1 seconds) to control the speed of the
         | animation.
        
         | dustinsterk wrote:
         | This is amazing.
        
       | JKCalhoun wrote:
       | Hilariously old-school. Even the name, _snowjob_ , feels
       | wonderfully anachronistic in 2023.
       | 
       | Definitely getting TRS-80, Robert Frost (1) vibes from this one.
       | 
       | (1) https://youtu.be/j-Zcog5o_p0?t=10
        
       | andy99 wrote:
       | cat /dev/random | tr -c 'ox0.@' ' '
       | 
       | (poor man's version)
        
         | mi_lk wrote:
         | oh I love this!
        
         | marginalia_nu wrote:
         | $ cat /dev/random | tee >(aplay -r 8000) | tr -c 'ox0.@' ' '
         | 
         | If you really want to conjure a howling blizzard (R.I.P
         | headphone users though)
        
       | WarOnPrivacy wrote:
       | Going to try this in my pfsense console because I am a bad admin.
        
       | smusamashah wrote:
       | There use to be a tiny software at the time of windows XP. It
       | created a falling snow effect on your screen (they were just tiny
       | white pixels as i remember) which collected on sharp edges
       | including icons, taskbar and text and accumulate over time. It
       | would disappear when a window was moved. Anyone remember its
       | name?
        
         | technothrasher wrote:
         | The original concept was a screensaver for Macintosh, which was
         | soon after ported to X Windows as "Xsnow". Several different
         | versions were made for Windows. Here's one:
         | https://janswaal.home.xs4all.nl/WinSnow/
        
       | forward1 wrote:
       | Python? We don't need no stinkin' Python.                   while
       | sleep 0.1; do printf "%-$(( ( RANDOM % `tput cols` ) -
       | 1))s\e[0;$(( 30 + ($RANDOM % 8) ))m*\n" ; done
        
         | ensocode wrote:
         | Nice - if you can do a handstand :)
        
           | JoBrad wrote:
           | Impressive, but mine was also floating up vs down. :)
        
         | folmar wrote:
         | by bash wants more ()s                 while sleep 0.1; do
         | printf "%-$(( ( RANDOM % $(tput cols) ) - 1))s\e[0;$(( 30 +
         | ($RANDOM % 8) ))m\*\n" ; done
        
         | swingingFlyFish wrote:
         | hahhah I just tried this. I'm impressed!
        
         | tetris11 wrote:
         | Shout out to Alphapapa's excellent snow.el script for Emacs
         | 
         | https://github.com/alphapapa/snow.el
        
       | sontek wrote:
       | Wow, surprising to see this on the frontpage this morning! This
       | is my old script, the better one to use is called snowmachine:
       | * https://github.com/sontek/snowmachine         *
       | https://pypi.org/project/snowmachine/
       | 
       | Which is also on docker, homebrew, nix, etc. It probably makes
       | sense to update the post to link to one of these since they'll
       | provide a better experience
        
         | dfee wrote:
         | I thought your handle sounded familiar. You used to hang out in
         | the pyramid irc channel.
         | 
         | Thanks for your help those many years ago.
        
           | sontek wrote:
           | Pyramid is still the best web framework
        
         | shusaku wrote:
         | Hopefully this post inspires someone to take on the snow plow
         | character feature request
        
         | surge wrote:
         | Bug Report: My terminal color settings are a bit unusual and
         | I'm getting yellow snow.
        
           | smilespray wrote:
           | PSA: Never eat the yellow snow
        
           | sontek wrote:
           | There is a `--snow-color` option :D
        
         | ensocode wrote:
         | sontek, thanks for the update, didn't notice that new version.
         | I requested a link change.
        
         | dang wrote:
         | Ok, we'll switch to that github link from
         | https://pypi.org/project/snowjob/ above. Thanks!
        
       | treypitt wrote:
       | This is awesome...cmatrix is a similar program I like based on
       | The Matrix, available on homebrew
        
       | kiriberty wrote:
       | Didn't work in zsh on my Mac. Fixed the issues and added a couple
       | of effects:
       | 
       | https://github.com/lasanthak/snowjob/blob/main/snowjob.sh
        
       | jeanlucas wrote:
       | Me in Brazil letting it snow on my terminal while it's currently
       | 100degF
        
       | eatbitseveryday wrote:
       | Snowing on https://mullvad.net/
        
       | agys wrote:
       | An unrelated version of snow on the ASCII playground (runs in the
       | browser, interactive):
       | 
       | https://play.ertdfgcvb.xyz/#/1640473937099
        
       ___________________________________________________________________
       (page generated 2023-12-15 23:00 UTC)