Live data from Hacker News

You Don't Need a GUI

github.com

171–180 of 439 posts

Re: You Don't Need a GUI

#171
GUI can work across multiple windows/contexts while CLI commands are bound to just one context.

For instance:

I can open two file browsers in different directories and simply drag and drop a file from one to the other.

But there is no command (AFAIK) that allows you to copy a file from the current working directory of one terminal session to another. If for instance tmux or some other terminal emulator would allow something like:

    cp file.txt >/file.txt
to copy from one window to the next, that would be useful.

On linux you could sort of write a script for that, which uses the pid and gets the cwd from /proc/>/cwd.

Re: You Don't Need a GUI

#172
post #106

I think this document is a bit too belligerent. "STOP DOING xxx". Really, users should be free to do as they wish. I prefer using console a lot (though I use GUI a lot too!). But I wouldn't force others to do so. Educating them how (if they're interested) is a great thing. Making it sound like they're doing it wrong is not. PS: One thing where a GUI really shines is picking a bunch of files from a folder and moving t…

> Finding all JPGs in a huge tree of folders and moving them all to one central folder.

That's easy in Windows File Explorer. Type Ctrl+F, then *.jpg, then Enter. Wait for the search to finish. Type Ctrl+A to Select All, then Ctrl+X to Cut. Then go to the target folder, in the same or a different File Explorer, and Ctrl+V to Paste.

Someone who isn't familiar with the keyboard shortcuts can do the same with the mouse. Either way, if they have ever edited a document and done something similar with cutting and pasting text, there is nothing new to learn except understanding that the same steps work in File Explorer.

It also works in the default file manager in Ubuntu with minor changes: don't hit Enter after typing the search text, do click in the result list before the Ctrl+A.

Re: You Don't Need a GUI

#173
post #129

Earlier quoted context omitted.

Just about everything in that list I do from a terminal. But I practically live in the thing. I’ve literally had trouble finding my home directory in the Mac Finder UI. Never had that issue in the terminal ~

Finder used to be much more intuitive yet Apple seem to do something on every macOS release that somehow makes it worse.

Just today I had to give permissions to cron of all things to use the disk on my new computer. What do they think crontabs are used for?

Re: You Don't Need a GUI

#174

GUI is better for discoverability of the most common scenarios (I can right-click to see everything that can be done with the file, including some third party programs). But it's bad for composing programs and interoperability, often it's impossible or very hard to automate (how many people are doing UI testing? there is a good reason it's not many -- it completely sucks) TUI/console is very good for interoperability…

I like your point about discoverability.

What if there was such a thing as a right click menu for command line programs?

Like if I type ffmpeg or youtube-dl with no args, it lists the 3 most common ways to use it, and maybe allows an interactive CLI menu where you can build up the correct argument list by answering a few questions.

I would love the most useful commands to look like:

  ffmpeg --resizeVideoTo input.mp4 50% (0.5 also works of course)

  youtube-dl --do-the-thing-you-know-i-want-to-do 

  cd --show-a-menu-of-the-last-10-paths-i-changed-to

  git --i-fd-up-my-last-commit-please-help

Most realistically, I'd want the invocation without arguments to show an interactive menu of the top 3 uses, so I could just select what I want to do.

Or if I provide a partial argument list, it should ask me to supply the rest of the args. Or maybe it should guess and do the right thing.

For example:

  ffmpeg input.mp4

  >> What would you like to do with input.mp4? 1) resize 2) rotate 3) crop 4) change video format

  youtube-dl URL
  
  >> Download the best video for URL to the current path? Press Enter to confirm. 

  cd

  >> Here are the last 5 paths you switched to. Choose 1...5.

  find

  >> Start typing a partial file name and we will show the top 10 matches from this path and its subdirectories. CTRL- to turn on regular expression search.

Re: You Don't Need a GUI

#175

I’d argue that if you’re using an ncurses based UI, you no longer have a command line interface, and you’re not scriptable anymore. Which is fine of course, but what you really have at that point is a rather ugly and limited GUI...

On the other hand, my laptop will probably last days without refueling running some TUI in my terminal vs modern GUI software

