Code Monkey home page Code Monkey logo

dalia's Introduction

Dalia

A small commandline utility for creating shell aliases to change directories quickly without needing to type cd.

Configuration

Dalia requires a configuration file in order to run properly. Dalia expects the configuration file to be at $HOME/.dalia/config by default. The file should contain a list of absolute paths, and any optional custom names at the start of the line, to create all aliases. Finally, all configured paths must be absolute paths—anything else is invalid.

Custom Alias Names

Aliases can have a custom name assigned to them, just surround whatever text you want with square brackets ([ & ]) and include it at the beginning of the line. If dalia doesn't find a custom name for a particular directory, then the alias will be the lowercase basename of the absolute path (e.g. /some/absolute/path yields an alias named path).

Configuration File Example

Here's an example of a configuration file that dalia would load from $HOME/.dalia/config:

[workspace]~/Documents/workspace
~/Desktop
[icloud]~/Library/Mobile\ Documents/com~apple~CloudDocs
/Users/johnappleseed/Music
[photos] /Users/johnappleseed/Pictures

This configuration file will create the following aliases:

workspace='cd ~/Documents/workspace'
desktop='cd ~/Desktop'
icloud='cd '~/Library/Mobile\ Documents/com~apple~CloudDocs'
music='cd /Users/johnappleseed/Music'
photos='cd /Users/johnappleseed/Pictures'

Now, once dalia loads you can change directories with either workspace, icloud, or any other configured alias right from your shell.

Installation

First, install Rust. Next, run:

$ cargo install dalia

to install dalia. Finally, add the following line to your shell's configuration file to initialize all aliases:

$ eval "$(/path/to/cmd/dalia aliases)"

This line will generate and output an alias command for each configured path in the current terminal session. It's a good idea to include it in whichever configuration file your shell runs at the start of each session so that the aliases are always available.

Customization

Dalia expects to find its configuration, in a file named config, in the directory $HOME/.dalia, but that location can be changed by setting the DALIA_CONFIG_PATH environment variable to somewhere else and putting the config file in there instead.

dalia's People

Contributors

wemgl avatar

Stargazers

Lina Morales avatar

Watchers

James Cloos avatar

dalia's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.