HNHacker News
TopNewBestAskShowJobs

JNRowe

7,427 karma · joined February 3, 2014

username at gmail.com ; Feel free to get in touch.

[ my public key: https://keybase.io/jnrowe; my proof: https://keybase.io/jnrowe/sigs/orH3nyNqAK4vkIpcxn2HRihHPV2HX80SyDwM9cR5xnw ]

submissionscomments
JNRowe··on Preparing for KDE Plasma's Last X11-Supported Release
If you want an out of the box test then playing with river-classic¹ is probably a good place to start. It gives a feel for where you can go, without having to put too much effort in.

For example, it has pluggable layouts where instead of pulling in a lua module(such as awful.layout) in awesome you'll run an external process which handles events. You can even run multiple managers and switch between them with bindings, or write a custom one to scratch that itch. If you're happy with just awful's .suit.tile.right and .suit.max then basically any backend will do.

This is why it feels like a reasonable path off awesomewm to me. I always considered awesomewm to be the WMConstructionKit, and while river changes how you interact there is still a nice route to extensibility. The newer direction even more so than the -classic offshoot.

¹ https://codeberg.org/river/river-classic

JNRowe··on Preparing for KDE Plasma's Last X11-Supported Release
I settled on river¹ after a couple of decades with awesomewm. Tiling and tagging work in a way you'd expect coming from awesomewm, but nothing else does. I made my mind up because having to use workspaces and manual tiling is a far harder sell than implementing the functionality I want on top of a decent base.

If anything it reminds me more of the experience with using awesome v2(before lua); you generate a config file for the base WM, and then build up external tooling to drive it how you see fit. The experience has been quite pleasant, but I do enjoy twiddling.

¹ https://codeberg.org/river/river

Edit: I just checked my dotfiles. Awesome went in on 2008-06-09, and river on 2024-06-30. Happy and largely uneventful two years on river.

JNRowe··on Movwin: My (Unpublished) TUI Framework
There are plenty of examples where menu display and help texts can be toggled.

For example, aptitude has `Aptitude::UI::Menubar-Autohide` and midnight commander has options in the layout menu to disable menu/buttons/etc. That way beginners get to learn through discovery, and may later choose to switch to calling the menu/action with a keypress. Both of those respond to "standard" F1 for help too.

Would I prefer emacs M-x and C-h style interaction in mc? Yeah, probably. I'm used to it everywhere else(such as zsh). However, as a long term user I can execute basically all the functions even though I've long since disabled the buttons, menus and hints.

JNRowe··on ASCII and Unicode quotation marks (2007)
There is a portable unicode¹ tool available, and it is packaged in a bunch of distributions. I'll spare us the full output, but "unicode a→z" produces something like:

    U+0061 LATIN SMALL LETTER A
    UTF-8: 61 UTF-16BE: 0061 Decimal: a Octal: \0141
    a (A)
    Uppercase: 0041
    Category: Ll (Letter, Lowercase); East Asian width: Na (narrow)
    Unicode block: 0000..007F; Basic Latin
    Bidi: L (Left-to-Right)
    Age: Assigned as of Unicode 1.1.0 (June, 1993)
    …
    U+2192 RIGHTWARDS ARROW
    …
    U+007A LATIN SMALL LETTER Z
¹ https://github.com/garabik/unicode
JNRowe··on Ki Editor - an editor that operates on the AST
If you want to relive it then simh¹ with mame² might be an option. There appears to be some support for VT11³, along with docs⁴ to use as a starting point.

No, I'm not claiming to have read all one hundred pages already. However, from what I have read I'd love to see a functional demo.

¹ https://simh.trailing-edge.com/

² https://www.mamedev.org/

³ https://github.com/simh/simh/blob/master/PDP11/pdp11_vt.c

⁴ https://wiki.mamedev.org/index.php/MAME_and_SIMH

JNRowe··on Libghostty is coming
FWIW, zsh has a commands hash to make stuff like this potentially easier and cleaner. The following isn't quite how I'd do it, but is functionally equivalent.

    (( $+commands[vim] )) && alias vi=vim
    (( $+commands[nvim] )) && alias vi{,m}=nvim
JNRowe··on GNU Midnight Commander
You can, it even ships with two files you can use as examples in mc.{emacs,vim}.keymap. The vim one has my favorite comment in a config file:

    [editor]
    # No remapping, just use vim instead of mcedit
Given that you can specify the bindings config to use at startup with --keymap you can even configure task specific sets of bindings. This combined with extfs and custom menus makes it a great way to make a personal interface to non-file data sources too.
JNRowe··on Libdex 1.0 – deferred execution for gnome
Direct links to the docs¹ and repo²

¹ https://gnome.pages.gitlab.gnome.org/libdex/libdex-1

¹ https://gitlab.gnome.org/GNOME/libdex/

JNRowe··on Journaling using Nix, Vim and coreutils
There is also a `-b` flag to get it back in to the shape you'd expect from cal. I find the week column easier to read in that form:

   w| Mo Tu We Th Fr Sa Su
  31|              1  2  3
  32|  4  5  6  7  8  9 10
Perhaps worth noting that ncal's -w is ISO-8601 compliant¹, which may surprise some people around new year as week numbers can reset in December or January.

[Said as someone who aliases cal to "ncal -wb" mostly just to get the correct first day of the week for their locale.]

¹ https://en.wikipedia.org/wiki/ISO_week_date

JNRowe··on Writing simple tab-completions for Bash and Zsh
There is the complete-filename function that only completes filenames in bash, bound to M-/ by default. You can use that in any place you want a filename where "complete"(the function normally bound to tab) would do something you don't desire.

There are a collection of other non-context aware completion functions that are bound by default too, useful for example when you when you wish to complete hostnames in a for-loop.

zle has what is largely a significant superset of this, the documentation is spread about between the zshzle and zshcomp* manpages.

JNRowe··on Why you can't color calibrate deep space photos
There is even a Damien Hirst¹ haphazardly spread about the surface for that purpose.

One of the great gifts Pillinger² had was being able to shake up public interest via pop culture; there was also call sign by Blur for Beagle 2.

¹ https://www.researchgate.net/figure/Spot-Painting-Beagle-2-C...

² https://en.wikipedia.org/wiki/Colin_Pillinger

JNRowe··on Mathpad: A mathematical keypad for students and professionals
Somewhat predictably zsh also has a digraphs¹ feature, via the insert-composed-char function². Supported characters can be seen in source³, and beyond that there is the insert-unicode-char² function for when you need it.

I flit between regular compose key input and zsh/vim digraphs in a way that makes no sense to me whatsoever. Compose ^1, AltGr+1 or C-k 1S all kind of feel natural to me, but the advantage of the ZLE method is that you can also use it to preview characters which can be useful if you want to test something out while in another widget or find the hex value to insert using some other tool.

¹ https://datatracker.ietf.org/doc/html/rfc1345#section-2.3

² https://zsh.sourceforge.io/Doc/Release/User-Contributions.ht...

³ https://github.com/zsh-users/zsh/blob/master/Functions/Zle/d...

JNRowe··on Creating Debian packages from upstream Git
To be fair, if all you want is a package with Debian you can do that too. Just copy files in to a dir(like package() in your Arch example), write a 10 line DEBIAN/control in there(like the preamble in your Arch example), and call "dpkg-deb --build". The linked document is describing something different, joeyh has a short "why?"¹ from years ago that may be helpful.

¹ https://joeyh.name/blog/entry/upstream_git_repositories/

JNRowe··on GTK Krell Monitors
At least once a year for the past couple of decades I'll receive an email from a user that makes me want to modernize bfm¹. However, I've never managed to get an auto-scaling version to work with reasonable performance, which is unbelievably annoying for such a simple tool. You can sort of hit the target for gkrellm-bfm while still depending on GTK2, or for the standalone bubblefishymon wmapplet where you can use a modern GTK² or jump straight to SDL.

Never in a way that doesn't noticeably chew additional CPU though, and definitely not for both use cases. It upsets me each time I reply "no, not happening without patches". Perhaps it is time to release an Electron version or one that just burns a whole CPU core so it isn't lost forever ;)

