Refactor of README.md. Change daisy_help to source directly from READEME.md
to prevent data duplication. Made daisy_help granular (e.g. runnig "daisy_help
bak" returns solely the description of the "bak" utility.
Added the following utils/functions:
- daisy_list: Provides a list of utilities similar to daisy_help but without
the descriptions.
- daisy_(un)alias: Adds/removes user-bound aliases inside of the lackadaisical
config files.
- grab: Alias of "awk '{primt $num}".
This commit is contained in:
parent
434a50987e
commit
3eeb4e2d7f
4 changed files with 274 additions and 1299 deletions
222
README.md
Normal file → Executable file
222
README.md
Normal file → Executable file
|
|
@ -1,94 +1,140 @@
|
|||
# LACKADAISICAL
|
||||
*This project is still under heavy development!*
|
||||
---*This project is still under heavy development!*---
|
||||
# L A C K A D A I S I C A L
|
||||
A collection of easy-to-understand, easy-to-use scripts, functions and aliases. Designed to be beginner-friendly but also useful!
|
||||
|
||||
A collection of easy-to-understand, easy-to-use scripts and functions. Designed to be beginner-friendly but also useful!
|
||||
## Disclaimer
|
||||
Some aspects of this project were generated by Google Gemini (in particular, daisy_help and daisy_liist). While we are generally against using LLMs for code, the added functionality of being able to get information for individual tools is useful and not considered to be vital functionality.
|
||||
|
||||
# How to use
|
||||
Simply open your shell's RC-file (.bashrc, .zshrc, etc) and include `source <lackadaisical-folder>/daisy.source` preferably at the bottom of the file. We recommend setting your editor before sourcing `lackadaisical`. For instance, putting `export EDITOR=/usr/bin/nano` near thec\ top of your RC-file. It may later be overridden by `lackadaisical` itself if you use (or have used) `ched`.
|
||||
## How to use
|
||||
Simply open your shell's RC-file (.bashrc, .zshrc, etc) and include `source <la
|
||||
ckadaisical-folder>/daisy.source`, preferably at the bottom of the file. We recommend setting your editor before sourcing `lackadaisical`. For instance, putting `export EDITOR=/usr/bin/nano` near the top of your RC-file. It may later be overridden by `lackadaisical` itself if you use (or have used) `ched`.
|
||||
|
||||
You can also try out the utilities by simply sourcing the file while running your shell. It will automatically include itself into your `PATH` variable.
|
||||
You can also try out the utilities by simply sourcing the file while running your shell of choice. It will automatically include itself into your `PATH` variable.
|
||||
|
||||
# Contents
|
||||
*(taken from `daisy_help`)*
|
||||
At first use, `lackadaisical` will provide you with information via `daisy_help`. This information is identical to what can be read in the `Getting Started` section below.
|
||||
|
||||
## Getting started
|
||||
```
|
||||
--- BEGIN OF DAISY HELP ---
|
||||
===============================================================================
|
||||
Thanks for installing LACKADAISICAL!
|
||||
This project aims to provide useful utilities as well as learning material.
|
||||
|
||||
It is still under heavy development, not all of the things on this
|
||||
list are present/implemented. Utils marked with * are incomplete.
|
||||
|
||||
This suite provides a number of functions, aliases and scripts.
|
||||
They are all aimed at enhancing your efficiency.
|
||||
|
||||
To uninstall LACKADAISICAL, simply remove the source line from your
|
||||
shell RC, and reload it. This does not remove the files!
|
||||
You will also need to manually clear the configuration data in '<home>/.config/
|
||||
lackadaisical` if you so desire.
|
||||
|
||||
To read this notice again, call the function 'daisy_help'.
|
||||
===============================================================================
|
||||
These are the included binaries and utilities:
|
||||
- calm:
|
||||
Reduce a process 'niceness' to 0.
|
||||
- cdz:
|
||||
This utility extracts an archive to /tmp and changes
|
||||
directory to it in a new shell instance. Upon exit,
|
||||
the files are wiped. If `archivemount` is present,
|
||||
it will be used to mount the archive instead! You can
|
||||
bypass this behavior by specifying an env value of;
|
||||
NO_ARCHIVEMOUNT=1. The standard script supports zip,
|
||||
tarballs, and rar archives. We recommend relying on
|
||||
archivemount` if you have it installed.
|
||||
- editx:
|
||||
Uses your standard CLI editor to create/modify a
|
||||
file and make it executable.
|
||||
- filewait:
|
||||
This tool is given a filename of a file that does
|
||||
not exist yet. When the file appears on disk, the
|
||||
tool quits and simply returns the filename. This
|
||||
can be used in personal workflows to stall a longer
|
||||
command that relies on the existence of said file.
|
||||
- newday:
|
||||
A basic but powerful journaling system. Recommended
|
||||
to be set up via crontab. Can be used for everything
|
||||
from diaries to general file storage to even BTRFS
|
||||
snapshots.
|
||||
- own:
|
||||
A simple utility. It's effectively an alias for
|
||||
"sudo chown -R user:user" on the target dir/file.
|
||||
Root permissions required!
|
||||
- shrc:
|
||||
This tool allows you to edit the RC file for your
|
||||
shell in your preferred editor. After saving, the
|
||||
file is sourced by your shell if modified.
|
||||
- sw:
|
||||
A basic function that swaps two files by content.
|
||||
Useful for restoring backups.
|
||||
- what:
|
||||
This is a tool similar to which and others, the key
|
||||
difference is that it returns partial matches. It can
|
||||
be used to search for binaries.
|
||||
- binbox:
|
||||
This tool can be used to pack bash scripts into one
|
||||
big megascript, much like how `busybox` works.
|
||||
You can also make symlinks to it to invoke a specific
|
||||
script (as of writing, 11/25, symlinks do not work well).
|
||||
- bak/unbak:
|
||||
These small utilities make backups of files by making
|
||||
a copy with a .bak suffix. Unbak reverses the process
|
||||
by using sw and removes the backup.
|
||||
- lsa:
|
||||
A simple alias for ls -lah.
|
||||
- lsn:
|
||||
A simple alias for ls -lah --sort=time --reverse.
|
||||
- lss:
|
||||
A simple alias for ls -lah --sort=size --reverse.
|
||||
- editbin:
|
||||
An alias for editx $\(which <x>\). Saves on typing.
|
||||
- editpeco:
|
||||
This function uses peco+tree like 'cdp', but opens
|
||||
your editor on the selected file(s). After you exit
|
||||
your editor(s), you are returned to peco where you left
|
||||
off.
|
||||
- ched:
|
||||
Like chsh but for your editor (EDITOR env). A list
|
||||
from which you can choose an installed editor
|
||||
(CLI or GUI) is shown. This list is by no means complete.
|
||||
- cdf:
|
||||
Use fzf to find a file and then cd to its location.
|
||||
- cdp:
|
||||
Similar to 'cdf' but uses tree+peco for the query.
|
||||
- ldrc:
|
||||
Edits daisy.source and re-sources it, similarly to shrc.
|
||||
- daisy_init:
|
||||
Alias for directly sourcing this file from any
|
||||
LACKADAISICAL binary. You may use this yourself.
|
||||
- grab:
|
||||
Alias for awk "'{print $x}'", where x is a number.
|
||||
E.g. "echo 'a b c' | grab 2" returns 'b'.
|
||||
- daisy_cbin:
|
||||
Contains the name of the current LACKADAISICAL
|
||||
binary being run.
|
||||
- daisy_enc:
|
||||
Converts a file/stdin to a base64 block that can be
|
||||
decoded by passing the output(s) to daisy_dec.
|
||||
- daisy_enc_multi:
|
||||
A version of daisy_enc that encodes multiple
|
||||
files and outputs daisy_base64_data blocks to a file
|
||||
or stdout.
|
||||
- daisy_dec:
|
||||
Converts daisy_base64_data blocks back to the form
|
||||
it was in originally.
|
||||
- daisy_dec_multi:
|
||||
A version of daisy_dec that runs on multiple input
|
||||
blocks that are either stored in a file or stdin.
|
||||
- daisy_alias/daisy_unalias:
|
||||
This utility sets persistent user aliases stored in
|
||||
.daisy_aliases in the lackadaisical config folder.
|
||||
They will remain persistent until unaliased.
|
||||
Call 'daisy_alias' without parameters to get a list.
|
||||
Use 'daisy_unalias' to remove an alias.
|
||||
- daisy_list:
|
||||
List all available commands without description.
|
||||
--- END OF DAISY HELP ---
|
||||
```
|
||||
===================================================================
|
||||
|
||||
Thanks for installing LACKADAISICAL!
|
||||
This project aims to provide useful utilities as well as learning
|
||||
material.
|
||||
It is still under heavy development, not all of the things on this
|
||||
list are present/implemented.
|
||||
|
||||
===================================================================
|
||||
|
||||
This suite provides a number of functions, aliases and scripts.
|
||||
They are all aimed at enhancing your efficiency.
|
||||
|
||||
===================================================================
|
||||
|
||||
These are the included binaries:
|
||||
- calm: Reduce a process niceness to 0.
|
||||
- cdz: This utility extracts an archive to /tmp and changes
|
||||
directory to it in a new shell instance. Upon exit,
|
||||
the files are wiped.
|
||||
- editx: Uses your standard CLI editor to create/modify a
|
||||
file and make it executable.
|
||||
- filewait: This tool is given a filename of a file that does
|
||||
not exist yet. When the file appears on disk, the
|
||||
program quits and simply returns the filename. This
|
||||
can be used in personal workflows.
|
||||
- newday: A basic but powerful journaling system. Recommended
|
||||
to set up via crontab. Can be used for everything
|
||||
from diaries to BTRFS snapshots.
|
||||
- own: A simple utility. It effectively uses chown -R
|
||||
user:user on its target. Root permissions required!
|
||||
- short: This tool allows you to set up directory shortcuts.
|
||||
It enhances cd t to integrate itsef using its own
|
||||
syntax. It is similar to wd.
|
||||
- shrc: This tool allows you to edit the RC file for your
|
||||
shell in your preferred editor. After saving, the
|
||||
file is sourced by your shell.
|
||||
- sw: A basic function that swaps two files by content.
|
||||
Useful for restoring backups.
|
||||
- what: This is a tool similar to which and others, the key
|
||||
difference is that it returns partial matches. It can
|
||||
be used to search for binaries.
|
||||
|
||||
===================================================================
|
||||
|
||||
There are aliases and functions included within this file as well:
|
||||
- bak/unbak: These small utilities make backups of files by making
|
||||
a copy with a .bak suffix. Unbak reverses the process
|
||||
using sw and removes the backup.
|
||||
- lsa: A simple alias for ls -lah.
|
||||
- lsn: A simple alias for ls -lah --sort=time --reverse.
|
||||
- editbin: An alias for editx $(which <x>). Saves on typing.
|
||||
- ched: Like chsh but for your editor (EDITOR env). A list
|
||||
from which you can choose an installed editor
|
||||
(CLI or GUI) is shown.
|
||||
- cdf: Use fzf to find a file and then cd to its location.
|
||||
- ldrc: Edits this file and source it, similarly to shrc.
|
||||
- daisy_init: Alias for directly sourcing this file from any
|
||||
LACKADAISICAL binary. You may use this yourself.
|
||||
- daisy_cbin: Contains the name of the current LACKADAISICAL
|
||||
binary being run.
|
||||
- daisy_enc: Converts a file/stdin to a base64 block that can be
|
||||
decoded by passing the output(s) to daisy_dec.
|
||||
- *_multi: A version of daisy_enc that runs encodes multiple
|
||||
files and outputs daisy_base64_data blocks to a file
|
||||
or stdout.
|
||||
- daisy_dec: Converts daisy_base64_data blocks back to the form
|
||||
it was in originally.
|
||||
- *_multi: A version of daisy_dec that runs on multiple input
|
||||
blocks that are either stored in a file or stdin.
|
||||
|
||||
===================================================================
|
||||
|
||||
To uninstall LACKADAISICAL, simply remove the source line from your
|
||||
shell RC, and reload it. This does not remove the files!
|
||||
|
||||
To read this notice again, call the function 'daisy_help'.
|
||||
|
||||
===================================================================
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue