u/ClassroomHaunting333

[Discussion] Optimising history matching pool architecture (Trade-offs in prefix filtering)

Hi everyone

Not sure if this is the right sub, but I already tried other subs like r/zsh , r/commandline and others, but no luck.

I am working on a personal project and while refining the functions/history matching logic to address early mutation typos like ccd instead of cd, the project faces a classic architectural trade-off between output cleanliness and edge-case coverage.

Currently, the single-character prefix filter provides reliable and clean output pool for 99% of user typos, including mutations inside trailing directory arguments:

local -a narrowed_entries=()
if [[ ${#last_typo} -ge 1 ]]; then
    local prefix="${last_typo[0,1]}"
    narrowed_entries=(${(M)hist_entries:#${prefix}*})
else
    narrowed_entries=("${hist_entries[@]}")
fi

The Dilemma I am facing

This approach goes blind if a user makes a typo on the absolute first character of a command (for example typing vcd functions instead of cd functions).

To resolve this 1% edge case, experimenting with multi-character character sets or dual-prefix lookups (matching vc*) successfully injects the intended target cd back into the array pool.
However, it introduces a significant downside. It drastically widens the filter pool, pulling in hundreds of irrelevant historical commands (like vimvlc), or anything that happen to share those initial letters. This pollutes the fzf layout and introduces messy, unrelated suggestions that degrade the user experience.

Personal Choice of Direction

I personally lean towards sacrificing the 1% first-character typo to guarantee a completely stable, clean, and highly relevant list of suggestions for the other 99% of daily interactions. A predictable interface that behaves reliably is more valuable than an over-engineered matching layout that makes messy guesses.

Opening this up to the community: Should I stick to the strict, clean single-character baseline, or is there a performant, dependency-agnostic way to handle first-character mutations without introducing buffer noise into the interactive menu?

reddit.com
u/ClassroomHaunting333 — 3 days ago

[Help] Optimising history matching pool architecture (Trade-offs in prefix filtering)

Hi everyone

I am working on a personal project and while refining the functions/history matching logic to address early mutation typos like ccd instead of cd, the project faces a classic architectural trade-off between output cleanliness and edge-case coverage.

Currently, the single-character prefix filter provides an exceptionally reliable and clean output pool for 99% of user typos, including mutations inside trailing directory arguments:

local -a narrowed_entries=()
if [[ ${#last_typo} -ge 1 ]]; then
    local prefix="${last_typo[0,1]}"
    narrowed_entries=(${(M)hist_entries:#${prefix}*})
else
    narrowed_entries=("${hist_entries[@]}")
fi

The Dilemma I am facing

This approach goes blind if a user makes a typo on the absolute first character of a command (for example typing vcd functions instead of cd functions).

To resolve this 1% edge case, experimenting with multi-character character sets or dual-prefix lookups (matching [vc]*) successfully injects the intended target cd back into the array pool.
However, it introduces a significant downside. it drastically widens the filter pool, pulling in hundreds of irrelevant historical commands (like vim, vlc), or anything that happen to share those initial letters. This pollutes the fzf layout and introduces messy, unrelated suggestions that degrade the daily user experience.

Personal Choice of Direction

I personally lean towards sacrificing the 1% first-character typo to guarantee a completely stable, clean, and highly relevant list of suggestions for the other 99% of daily interactions. A predictable interface that behaves reliably is arguably more valuable than an over-engineered matching layout that makes messy guesses.

Opening this up to the community: Should I stick to the strict, clean single-character baseline, or is there a performant, dependency-agnostic way to handle first-character mutations without introducing buffer noise into the interactive menu?

Thank you for your time reading this post. All suggestions and advice welcome.

reddit.com
u/ClassroomHaunting333 — 3 days ago

Best approach to handle early string mutations in a large history array without losing prefix performance?

Hi everyone,

I am currently working on a lightweight Zsh plugin that fixes shell typos (in one of the functions) by pulling the closest match from history and passing a filtered pool into fzf for the final selection.

The plugin calculates the matching background array by stripping unique entries out of the $history associative array and applying a standard parameter expansion filter:

local -a narrowed_entries
narrowed_entries=()
if [[ ${#last_typo} -ge 2 ]]; then
    local prefix="${last_typo[1,2]}"
    narrowed_entries=(${(M)hist_entries:#${prefix}*})
else
    narrowed_entries=("${hist_entries[@]}")
fi

This works beautifully for 99% of commands because limiting the pool via a two-character prefix constraint keeps performance rapid and slashes terminal lag.

However, I have run into an edge case when a typo happens right on the second index. For example, a user typos cd apps as ccd apps.

Because of the prefix constraint cc*, it misses the clean history candidate cd apps.

If I drop the constraint down to a single character ${last_typo[1,1]}, it catches second-character stutters perfectly but expands the pool size massively.

If a user typos the absolute first character (like vcd apps instead of cd), even a single-character prefix constraint goes blind unless I drop filtering entirely and dump the raw history file straight into fzf, which introduces bloat.

Are there any native Zsh array manipulation tricks or expansion flags that can handle approximate matches or character proximity offsets cleanly inside the script logic before hitting the UI pipe, without destroying arrays or causing visible lag on massive histories?

Thank you in advance for any suggestions or help.

reddit.com
u/ClassroomHaunting333 — 4 days ago
▲ 0 r/zsh

Best approach to handle early string mutations in a large history array without losing prefix performance?

Hi everyone,

I am currently working on a lightweight Zsh plugin that fixes shell typos (in one of the functions) by pulling the closest match from history and passing a filtered pool into fzf for the final selection.

The plugin calculates the matching background array by stripping unique entries out of the $history associative array and applying a standard parameter expansion filter:

local -a narrowed_entries
narrowed_entries=()
if [[ ${#last_typo} -ge 2 ]]; then
    local prefix="${last_typo[1,2]}"
    narrowed_entries=(${(M)hist_entries:#${prefix}*})
else
    narrowed_entries=("${hist_entries[@]}")
fi

This works beautifully for 99% of commands because limiting the pool via a two-character prefix constraint keeps performance rapid and slashes terminal lag.

However, I have run into an edge case when a typo happens right on the second index. For example, a user typos cd apps as ccd apps.

Because of the prefix constraint cc*, it misses the clean history candidate cd apps.

If I drop the constraint down to a single character ${last_typo[1,1]}, it catches second-character stutters perfectly but expands the pool size massively.

If a user typos the absolute first character (like vcd apps instead of cd), even a single-character prefix constraint goes blind unless I drop filtering entirely and dump the raw history file straight into fzf, which introduces bloat.

Are there any native Zsh array manipulation tricks or expansion flags that can handle approximate matches or character proximity offsets cleanly inside the script logic before hitting the UI pipe, without destroying arrays or causing visible lag on massive histories?

Thank you in advance for any suggestions or help.

reddit.com
u/ClassroomHaunting333 — 4 days ago

My humble No-Bar and No-Shell Arch/Hyprland setup

For a while I was on a mission to go with no-bar setup and today for a fist time I did not load waybar at all and I don't miss it at all. Quite the opposite. No distraction whatsoever and full screen view of my opened apps.

Everything I need is managed via Control Panel(Python script) and keybinds.
Control Panel is still work in progress and a couple of things will still be added but it's pretty usable as is already.
It has workspaces, taskbar(currently opened apps), App launcher, custom tools launcher, performance switcher, live system monitoring, volume and brightness sliders, notifications and power management including day/night switch.

I'm still not satisfied with the colours and the background as I want them to be close to the Gruvbox settings of kitty but not the same, if you know what I mean.

I have also got rid of pywal as there is no need for it anymore. Wallpaper switcher managed with Python script and awww.

All widgets on the pictures are just simple custom shell scripts. No heavy GUIs except a very few like Thunar(still getting use to Yazi) and Geany.

Don't know what else to add. If you have any questions, just ask.

Worth mentioning that I did not upgraded to v0.55 yet, but my Lua configs are mostly ready for the switch. I am just going through all my custom scripts and making them ready for the switch as well.

If anyone ask for dotfiles I don't have a problem to share them, but I have to warn you that they are kinda mess. If you take anything from there you are on your own as I keep changing things quite often.

You can connect with me on GitHub or Discord as we know that posts on Reddit goes to dead-mans land within a couple of days.

Well, have a good day all.

u/ClassroomHaunting333 — 11 days ago
▲ 26 r/arch

My humble No-Bar and No-Shell Arch/Hyprland setup

For a while I was on a mission to go with no-bar setup and today for a fist time I did not load waybar at all and I don't miss it at all. Quite the opposite. No distraction whatsoever and full screen view of my opened apps.

Everything I need is managed via Control Panel(Python script) and keybinds.
Control Panel is still work in progress and a couple of things will still be added but it's pretty usable as is already.
It has workspaces, taskbar(currently opened apps), App launcher, custom tools launcher, performance switcher, live system monitoring, volume and brightness sliders, notifications and power management including day/night switch.

I'm still not satisfied with the colours and the background as I want them to be close to the Gruvbox settings of kitty but not the same, if you know what I mean.

I have also got rid of pywal as there is no need for it anymore. Wallpaper switcher managed with Python script and awww.

All widgets on the pictures are just simple custom shell scripts. No heavy GUIs except a very few like Thunar(still getting use to Yazi) and Geany.

Don't know what else to add. If you have any questions, just ask.

Worth mentioning that I did not upgraded to v0.55 yet, but my Lua configs are mostly ready for the switch. I am just going through all my custom scripts and making them ready for the switch as well.

If anyone ask for dotfiles I don't have a problem to share them, but I have to warn you that they are kinda mess. If you take anything from there you are on your own as I keep changing things quite often.

You can connect with me on GitHub or Discord as we know that posts on Reddit goes to dead-mans land within a couple of days.

Well, have a good day all.

u/ClassroomHaunting333 — 11 days ago
▲ 21 r/archlinux+3 crossposts

Quick update on Mend: Hardware scanner added and database expanded

Hi all,

Just a quick heads-up on the progress with Mend. I’ve just pushed an update that includes hardware scanner for missing packages/drivers.

What’s new:

Expanded Scan: The utility now picks up Audio, Ethernet, and USB/Bluetooth controllers.

Distro Support: Added package mapping for pacman, apt, dnf, and zypper.

Updated DB**:** Included the hardware IDs shared in the previous threads (Intel Cannon Lake, Renoir, etc.).

If you want to test it out, the scan command is mend -s. It’ll cross-reference your kit and suggest the right packages via fzf.

If anyone has a spare second to run lspci -nn | grep -E 'VGA|3D|Network|Ethernet|Audio|USB' and drop their output below, I’ll get those IDs added to the database as well.

Thanks for the help so far.

GitHub: https://github.com/Rakosn1cek/mend

u/ClassroomHaunting333 — 7 days ago

YouFibre 2000 and New Sagemcom router

Yesterday had an engineer to swap my routers as I upgraded to YouFibre 2000. All went well, he showed me everything, even the speeds on the company devices and I was OK with that.

As soon as he left I went on to the GUI and changed SSID's and passwords for wifi. Then I connected my laptop and phone and run speedtest's. To my surprise I could not get anything higher than 90MB.

Is there anything I could try on my end before I get any response from the support chat(24 hours without response).

I will be happy for any pointers as I am loosing my mind.

Thanks in advance.

[Solved] Faulty cable supplied by YouFibre. Not a first time.

reddit.com
u/ClassroomHaunting333 — 15 days ago
▲ 27 r/arch

My mission to a No-Waybar Hyprland setup

We all start somewhere when first trying Hyprland(in my case) and most of us using some kind of a bar. Be it waybar, ironbar, any bar or created in quickshell or whatever shell. I wasn't an exception, tried most of them and always returned to waybar for its simplicity.

A lot of time passed since then and the more I am thinking of the purpose of any bar, the more I am leaning to a solution of no bar whatsoever to utilise the whole screen of my laptop.
I am putting together a Control Panel written in Python(work in progress). While I have most of the things I needed there, some still remains in the waybar.
I still use a very simple two islands waybar. On the left I have clock and date, personal project time tracker and screen recorder toggle.
On the right I have taskbar, workspaces, and system Temp(important on fanless laptop).

I now how to move the left side of the waybar to the Control Panel and the Temperature, but I am not sure how to deal with the workspaces and taskbar(opened apps).
In theory, if all is removed, including the waybar itself, and everything keybinded, switching workspaces still should work as intended. Please correct me on this one if not true.

So, if I manage to move the opened apps to the Control Panel section, everything should be working without the waybar visuals. Correct?

Just for clarification of the move to no waybar at all. I use keyboard whenever I can(it's faster). I am not using mouse, just on rare occasions. Just a trackpad as I have it setup for gestures. So, i am in no need to click an icon in waybar to open an app. While most people might find it convenient, i find it as time and resources wasting.

Sorry if the post doesn't make sense that much, these are basically my thoughts in a post.

Thank you all for your time reading this and for any input on this approach.

u/ClassroomHaunting333 — 16 days ago

Hey all,

I am new to all of this. I have a new sub with a focus on terminal flows as i would like to separate the discussions from the main subs which are flooded with sometimes meaningless and memes posts.

My main worry is when I start promoting it in the main subs it will get me banned from there as the communities there can be quite unforgiving and toxic at times.

Shall I contact the mods beforehand and ask them if it is OK to mention the new sub or just risk it and post anyway.

Thanks for any advice.

reddit.com
u/ClassroomHaunting333 — 17 days ago

Hi all,

I’m refining a lightweight Zsh utility to map system hardware (PCI IDs) to distro-specific package names. The goal is to avoid the standard "digging through forums" on fresh installs.

I'm currently using a case statement to handle the translation between a generic hardware key (from a local text file DB) and the actual package name for different package managers (pacman, apt, dnf, zypper).

The current mapping logic:

mend_get_pkg_name() {
    local key="$1"
    case "$MEND_PM" in
        pacman)
            case "$key" in
                generic-nvidia) echo "nvidia-dkms" ;;
                generic-intel-wifi) echo "iwlwifi-db" ;;
                # ... etc
            esac
            ;;
        # ... additional PM logic
    esac
}

And the local database sample:

[10de:1c82] | generic-nvidia | NVIDIA GeForce GTX 1050 Ti
[10ec:c821] | generic-rtl8822be | Realtek RTL8822BE/8821CE
[8086:9d70] | generic-intel-audio | Intel Sunrise Point-LP HD Audio

I’m looking for feedback on:

Efficiency: Is a nested case structure the most idiomatic way to handle this in Zsh, or would an associative array (typeset -A) be cleaner for a growing database?

Filtering: I'm using lspci -nn | grep -E 'VGA|3D|Network|Ethernet|Audio|USB' to isolate the hardware. Are there any categories I’m likely missing that are essential for a headless or minimal install?

Data Collection: As I build out the hardware.db file, I'm looking for real-world data to flesh out the mappings. If you're willing to help, I'd appreciate any contributions. Just run lspci -nn | grep -E 'VGA|3D|Network|Ethernet|Audio|USB' in your terminal and paste the output.

Thank you all for any contributions.

reddit.com
u/ClassroomHaunting333 — 17 days ago

Hi all,

It's been couple of months now when I started working on a small, distro-agnostic, Zsh tool called Mend for my own use.

The need for the database is pretty simple: to save me from spending ages on a fresh install digging through forums to figure out which driver package I actually need for my Wi-Fi, Ethernet, GPU and so on. This addition to the current functions is still in it's nappies but might grow into something more robust in the future.

I’ve set it up to use a local text file (hardware.db) that maps hardware IDs to driver packages. It works offline and doesn't rely on any cloud nonsense or AI.

I’m trying to collect a decent list of hardware, but for obvious reasons I can't test it on every bit of kit under the sun.

This is where you could help. If you have a spare minute, I’d appreciate if you could share your hardware details so I can add them to the database. I’m looking to cover the basics that usually break on a fresh install: Graphics, Wi-Fi, Ethernet, Audio, and Bluetooth.

How you can help:

Just run lspci -nn | grep -E 'VGA|3D|Network|Ethernet|Audio|USB' in your terminal.

If you could paste the output here, that’d be brilliant. I’m formatting the database like this:

[VendorID:DeviceID] | [Generic Name] | [Description]

I’m not looking to build a massive, complex project. Just a community friendly tool that, anyone who is interested, can grab to save themselves a bit of a hassle when they install a new distro or run into some error messages.

This is what I have so far:

# Format: [VendorID:DeviceID] | GenericKey | Description
# --- NVIDIA ---
[10de:1c82] | generic-nvidia | NVIDIA GeForce GTX 1050 Ti
[10de:2501] | generic-nvidia | NVIDIA GeForce RTX 3060

# --- AMD/Intel Graphics ---
[1002:743f] | generic-amd-gpu | AMD Radeon Graphics
[1002:73ff] | generic-amd-gpu | AMD Radeon RX 6600
[8086:191e] | generic-intel-graphics | Intel HD Graphics 515

# --- Networking ---
[8086:2723] | generic-intel-wifi | Intel Wi-Fi 6 AX200
[10ec:c821] | generic-rtl8822be | Realtek RTL8822BE/8821CE
[10ec:b822] | generic-rtl8822be | Realtek RTL8822BE
[10ec:8168] | generic-realtek-ethernet | Realtek RTL8111/8168 Ethernet

# --- Audio ---
[8086:9d70] | generic-intel-audio | Intel Sunrise Point-LP HD Audio
[10ec:0255] | generic-realtek-audio | Realtek ALC255/3234

# --- USB Controllers (Bluetooth/HID) ---
[8086:9d2f] | generic-usb-controller | Intel USB 3.0 xHCI
[10ec:8723] | generic-realtek-bluetooth | Realtek RTL8723BE Bluetooth

# --- Input/Touchpads ---
[8086:9d60] | generic-i2c-controller | Intel Serial IO I2C Controller

Thank you all for any contributions.

reddit.com
u/ClassroomHaunting333 — 18 days ago
▲ 2 r/arch+1 crossposts

It took me far too long to realise that relying on a physical notepad to save my shell commands was holding me back. There is something frankly absurd about claiming to have a high performance terminal setup while frankly absurd digging through sticky notes to find a command I used last week.

I have finally binned the notepad and moved everything into XC. It acts as a digital brain for the commands I simply refuse to memorise. It handles the GPG encryption so I do not have to worry about API keys sitting in plain text, and the template engine sorts out the variables so I do not have to rewrite the same string every time an IP changes.

If you are still clinging to a handwritten log or a messy text file, it is probably time to move on. It is a lot quicker than trying to decipher your own handwriting three months down the line.

Image is git-pro community vault available to download from the repo. There is more vaults, check the community-vaults in the repo.

GitHub repo

AUR: xc-manager-git

Zsh Plugin: xc-manager

Note: LLM has been used as an accelerator and for drafting documentation, not the primary author.

u/ClassroomHaunting333 — 22 days ago

I was cleaning my system last night running sudo rm -rf /var/cache/pacman/pkg/download-* to clear up some space after failed AUR package install.

I was so frustrated and tired at the situation I was in, that I completely forgot I had my own security auditor, Oversight, running in the background. It jumped in and blocked the command. That was quite a surprise to see it working.

I have spent so much time crafting the regex rules for system integrity that I managed to catch myself off guard executing a now way back command. It is one thing to test a security tool against dummy files, but having it stop me from nuking my own directory when I was focused on something else felt like a real success.

It is a first time I am sharing this the project. It is a distro-agnostic auditor designed to scan scripts and commands before they run.

Couple of days ago I pushed v0.3.5, which moves the logic to an external JSON rules engine and adds multi-line context awareness, so it shows you exactly which lines of code are risky before you hit enter. At the moment it can scan locally and from GitHub, Gist, or any raw URL.

I am moving into Phase 2 now. The plan is to integrate the OSV.dev API so it can flag known vulnerabilities in package versions, plus adding basic de-obfuscation for base64 payloads to see what is hidden in those curl pipe bash commands.

It feels like the project is starting to hold its own. Has anyone else experienced that weird satisfaction of being blocked by their own code?

If you are interested, you can check Oversight here: https://github.com/Rakosn1cek/oversight

Any feedback is welcome.

u/ClassroomHaunting333 — 23 days ago
▲ 188 r/LinuxSnobs+1 crossposts

I’ve been using Arch for some time now because I value the DIY spirit and the ability to build a system that is exactly what I need. But lately, the community, especially on this sub feels like it’s going downhill fast.

I recently shared some of mine custom scripts, one of them being Bluetooth TUI script I wrote to replace some heavy, moody GUI apps.

Instead of a technical discussion about the logic integration, I was met with people calling it "AI slop" or dismissing it because it looked too polished.

When did we stop respecting the KISS principle? I thought the whole point of Arch was to ditch the bloat and build something better.

Instead, the community is gaining a reputation for being one of the most elitist and hated environments in Linux. It feels like if you don't do things the "1995 way" or install packages specifically mentioned on the Arch Wiki and your setup actually looks modern and efficient, you’re treated with suspicion or outright hostility.

This used to be a community of builders. Now it feels like a community of designers showing a big useless clock in terminals. Gatekeepers who are more interested in "calling out" others than actually improving their own setups. It’s a shame, because the Arch Wiki is still the gold standard for Linux documentation, but the people hanging around the sub are making the distro look bad.

I’ve replaced my heavy GUI apps with instant, stable fzf widgets that work better than anything I’ve found in the repos, yet the reaction is just pure cynicism.

Is anyone else tired of the ego-tripping here, or is it just me?

reddit.com
u/ClassroomHaunting333 — 1 month ago