Re: You Don't Need a GUI

#176
post #174

GUI is better for discoverability of the most common scenarios (I can right-click to see everything that can be done with the file, including some third party programs). But it's bad for composing programs and interoperability, often it's impossible or very hard to automate (how many people are doing UI testing? there is a good reason it's not many -- it completely sucks) TUI/console is very good for interoperability…

I like your point about discoverability. What if there was such a thing as a right click menu for command line programs? Like if I type ffmpeg or youtube-dl with no args, it lists the 3 most common ways to use it, and maybe allows an interactive CLI menu where you can build up the correct argument list by answering a few questions. I would love the most useful commands to look like: ffmpeg --resizeVideoTo input.mp4 5…

Would tab completion be a startingpoint for this?

Re: You Don't Need a GUI

#177
post #139

In Windows, you can do dir /s graph.db to find any occurrence of graph.db in any subdirectory| The linux equivalent seems to be tree -f | grep -i graph\.db However, this seems to be taking approximately forever Edit - 20 minutes later, still not done, is this an O(N^2) operation? Edit - 35 minutes later, the wrong regex... have to do it again tree -f | grep graph.db

Or: find . -name graph.db

Thank you so much, that did it, almost instantly.

  root@Flipper:/# find . -name graph.db
  ./home/mike/.config/grit/graph.db

Re: You Don't Need a GUI

#178
post #174

GUI is better for discoverability of the most common scenarios (I can right-click to see everything that can be done with the file, including some third party programs). But it's bad for composing programs and interoperability, often it's impossible or very hard to automate (how many people are doing UI testing? there is a good reason it's not many -- it completely sucks) TUI/console is very good for interoperability…

I like your point about discoverability. What if there was such a thing as a right click menu for command line programs? Like if I type ffmpeg or youtube-dl with no args, it lists the 3 most common ways to use it, and maybe allows an interactive CLI menu where you can build up the correct argument list by answering a few questions. I would love the most useful commands to look like: ffmpeg --resizeVideoTo input.mp4 5…

This is a good path to go.

I like the 3 top uses.

As for questions, maybe when I write:

ffmpeg gui

I'll get a gui menu where I can select all the options, and that will generate a textual command for me that I could use further.

The hard part of course is creating GUI's for all the console apps.

Can that be done mechanically?

Re: You Don't Need a GUI

#179
post #176
post #174

Earlier quoted context omitted.

I like your point about discoverability. What if there was such a thing as a right click menu for command line programs? Like if I type ffmpeg or youtube-dl with no args, it lists the 3 most common ways to use it, and maybe allows an interactive CLI menu where you can build up the correct argument list by answering a few questions. I would love the most useful commands to look like: ffmpeg --resizeVideoTo input.mp4 5…

Would tab completion be a startingpoint for this?

Yes, I love tab completion.

When I enabled tab completion for git and google cloud CLI, my life became much better.

However, I still think there needs to be a "right click menu" for command line programs. Someone needs to determine the 3 most common uses and make it so that --help lets me choose one of them by pressing 1, 2, or 3.

Right now, --help usually gives me something that is difficult for me to understand, especially if I have never used that command before.

Tab completion works great if I have used the command before and want to save time.

Re: You Don't Need a GUI

#180
post #5

Most the things in this list are things that you technically don't need a GUI for, but a GUI is so much better that doing it in command line is pointless. For instance, you could do all those file operations in the terminal, but chances are you're already browsing files using a GUI file manager so opening a terminal to do those things is pointless. Terminal is great if you want to do something complicated that a GUI…

Quote: "..you want to do something complicated that a GUI program can't handle..." Name one thing that a GUI program can't handle, I dare you. Me, on the other hand, I can point you to a trillion dollar business that uses only GUI and not a single CLI, to say the least.

Here's an easy one: take all the files in a directory, including files nested in subdirectories, pick ten random ones, and open 'em in a new Firefox window.

    firefox (find . -type f | shuf -n10)
I doubt your computer comes with a GUI program that can do that for you. My point is that CLIs can easily be plugged into each other whichever way you want, but GUIs (except in some niches like audio) aren't built that way for some reason.
Post reply on HN