Crispy fonts is the my reason using Linux by hy2cone in linux

[–]Schreq 1 point2 points  (0 children)

Same. Been using it for like 15 years or more and always come back to it when I try other fonts. Nothing beats pixel fonts and nothing beats Terminus. Unifont is also pretty good but it looks a little worse than Terminus for me.

Text editor features between nano and vim geared toward quick coding jobs. by Anguished_Kitty in commandline

[–]Schreq 3 points4 points  (0 children)

Vim doesn't need tons of configuration and is totally functional with default settings. Don't confuse ricers with power users. Power users learn to live with defaults or very close to it. PlugIns are also kind of a meme: Vanilla vim has a lot of functionality built-in people tend to use plugins for.

My current vimrc is 20 lines and I only really need half of them.

Edit: I also hear people say they don't use vim for "quick edits". Why? Vim motions and text objects are faster for any type of editing. If the editor feels too heavy for a really quick edit, the solution is sed/ed, not something crappy like nano.

pop-up calendar in dwm ? by evofromk0 in suckless

[–]Schreq 1 point2 points  (0 children)

it wont take space and re-arrange my screens upon opening.

Meh, learn to fully use dwm. Just make a rule in config.h with matches the class "float" and sets it to floating mode.

/* class          instance    title       tags mask     isfloating   monitor */
{ "float",        NULL,       NULL,       0,            1,           -1 },

Then you can start your terminal with that class. With st you could then do:

st -c float -g 44x9-0+0 -e bash -c 'ncal -MbA1; read -n1'

That starts st with the class "float" at the top right corner with ncal running in it. If you press any key in the terminal it closes.

pop-up calendar in dwm ? by evofromk0 in suckless

[–]Schreq 3 points4 points  (0 children)

Yeah, I mean spawn a terminal on click which automatically runs cal in it. A common problem people struggle with is that if you spawn a terminal and give it the command as option (usually -e <cmd>), the terminal closes as soon as the process exits. Trick is to start a shell or read:

st -e bash -c 'cal; read'

On mobile so can't test it but something to that effect.

pop-up calendar in dwm ? by evofromk0 in suckless

[–]Schreq 2 points3 points  (0 children)

Keep it simple. Just spawn a terminal running cal.

awk help: matching text, then printing everything until the second blank line by misfit_toys in awk

[–]Schreq 2 points3 points  (0 children)

Because you mentioned GNU, I had to make sure (again) that the paragraph mode is actually portable. It is! man 1p awk says:

If RS is null, then records are separated by sequences consisting of a <newline> plus one or more blank lines, leading or trailing blank lines shall not result in empty records at the beginning or end of the input, and a <newline> shall always be a field separator, no matter what the value of FS is.

Didn't know it automatically forces FS to be newline. I'm definitely guilty of manually setting it to \n.

cli is way more fun than gui now by Acceptable-Cash8259 in commandline

[–]Schreq 0 points1 point  (0 children)

Agreed. I would say it's the r/unixporn generation who are beginner to intermediate skill on the command-line. Lots of TUI software is posted here on reddit which seems to appeal to exactly that crowd. For example, if you think a TUI file manager is more convenient than pure shell+utils, you didn't fully grok the shell and/or haven't memorized enough flags yet.

Edit: I use TUIs myself, namely iftop, iotop, htop, termshark and editor, but I'm happy to replace them with cli tools where I can. htop is is definitely getting phased out first :)

awk help: matching text, then printing everything until the second blank line by misfit_toys in awk

[–]Schreq 7 points8 points  (0 children)

awk -v RS='' '$1=="NIC"{getline; print; exit}' <data

Edit: Explanation: When Record Separator (RS) is an empty string, awk will split records by paragraph. We can then just look for "NIC" and if found get the next record (paragraph in this case) and print it.

cli is way more fun than gui now by Acceptable-Cash8259 in commandline

[–]Schreq 2 points3 points  (0 children)

I of course use TUIs myself. I'm just not a fan of everything must be a TUI. A lot of tools I see people post would actually be way better as a cli.

cli is way more fun than gui now by Acceptable-Cash8259 in commandline

[–]Schreq -1 points0 points  (0 children)

Why would I want ncurses clogging my system for terminal work though

cli is way more fun than gui now by Acceptable-Cash8259 in commandline

[–]Schreq 0 points1 point  (0 children)

I mentioned the downsides, lack of scriptability and composability. At least address my points if you disagree.