¹ It used to just be people with crazy setups, now it is basically any screen given their higher DPI.

² As it is right now I don't even have a system that I can use last release on.

JNRowe··on Migration to rust-coreutils in [Ubuntu] 25.10
Some of the background was explained before¹, along with a heap of comments when it was posted here².

Probably still not enough information for an outside observer(like me), but they probably assume more familiarity with the project for posts on their discourse.

¹ https://discourse.ubuntu.com/t/carefully-but-purposefully-ox...

² https://news.ycombinator.com/item?id=43353240

JNRowe··on Seer: A GUI front end to GDB for Linux
Might not be as direct as you'd like, but all well managed¹ GNU projects ship a NEWS file in their tarball. In this case you can also read it from savannah² without fetching the tarball.

¹ https://www.gnu.org/prep/standards/standards.html#NEWS-File

² https://svn.savannah.gnu.org/viewvc/ddd/trunk/doc/NEWS?view=...

JNRowe··on Org Mode Syntax Cheat Sheet (2017)
A link to the documentation¹ and repo² to save others a few steps. Examples are helpfully linked toward the end of the page and its source in the README.

¹ https://hitchdev.com/orji/

² https://github.com/crdoconnor/orji

JNRowe··on OpenBSD ksh shell now forbids NUL byte
Fair whack of comments from a different post about this last week¹.

