Live data from Hacker News

Command Line Tools to Break Your Dependence on the GUI

putorius.net

21–30 of 79 posts

Re: Command Line Tools to Break Your Dependence on the GUI

#22
post #19
post #5

A dictionary? I mean, that's neat and all, but not all that useful is it? I might check the weather once a day, tops. This is better solved by having a widget on my smartphone. Same for the dictionary, and same for short google searches too (Firefox Focus). I had a twinge of hope that this might have been more of an introduction to using the terminal effectively on Linux for diagnoses. I'm new to Linux, and every tim…

I interpreted the premise of the article as weaning people off of GUI with everyday trivial tasks that can be done via CLI. I myself do almost all my work from the CLI, but it was this blog post [0], specifically the open, pbpaste, and screenshot commands, that got me into dabbling with my shell, before I understood the power and convenience of shell scripting. I try to get novices interested in the shell via youtube…

There are a few worthy webextensions that can do the basics of what youtube-do does. Enough to only need the command line for batch stuff or more advanced conversions.

Re: Command Line Tools to Break Your Dependence on the GUI

#23

This is really cool. Has anyone made a version for Windows?

There's plenty of options; WSL2 which feels more like a virtualised system but with access to your files (careful!), or the msys system shipped with git-bash, or the more traditional Cygwin.

Line endings can become an issue, as can the various BOM characters.

Re: Command Line Tools to Break Your Dependence on the GUI

#24
post #13

Work in progress, but sixel support may be coming to mainline tmux: git clone git://github.com/tmux/tmux git switch sixel git checkout b1904c9b8db514133d3372aac13b2ff0b2093cc3 This will give you the "placeholder" box for sixels in terminals that do not support sixel (but you should use mlterm on Linux or mintty on Windows) The upcoming feature is to replace this placeholder box by unicode art for the sixels, cf https…

Yes. This (image support in general in Terminal emulators and Terminal multiplexers) is currently being actively discussed here: https://gitlab.freedesktop.org/terminal-wg/specifications/is... Many important people are there, e.g. the Tmux maintainer/developer Nicholas Marriott, the Mintty developer, some Xterm.js developer, and others.

The discussions are very interesting, but I'm not sure they are going anywhere. Sixels might win by default. It's not a bad thing. Sixels in 16m colors are quite versatile. But let's suppose that, eventually, a better standard for terminal image support might emerge.

Anything that can already support sixels won't be too hard to change to support this new standard, unless it doesn't use pixels -- though it would be neat if this standard was vector based, like ReGIS: https://en.wikipedia.org/wiki/ReGIS - I want SVG in my terminal :-)

For now, sixels already work reliably for most of the things I do. So now, I concentrate on the applications, to make sure most of my workflow can be console based.

Re: Command Line Tools to Break Your Dependence on the GUI

#25
post #6

Does anyone know of a similar tool to the weather api wttr.in for stock prices?

There's surfraw(1)'s "--stockquote" argument.

I've looked around for a freely-available source of raw stock quote data without success (though not invested too much time in it). I've written my own wrapper around Yahoo's stock quotes page (https://finance.yahoo.com/) which strips off everything but the prices themselves (see sample output: https://pastebin.com/gR2j3zB3)

However that's not something which will query for a specified portfolio.

It does feed xrootconsole nicely though.

Re: Command Line Tools to Break Your Dependence on the GUI

#26
post #7

If you use Haskell, then I'd recommend just using ghci over bc because you can't do floating point stuff in bc: 1/3 0 Whereas ghci, or your language's REPL, will likely do better: > 1/3 0.3333333333333333

You can set up bc to any scale by adding

    scale=INTEGER
for some reasonable INTEGER, say, 6, to your ~/.bc file (you need to also export BC_ENV_ARGS=~/.bc), or alias bc to bc -l). After having gp-pari fail after a brew upgrade I started using bc instead and have been relatively happy so far (although I miss isprime and factors which I used sparingly)

Re: Command Line Tools to Break Your Dependence on the GUI

#28
post #5

A dictionary? I mean, that's neat and all, but not all that useful is it? I might check the weather once a day, tops. This is better solved by having a widget on my smartphone. Same for the dictionary, and same for short google searches too (Firefox Focus). I had a twinge of hope that this might have been more of an introduction to using the terminal effectively on Linux for diagnoses. I'm new to Linux, and every tim…

You can bind dict to the "keywordprg" query key ('K') in vim.

By default, that's tied to 'man', which lets you look up a particular command in the system manpages. Swap that to dict for text files (say, filetype markdown or HTML), and you've now got a dictionary lookup for any given word. Not sure of spelling or meaning? Position cursor on word and hit 'K', and you'll get the word's definition, or a match of near-spellings.

The dict database can also be extended to other datasets -- anything with a keyword-result relationship. On Debian, this includes the US Census "Tiger" files (thanks to Bruce Perens for buying a copy and sharing them to the project), which lets you look up any specific city or place name in the United States.

You can specify the dictionary you want to use on the commandline, or write a shell alias or function to query a specific database, say:

    dictzip () { /usr/bin/dict -d gaz2k-zips "$*" | ${PAGER:-less}; }
    dictplace () { /usr/bin/dict -d gaz2k-places "$*" | ${PAGER:-less}; }
Which allows you to query ZIP Codes or place names without otherwise mentioning the dictionary on the commandline.

There are numerous other query tools bundled together in tools such as surfraw(1) (https://packages.debian.org/buster/surfraw), with 123 separate query targets.

Or you can write your own. I've got a wrapper around the NOAA's weather six-day forecast page which dumps a text-formatted version of just the forecast text (a lot of ugly sed and awk). Having to write programmes to remove the text other programmes lard onto a simple data request is Where We Are Now in Today's WWW.

Or a lookup for the Online Etymological Dictionary:

    etym () { \w3m -T text/html "https://www.etymonline.com/word/${1}"; }
(w3m is escaped '\' to byapass the alias I've defined, 'alias w3m="w3m -B"', which defaults to opening my bookmarks file if no argument is given.)

Learning what you're typing, and what it does, and what the underlying logic are, is much of the fun.

Re: Command Line Tools to Break Your Dependence on the GUI

#29
post #7

If you use Haskell, then I'd recommend just using ghci over bc because you can't do floating point stuff in bc: 1/3 0 Whereas ghci, or your language's REPL, will likely do better: > 1/3 0.3333333333333333

You can set up bc to any scale by adding scale=INTEGER for some reasonable INTEGER, say, 6, to your ~/.bc file (you need to also export BC_ENV_ARGS=~/.bc), or alias bc to bc -l). After having gp-pari fail after a brew upgrade I started using bc instead and have been relatively happy so far (although I miss isprime and factors which I used sparingly)

Do note that setting scale breaks modulo tho.
Post reply on HN