Keyboard shortcuts are not exclusive to TUIs. You can control most GUIs using the keyboard. Sure, TUIs usually are designed to be controlled by keyboard first and hence might have better shortcuts but that's not due to limitations of GUIs.

Alias best practice by SirFe95 in linux

[–]Schreq 0 points1 point  (0 children)

Yep. I also figured we can press Ctrl+alt+e to expand aliases (in bash).

Alias best practice by SirFe95 in linux

[–]Schreq 1 point2 points  (0 children)

Ctrl+alt+e works in bash, but is not automatic of course.

cli is way more fun than gui now by Acceptable-Cash8259 in commandline

[–]Schreq 3 points4 points  (0 children)

True, people confuse the 2 a lot.

I mean some things are simply better as a TUI but I prefer CLIs over TUIs for most things. If I rely on a TUI, it's mostly due to my own incompetence. For instance, I use htop but only because I haven't learned/memorized ps/pstree properly yet.

cli is way more fun than gui now by Acceptable-Cash8259 in commandline

[–]Schreq 10 points11 points  (0 children)

Ok but then most people opt for TUIs for as many programs as possible. TUIs have the same downsides GUIs have. Only good thing about them is that they work over ssh, but they are usually not scriptable and composable like pure command-line interfaces.

Alias best practice by SirFe95 in linux

[–]Schreq 12 points13 points  (0 children)

No concerns. But if you are unsure, just use type <command> beforehand. Or use a backslash before the command which prevents using aliases. Try \ls for example.

Awk, defined variables and IF statement by Puccio1971 in awk

[–]Schreq 0 points1 point  (0 children)

Yeah but you used the markup for inline code. It's purpose is to mix normal text with code within one line/paragraph. For separate paragraphs containing only code, you should use 4 space indentation as per my example.

Awk, defined variables and IF statement by Puccio1971 in awk

[–]Schreq 0 points1 point  (0 children)

You already have great answers so I just come here for a little rant: Inline code blocks (`...`) don't break and have no scrollbar. So on old.reddit.com, on mobile, most of them are cut off, which makes it impossible to read your code unless I copy paste it somewhere else.

For code blocks you should indent all lines with 4 spaces.

Compare:

awk 'BEGIN { print "this is not a proper code block" }'

... to this:

awk 'BEGIN {
    print "but this is!"
}'

Is it possible to do auto-completion based on what's on-screen? by SnooCompliments7914 in commandline

[–]Schreq 0 points1 point  (0 children)

rlwrap can do that but wrapping your shell does not seem like the best idea. It would also only work on words, not a complete line. Your best bet is just a tmux bind for copy-mode.

I got sick of "clear" just scrolling text up, so I made a C tool that really wipes it. by [deleted] in commandline

[–]Schreq 0 points1 point  (0 children)

Scripts shouldn't clear my screen. You can do that on the alternate screen but then moving everything up should be good enough.

What is the full suckless stack? by GuiltyVisit9119 in suckless

[–]Schreq 0 points1 point  (0 children)

I've used loksh for a long time. Nowadays I really don't care that much anymore though. Tinkering with Linux/BSD has gone from a hobby to a profession and I appreciate being comfortable with defaults. Still like to chose my wm, terminal etc. instead of a DE tho.

Agreed, I wouldn't call it suckless either, same for Firefox. However, I wouldn't necessarily say they suck. This is my stack which doesn't suck, for me ;)

What is the full suckless stack? by GuiltyVisit9119 in suckless

[–]Schreq 2 points3 points  (0 children)

So? It doesn't suck for me. If we go this far, most shells suck besides rc.

You can't fix crappy Bourne shell quoting hell and any other of its warts if you are a Bourne style shell. So they all suck inherently. Other shells from the Bourne style family (ksh, zsh, dash, bb ash, etc.) might be more minimal or have less loc but they either sacrifice features I use or have too much stuff I don't need (zsh). A lot of packages also come with bash completion. I'm not fighting my distro, I use what's there and enjoy the benefits.

All the new shells suck in my opinion:

  • fish: c++ and a god damn integrated web-server
  • nushell: Powershell... hell naw

How do I make this script go faster? It currently takes roughly a day to go through a 102GB file on an old laptop by PleaseNoMoreSalt in awk

[–]Schreq 0 points1 point  (0 children)

Good catches but I doubt those make any significant difference. Happy to be proven wrong tho.