I actually have quite a simple structure that serves me well (your mileage might vary) projects/ 2023/ 2024/ 0000-something/ 0312-other-project/ 0419-hn-comment/ each year I make a year folder. And each project has a month + day prefix. Sometimes I want long term projects to pop up on top, so I prefix them with 0000 (or only make the day 00). It is simple, works on any OS. Although on Linux I do have some helper scri…
Why not use folder dates for that? It could be sorted. projects/ | 01.01.2017 something/ | 01.01.2024 other-project/ | 01.01.2023 hn-comment/ | 01.01.2022
Tips on how to structure your home directory (2023)
61–70 of 172 posts
Re: Tips on how to structure your home directory (2023)
#62Earlier quoted context omitted.
IMO, the GOPATH itself is a terrible design. It makes you mix together things from unrelated projects in the same directory structure, instead of each project having its own independent directory structure, like on every other programming language. The GOPATH design goes so much against the way I organize my projects, that it's the main reason I have never got interested into learning Go. Perhaps this design makes mo…
GOPATH actually made me realize that the ~/src/$host/$owner/$repo organization structure makes a ton of sense for every project and as long as you organize all of your languages into this one tree, everything just works.
Re: Tips on how to structure your home directory (2023)
#63Pictures are better sorted with EXIF keywords. So, metadata stored in the picture itself, perhaps even in the MIME type. Thus, if a picture is family related, just tag it #family, or #personx and so on. This is why I store them in the same folder on a per-date basis. The rest is keywords edited with programs such as Adobe Bridge and so on.
As for document file name structure, text files and the like, I've used both `Date then Descrpition.txt` or `Keyword Title or Description and then Date.txt` with the date obviously being an ISO date such that `YYYY-MM-DD-hhmm` with `-hhmm` being optional, also for sorting reasons. Sometimes I like sorting on "topics" i.e. keywords or titles, but other times, such as in logs, I like the date first because it's more essential to know when you logged something, and not necessarily the topic.
You should think the date is superfluous since it's also stored in the system. However, my experience that when you move around a file, the date eventually changes, and certainly if you make a mistake along the way. Meanwhile a filename date doesn't change. Also it helps with list sorting where applicable.
Re: Tips on how to structure your home directory (2023)
#64I hate having a polluted home directory, especially when an application thinks it should get a non hidden directory in my home! The one that upsets me the most is the default directory for go modules `~/go`. This frustrates me so much. I refused to install any go apps or use it for development for years. I've unfortunately had to give in, and it can at least be overridden by setting `GOPATH`, but it is a terrible, te…
IMO, the GOPATH itself is a terrible design. It makes you mix together things from unrelated projects in the same directory structure, instead of each project having its own independent directory structure, like on every other programming language. The GOPATH design goes so much against the way I organize my projects, that it's the main reason I have never got interested into learning Go. Perhaps this design makes mo…
Unruly apps that benefit from UID/GID regimentation can be constrained in this way. The whole app assuming ~amtgo is also helpful.
EDIT: I also remembered this useful advice on prefixing private shell scripts in your path with a comma:
Re: Tips on how to structure your home directory (2023)
#65Earlier quoted context omitted.
GOPATH actually made me realize that the ~/src/$host/$owner/$repo organization structure makes a ton of sense for every project and as long as you organize all of your languages into this one tree, everything just works.
Can you expand on this a bit please? What does $host mean? Why would I need that for a purely local project that is only created for my own use? And what about grouping projects? E.g. "personal", "work", etc. And where in the structure are languages? Is that the overarching directory?
In Go parlance, it would be the remote host where the repository is hosted, e.g. github.com, dev.azure.com, golang.org, etc.
> Why would I need that for a purely local project that is only created for my own use?
If nobody else is using your purely local project, and you're sure nobody will ever use it until the end of time, then I guess you could just use "~/src/$HOSTNAME/$USERNAME/$PROJECTNAME". Otherwise, it would be wise to setup a remote repository ahead of time.
Go has a strong opinion that, in this day and age of distributed computing, projects should be online-first, so they can be easily used as dependencies. One of the nice consequences of this opinion is that Go dependencies can just be specified in the import statement - e.g. using grpc dependency is just:
import "google.golang.org/grpc"
No need for pom.xml, requirements.txt, cmake.txt, or any other kind of dependency configuration. It just works (unless it doesn't, like with private repositories, in which case it requires some exotic configurations in ~/.gitconfig or ~/.netrc, but that's a whole other can of worms - for most public repositories I've used it works flawlessly).> And what about grouping projects? E.g. "personal", "work", etc.
Assuming you only use one repository hosting service and have one username, all your personal projects would be under "~/src/$PERSONAL_HOSTING_SERVICE/$USERNAME/", and your work would be under "~/src/$WORK_HOSTING_SERVICE/$WORK_ENTITY/" or something like this.
> And where in the structure are languages?
It isn't. That's either a bug or a feature. If it's a bug, you could just do the whole thing by language, e.g. "~/src/go/", "~/src/java/", etc.
Re: Tips on how to structure your home directory (2023)
#66Earlier quoted context omitted.
Pro tip: don't put your stuff in your $HOME directory. $HOME is for applications to pollute. Put your stuff literally anywhere else.
$HOME is where my terminal and file manager start. It's not reasonable to give up on this prime directory real estate.
Re: Tips on how to structure your home directory (2023)
#67Capital names for GUI things, lowercase names for CLI things. I'd prefer ~/documents, etc, but GUI people insist on capitalizing, so whatever. Very rarely I have to mix those, so it's not a big problem.
~/dotfiles is my dotfiles directory with git. I create ~/.zshrc -> dotfiles/zshrc, etc. I don't use any software to manage that, I just create symlinks. In the past I've used ~/.dotfiles but I think that making it visible makes more sense.
~/projects is my projects directory. ~/projects/test is throwaway test projects to check things out, etc. ~/projects/my is my personal projects. ~/projects/company is projects for company I'm working for. I'm kind of freelancer and sometimes work for different companies, so separation is necessary.
~/tmp is my throwaway directory for everything. I have shell function mkcdtmp which creates ~/tmp/240419 (current date) and cds into it. It's a wonderful way. I rarely clean it, because I prefer to buy big discs and keep trash around, somewhat organized. If I need something from yesterday or past month, I know where to find it. That's the most important thing I did for organizing my temp work which is plenty. Of course I can create ~/tmp/whatever if needed, it's all trash stuff.
Well, that's all, I guess. I don't use ~/Desktop. I rarely use ~/Documents, still need to find a way to organize it. Also I dump my short notes and stuff to my github repo which builds a personal website. I tried various notes software but ordinary website with markdown turned out the best way for me.
I never was able to organize my work in a very structured way, it's always piles of trash moving around which eventually turn into something usable, so instead of fighting myself I decided to make that trash organized.
Essentially my computer is disposable. Everything in ~/projects is in git. Everything in ~/tmp is not very important and more like a cache or discarded work. I'm trying to organize things in a way so restoring it from the clean state wouldn't take much time. I often reinstall OS from the scratch and I often switch between operating systems and laptops, that suits me best.
Re: Tips on how to structure your home directory (2023)
#68Re: Tips on how to structure your home directory (2023)
#69Earlier quoted context omitted.
>But polluting your home directory like ~/go, without even the decency to hide it, is extremely rude and offensive. Counterpoint: I actually like having visible directories, versus having to figure out where in /usr/share or /usr/local/ or ~/.local or /var an installer chose to sneak their files in. I got used to it and in HOME I put some of my manually installed tools like `AMD_AOCL` for the AMD AOCL libraries, `And…
In theory, all applications following XDG would also solve the problem, as it has only 1 configuration directory. (Although I admit some apps use the data directory which brings it up to 2)
Re: Tips on how to structure your home directory (2023)
#70The “user-dirs.dir” setting is something I didn’t know was configurable. I thought I was always stuck with ~/Desktop, ~/Documents, … Have slowly been using nixos as my primary driver (still in an emulated vm though). One thing I love here is the declarative nature. Lately have been experimenting with various desktop environments. I tried gnome and “it works” but have been fascinated with the idea of “ricing” my setup…