View on GitHub

HomeSetup

HomeSetup simplifies terminal customization by offering seamless cloud integration for dotfiles, packages, and configurations, enhancing productivity and command line experiences without complex frameworks.

Download this project as a .zip file Download this project as a tar.gz file

HomeSetup Developer Handbook

Standard-Tools

Table of contents

__hhs_change_dir

usage: __hhs_change_dir [-L|-P] [dirname]

    Options:
      -L    : Follow symbolic links.
      -P    : Don't follow symbolic links.

  Notes:
    - dirname: The directory to change. If not provided, default is the user's home directory
Purpose
Returns

0 if the directory is changed; non-zero otherwise.

Parameters
Examples

__hhs_change_dir /tmp && pwd

/tmp

__hhs_changeback_ndirs

usage: __hhs_changeback_ndirs [amount]
Purpose

Change back the current working directory by N directories.

Returns

0 if directory is changed; non-zero otherwise.

Parameters
Examples

cd $HOME && .. && pwd

Output

Changed current directory: "/Users"
/Users

cd $HOME && .. 2 && pwd

Output

Changed directory backwards by 2 time(s) and landed at: "/"
/

__hhs_dirs

usage: __hhs_dirs
Purpose

Display the list of currently remembered directories.

Returns

0 if directory is changed; non-zero otherwise.

Parameters
Examples

__hhs_dirs

Output

Please choose one directory to change into (6) found:

  1    /
  2     /Users/hjunior
  3     /Users/hjunior/.config/hhs
  4     /Users/hjunior/GIT-Repository/GitHub/hspylib
  5     /Users/hjunior/HomeSetup
  6     /tmp

[Enter] Select  [↑↓] Navigate  [Esc] Quit  [1..6] Goto:

__hhs_list_tree

usage: __hhs_list_tree [dir] [max_depth]
Purpose

List contents of directories in a tree-like format.

Returns

0 on success ; non-zero otherwise.

Parameters
Examples

__hhs_list_tree . 5

Output

.
├── LICENSE.md
├── README.md
├── _config.yml
├── assets
│   ├── HomeSetup.terminal
│    ├── colorls
│    │    ├── hhs-preset
│    │    │    ├── dark_colors.yaml
│    │    │    ├── file_aliases.yaml
│    │    │    ├── files.yaml
│    │    │    ├── folder_aliases.yaml
...
...

__hhs_save_dir

usage: __hhs_save_dir -e | [-r] <dir_alias> | <path> <dir_alias>

Options:
    -e : Edit the saved dirs file.
    -r : Remove saved dir.
    -c : Cleanup directory paths that does not exist.
Purpose

Save one directory path for future __hhs_load.

Returns

0 if the save was successful; non-zero otherwise.

Parameters
Examples

__hhs_save_dir . dot

Output

Directory "/Users/hjunior/HomeSetup" saved as DOT

__hhs_save_dir -r dot

Output

Directory aliased as "DOT" was removed!

__hhs_load_dir

usage: __hhs_load_dir [-l] | [dir_alias]

Options:
    [dir_alias] : The alias to load the path from.
             -l : If provided, list all saved dirs instead.

  Notes:
    MSelect default : If no arguments is provided, a menu with options will be displayed.
Purpose

Change the current working directory to pre-saved entry from __hhs_save.

Returns

0 if the load was successful; non-zero otherwise.

Parameters
Examples

__hhs_load_dir dot

Output

Directory changed to: "/Users/hjunior/HomeSetup"

__hhs_load_dir -l

Output

AKS...................................... points to '/tmp'
HOM...................................... points to '/Users/hjunior'
DOT...................................... points to '/Users/hjunior/HomeSetup'

__hhs_godir

usage: __hhs_godir [search_path] <dir_name>
Purpose

Search and cd into the first match of the specified directory name.

Returns

0 if directory is changed; non-zero otherwise.

Parameters
Examples

__hhs_godir /usr/bin

Output

Directory changed to: "/usr/bin"

__hhs_mkcd

usage: __hhs_mkcd <dirtree | package>

E.g:. __hhs_mkcd dir1/dir2/dir3 (dirtree)
E.g:. __hhs_mkcd dir1.dir2.dir3 (FQDN)
Purpose

Create all folders using a slash or dot notation path and immediately change into it.

Returns

0 on success; non-zero otherwise.

Parameters
Examples

__hhs_mkcd dir1/dir2/dir3

Output

   Directories created: ./dir1/dir2/dir3
  Directory changed to: /tmp/dir1/dir2/dir3

__hhs_mkcd br.edu.hhs

Output

   Directories created: ./br/edu/hhs
  Directory changed to: /tmp/br/edu/hhs