¹ https://news.ycombinator.com/item?id=41636070

JNRowe··on The Modern CLI Renaissance
When vim plugins change the effect of K, all they're likely doing is setting keywordprg¹. You can do the same yourself, fex to display info on the commit under cursor you'd use "setl kp=git\ show". You can write little script wrappers to fetch whatever custom resources you want, or you can up your game by writing vim commands so that you can use a count prefix to influence behaviour of the fetch too.

¹ https://vimdoc.sourceforge.net/htmldoc/options.html#'keyword...

JNRowe··on Window Maker: X11 window manager with the look and feel of the NeXTSTEP UI
Related: There is an in-development Wayland compositor for the Window Maker look and feel called wlmaker¹. It is already quite usable, but is very barebones right now.

¹ https://github.com/phkaeser/wlmaker

JNRowe··on Markdown is meant to be shown (2021)
Stolen, thanks! I just played around with something like that in vim¹, and it works great.

I have a tooling issue with your method, perhaps in the same manner as you feel about C-i. To me "italicize $count previous words" makes far more sense than expanding the region on repeated calls. Although to be fair I can wrap over visual mode for that functionality which would feel more comfortable to me; "ge" end of previous word, "v", $navigation, ...

My point - to the extent I have one - is that there is probably a degree of personal comfort that colors our reactions to people using C-i.

¹ Basically "imap <C-S-8> <Esc>bcw*<C-r>-*<C-o>w". I'll give it some more thought, along with adding v:count and non-* support, before it hits my vimrc.

JNRowe··on Metaprogramming in Bash
If you're a zsh user there is a fun^wquirky way to achieve similar functionality using the MULTI_FUNC_DEF¹ option. zsh allows you to define multiple functions at the same time, so you can parametrize functions with something like:

    build_ssh qa_ssh test_ssh() {
        echo ${(U)0%_*}_SYSTEMIP
    }
    build_ssh  # Produces BUILD_SYSTEMIP
    qa_ssh  # Produces QA_SYSTEMIP
