bisgardo / dotfiles Goto Github PK
View Code? Open in Web Editor NEWDotfiles repository for system setup and configuration files
License: MIT License
Dotfiles repository for system setup and configuration files
License: MIT License
Instead of irreversibly deleting files, rm
should move them into a trash
folder in the same directory as it lived in before.
Alternatively, trashing is something that is "installed" in a directory (e.g. just by creating a .trash/
). Whenever a file or directory is deleted in a subdirectory, it is moved to the parent's trash in a matching subdirectory structure.
An "empty trash" command then permanently deletes a directory's trash. There may also be commands for "bubbling up" the contents of a trash to a parent.
For the trash's subdirectory structure to be consistent, we might also want to rename/move directories whenever the "live" subdirectory tree is modified.
Naturally, there should be ways/rules for overriding/prompting for trashing.
Note that this functionality might already exist elsewhere. In any case, this should probably be a separate project.
See https://stackoverflow.com/a/28776166.
The function should use a shell-specific implementation for robustness.
This may be generally useful enough to warrant its very own project and repo.
Make it possible for "modules" to not reinitialize when they don't need to (or shoudn't - e.g. dirs) and tear themselves down when a new subshell that the module doesn't support is started.
It may also be that a module just needs to reregister correctly. For example, in dirs zsh register, the function __dirs_path_components
is overwritten. When bash is started as a subshell, this function should revert to its original definition.
There should be an internal stack of modified PS1
variables.
Scripts like the event functions in .dotfiles-dir
can push new values of PS1
to this stack and restore the previous value later on.
Side note: This ability to modify PS1
"on the side" (including by third parties like Python env) is the reason that we shouldn’t recompute PS1
all the time from PROMPT_COMMAND
. The reason that one might want to do that is to have more flexibility to return color codes from functions/scripts. Due to the fact that bash only interprets color codes before evaluating code, this is usually not possible. But note that since the method proposed here modifies PS1
directly, we actually do seem to get that flexibility anyway.
The functions should print a usage message when called with e.g. -h
or --help
, or when required arguments are not provided.
Maybe there should even be a utility for making this easy?
In certain cases, the project will be automatically copied directly into the home directory. In other cases, one might want to clone it as a bare repository.
In both cases, the dotfiles should just work without calling the install script. This means that .bashrc
etc. should reside in the root directory of the project. The install script should symlink these files from the home directory if it the project is not in the home directory (which it should be able to determine this by itself) and link other files appropriately.
For such a setup, the only function of the install script will likely be modifying various OS-specific settings.
The dir events feature seems to be so generally usable that we might want people to make use of it without depending on the rest of dotfiles.
The setup is merely setting the PROMPT_COMMAND
variable.
In that regard the first step is to define a module system for creating things like this as plugins. It would be awesome if plugins could work not only cross-OS, but cross-shell!
Example: On Linux, netstat
is most often called with the flags -tulpn
. However, these flags don't work on the Mac variant of the program.
Something like a std
command could take a program and passes "standard" arguments depending on the platform and possibly some other configuration. In the example above, std netstat [args]
would return netstat -tulpn [args]
on Linux and [equivalent Mac command] on a Mac. There doesn't seem to be a need for the program to be called directly as the user can easily send the result to a subshell (after possibly verifying the result) or define a new command that performs the call directly.
In a more advanced solution, the utility could arbitrarily translate between arguments on different platforms. I.e. the command linux-args netstat -tulpn
returns the equivalent Mac command. (Maybe this already exists?)
This is a very broad, ill-defined, and probably extremely complex task that should be viewed more as a general idea than something that is immediately implementable.
The interface of the function (named e.g. deepmv
) should be
deepmv <from-path> <to-path> [<symlink>...]
The function just calls mv
and then relinks every <symlink>
to <to-path>
(should require that it exists and that it used to link to <from-path>
?).
The functions may then be combined with the following ones into commands like "move the directory linked to by this symlink and update all links in this directory":
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.