FIle Manager++
- 7 Devlogs
- 7 Total hours
A lightweight, TUI-based file manager made in C++
A lightweight, TUI-based file manager made in C++
Devlog #7
So here I am, making it…. again. I have also TRIED fixing some stuff, namely the bug where the sidebar moves with the amount of content displayed in the content panel (aka it moves up when the panel has less content). I tried many things, removing flexes, adding flexes, adding borders, adding frames, and removing vscroll_indicators. Nothing worked :(
I’m hopeless at this point. I’ve tried asking AI and all, yet nothing will go back at it later, I guess.
So I tried tackling another issue, making the directory display before the files. I had more luck with this one. All I did was make a std::sort step that parses all the contents from beginning to end and checks if it’s a directory; if it is, it will just display it on the content panel first!
Soon to come is adding some way to customise settings (or make a part of it to work on later), probably will just use enums like standard C++.
Devlog #6
My disk is very full!
Today, I thought to myself, “why haven’t I added a root disk stat yet, that shows usage and all that good stuff”
Well, here I am answering my thoughts. I’m not crazy… maybe. Basically for the backend I made a DiskStats struct that holds important variables , like used percentage, available bytes, used bytes etc. I then hooked that up to my filesystem cpp implementation, and tested it. Worked on the first try! Nice job C++! However, I noticed that not everyone would like to read thousands of numbers and convert them into megabytes, gigabytes etc. So I made a simple formatter util that does the job for you.
Next was the ui. I made a disk click handler (that currently doesn’t work) that show the disk stats, and has a progress bar that turns red if disk usage is over 90% (signalling critical usage limit). Then, I just piped that into my main view vbox.
Devlog #5
Icons, icons, icons!
Today, I decided to finally add file icons to the content page finally. Overall, it wasn’t particularly hard, just VERY tedious to do. I used nerdfonts to render the icon. It took me the majority of my time actually setting all the icons, with their numerous file extensions. .so, .py, .elf, makefile, docker, csharp, cpp, h, hpp, c, you name it.
But hey it looks prettier now.
Devlog #4
Decentralisation
Today (and yesterday to a certain extent), I have worked on decentralising the ui components into their own respective files.
Of course, this didn’t come without its numerous issues, namely being the C++ pointer errors striking yet again. Overall, the transistion wasn’t too hard, so I got to making a breadcrumb for the filepath. However, during the making of this, I noticed that the sidebar options weren’t properly sending me to the path, I fixed this by injecting the / path into the second slot of the target array inside my SidebarComponent.
Devlog #3
Welcome to the horrors of C++
I’ve officially split the file manager into a dual-panel desktop layout featuring a fixed “Places” sidebar and an overflowing “Content” directory using FTXUI’s DOM elements (elements.hpp). The trickiest part was getting large directories to scroll smoothly instead of truncating off-screen, which I solved using frame and vscroll_indicator viewports.
Of course, C++ warmly welcomed me to modular architecture by throwing a brutal std::length_error core dump after spending a solid 15 minutes refactoring my main.cpp into multiple modular files. I spent a considerable amount of time fighting what I thought was bad memory management, only to realise I had used an unsafe raw pointer cast on a boolean flag inside my tab container, forcing the layout engine to read random garbage bytes. At least that’s what I thought it was; in reality, it was that my change_directory function calls update_directory, which does display_names.clear() and rebuilds the vector. However, ftxui’s Menu component holds a raw pointer to the origin vector, but the vectors’ internal buffer got reallocated when it grows beyond capacity. With the issue identified and fixed, it now works again! Sort of…… now the directory contents don’t sync properly due to my fixes, including proper resyncing to avoid a SIGARBT.
With the code cleanly refactored into separate files and building, I’m aiming to tackle a dynamic file path bar and a basic context menu next.
Devlog #2
Implemented a basic escape menu system, currently hoping to be similar to btop++, effectively just btop but a file manager.
Hello everybody!
To start of, I am a power user. I hate the concept of using a mouse to navigate around my system, its just so… slow and tedious. To fix this, I have aggressively tried to make my system as keyboard centric as possible. Whether that be switching to Linux, using a tiled window manager, or anything like that. My only problem, my file manager, I would like a file manager keyboard friendly, yes there are options but I wish to make my own, so here I am.
For now, I’ve setup basic filesystem indexxing, alongside a tui implementation (without much features as of now). Progress is being made, however I’m far from complete.