(You'd need the 'P' flag to perform secondary expansion to get the value of *_SYSTEMIP if you were using this for the same reason as in the post).

You can even use brace expansion in your function definition, iff you define it using the function keyword like "function {build,qa,test}_ssh()".

---

There might be a nice solution to this with fish too, as you could create per-machine symlinks in your ~/.config/fish/functions to add a new machine.

¹ https://zsh.sourceforge.io/Doc/Release/Options.html

JNRowe··on xdg-override: change default application temporarily on Linux
[In the spirit of elucidation, and not general meanness…]

Like jojo14 points out Python has the shlex module, and it is definitely useful in these situations even if just for quote(). And, os.system() is basically never safe with external input. Without proper escaping you're one click from code execution, for example with the input "file:///etc/issue%3Becho%20whoops" or "http://example.com/';echo whoops'".

It doesn't appear to matter in this instance, but you can feed check_output() with the stdin argument, which removes the need for using shell=True. shell=True in other paths could easily lead to unwanted code execution without thorough escaping.

JNRowe··on Troubleshooting: Terminal Lag
You could maybe find out where the delay is by using st's Xembed support? Create a window with tabbed¹ in a tiling layout, open st in to it with "st -w <xid> -e true". If it is close to the monocle time, it is probably the other windows handling the resize event that is causing the slowdown not the layout choice.

To prove it to myself: I'm using river² and I can see a doubling-ish of startup time with foot³, iff I allow windows from heavier apps to handle the resize event immediately. If the time was a little longer(or more common) I'd be tempted to wrap the spawn along the lines of "kill -STOP <other_clients_in_tag>; <spawn & hold for map>; kill -CONT <other_clients_in_tag>" to delay the resize events until my new window was ready. That way the frames still resize, but their content resize is delayed.

¹ https://tools.suckless.org/tabbed/

² https://codeberg.org/river/river

³ https://codeberg.org/dnkl/foot

JNRowe··on Troubleshooting: Terminal Lag
You can choose the behaviour with the --shell option¹. The default behaviour is nice because it allows you to benchmark pipelines easily, but if you want to change it you can.

¹ https://github.com/sharkdp/hyperfine#intermediate-shell

JNRowe··on Troubleshooting: Terminal Lag
If we're handing out tips, then as noted in a few examples from the article hyperfine is even more useful when called with multiple commands directly. It presents a concise epilogue with the information you're probably trying to gleam from a run such as yours:

    $ hyperfine -L arg '1,2,3' 'sleep {arg}'
    …
    Summary
      sleep 1 ran
        2.00 ± 0.00 times faster than sleep 2
        3.00 ± 0.00 times faster than sleep 3
If your commands don't share enough in common for that approach then you can declare them individually, as in "hyperfine 'blib 1' 'blob x y' 'blub --arg'", and still get the summary.
JNRowe··on Bashsimplecurses: Simple curses library made in bash to draw terminal interfaces
There is also viddy¹ for a slightly more featureful watch alternative, if you're open to a new non-default package. Being able to recall old output and search within it can be extremely useful.

Admittedly, it isn't quite a drop in replacement, but the usage is close enough that even aliasing it is unlikely to cause [many] problems.

¹ https://github.com/sachaos/viddy/

JNRowe··on Bashsimplecurses: Simple curses library made in bash to draw terminal interfaces
Zsh users get a bundled curses module; see zsh/curses¹ in zshmodules(1). It is a very thin wrapper, so it works how you'd expect from other uses. There is a tetris implementation using zsh/curses that ships with zsh², and you can use it as a nice comparison to the non-curses implementation that also comes with zsh³.

I've used zsh/curses a few times to hack together little interfaces, and it is quite workable. It makes things far simpler once you start reaching for terminfo's capabilities that require you to think about state too much. A friend of mine wrote a little mblaze⁴ frontend using it, and it felt like using single mailbox mutt with less than a hundred lines of code.

I was expecting the linked project to be a loadable module too given that bash also supports them, but it is actually a little more interesting to look at given it implements a bunch of the behaviour itself on top of tput calls.

¹ https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-...

² https://github.com/zsh-users/zsh/blob/master/Functions/Misc/...

³ https://github.com/zsh-users/zsh/blob/master/Functions/Misc/...

⁴ https://git.vuxu.org/mblaze/about/

JNRowe··on Kawaii – A Keychain-Sized Nintendo Wii
"Some sort of surfing game" immediately screams California Games¹ to me. There was surfing² plus a few other sports, and it is still good fun if you find yourself at a museum/nerd house that has one.

¹ https://en.wikipedia.org/wiki/California_Games

² https://www.youtube.com/watch?v=ql2S-wXa-H8

JNRowe··on Things I know about Git commits
`git add -p` can also work for new files, it just requires you to call `git add --intent-to-add` first. After using -N/--intent-to-add you'll see that the file is registered in the status output, and -p will work exactly how like you expect.

I often find myself spiking things then breaking them back down with -N and repeated `git commit -p` to form a reasonable history. The workflow seems to really suit my mind. However, it does require some testing vigilance if you're manually editing the hunks for clarity on top of simply splitting them up.

Page 1 of 21Next →