Live data from Hacker News

Modernize your Bash Scripts by adding GUI

medium.com

51–60 of 72 posts

Re: Modernize your Bash Scripts by adding GUI

#51

"Tired of displaying raw text on Console?" Nope. I am a scripter. I will never get tired of raw text, but I sure get tired of GUIs, fast. If the author had pitched this as a way to make the scripter's scripts accessible to others who do not understand scripts, I would have a different response.

I feel like notifications would be the only thing on that list I could see myself using. I know you can make the terminal make a noise, but I sometimes prefer visual alerts.

Many Linux terminals can monitor for activity/silence/bell/process exit. Using these facilities, notifications can be done without modifying the script.

Re: Modernize your Bash Scripts by adding GUI

#52

This is such a backwards way of thinking. Like modernizing math by using little colored blocks with symbols written on them, because your tired of using boring old white and black pencil and paper... It's what you do to entertain children into being interested in something, not how adults get stuff done.

There is a value in making things enjoyable/a bit fun to use. I would prefer my real analysis textbook to have color block. I don't understand the concept that adults need to use product that is boring.

Agreed. Colourful math symbols sounds like a great idea.

Re: Modernize your Bash Scripts by adding GUI

#53

I don't understand this recent trend of modernizing things just for the sake of modernity. Old ideas are often the best ones, why shove everything down the drain every five years?

I think the title is misleading.

There was xdialog 20 years ago. And libnotify has like 15 years too.

I understand "modern bash" as in any other scripting or programming language: It's about what caveats of the language quirks, the optimizations and the failure scenarios, that you solve with your code conventions, which people didn't use to use, some years ago.

Change things for the sake of having something "newer" available for me, is something I try to avoid at all levels of my life.

Re: Modernize your Bash Scripts by adding GUI

#54

Earlier quoted context omitted.

So you didn't read the article and stopped after reading the subhead yet you felt the need to comment anyway.

That "unneeded" comment has received almost as many points as the article itself.

And I'm sure they all didn't actually read the article before coming to the comments section, just like you. Adding their uninformed upvote to your uninformed comment. To be clear, "If the author had pitched this..." is the uninformed part. He makes his intentions clear in the first paragraph.

Re: Modernize your Bash Scripts by adding GUI

#55
post #38
post #13

Earlier quoted context omitted.

Thank you, but I don't use a notification server.

notify-send is for desktop(possibly gnome only?) notifications.

notify-send works by sending notifications to a notification daemon (a.k.a., a "notification server", as defined in the "Desktop Notifications Specification").

notify-send won't work for dudik since, as he said, he doesn't use a notification server.

Re: Modernize your Bash Scripts by adding GUI

#56
What if $DISPLAY is unset? Or if zenity isn't found in $PATH?

If you want to see "user unfriendliness", just present your user with the cryptic error message they'll receive in either of those instances (ask 'em how "modern" they think your script is then)!

I'm obviously not the "target market" for this article anyways but a better example might have included, at the minimum, some basic error checking or perhaps even a graceful fallback to dialog or whiptail or similar.

Re: Modernize your Bash Scripts by adding GUI

#57
post #24

Can’t read the article, guess I’m out of free reads this month/week. I wish there was some kind of rule against posting medium.com links on HN. That would incentivise people to use some other tools, for example dev.to or personal blogs.

HN's only paywall-related rule is against hard paywalls. As long as the paywall is porous, it's OK here, as you can always use archive sites to bypass the paywall.

In this case: https://archive.md/Fvxy4

I doubt HN wants to get into the business of running official campaigns against publishing platforms.

Re: Modernize your Bash Scripts by adding GUI

#58

"Tired of displaying raw text on Console?" Nope. I am a scripter. I will never get tired of raw text, but I sure get tired of GUIs, fast. If the author had pitched this as a way to make the scripter's scripts accessible to others who do not understand scripts, I would have a different response.

I feel like notifications would be the only thing on that list I could see myself using. I know you can make the terminal make a noise, but I sometimes prefer visual alerts.

I use a shell script to flash the terminal background using OSC 11 — green or red depending on the last exit status.

Re: Modernize your Bash Scripts by adding GUI

#59
post #53

I don't understand this recent trend of modernizing things just for the sake of modernity. Old ideas are often the best ones, why shove everything down the drain every five years?

I think the title is misleading. There was xdialog 20 years ago. And libnotify has like 15 years too. I understand "modern bash" as in any other scripting or programming language: It's about what caveats of the language quirks, the optimizations and the failure scenarios, that you solve with your code conventions, which people didn't use to use, some years ago. Change things for the sake of having something "newer" a…

`tksh` (ksh93 plus Tk widgets) 25 years ago.

Re: Modernize your Bash Scripts by adding GUI

#60
The "dialog" command is a nice middle ground that will put a graphical dialog within the terminal, instead of having a dependency on X11.

Like:

  dialog --title "Message" --yesno "Continue?" 6 25
  echo $? # will be 0 for yes, 1 for no
Post reply on HN