readme : update.

This commit is contained in:
Dmitry Voronin 2023-10-24 17:25:27 +03:00
parent 5aaa55ca9a
commit ea508aa073

View file

@ -281,7 +281,7 @@ Mode|Key|Action
---|---|---
Normal|`-`|Decrease split size vertically.
Normal|`_`|Increase split size vertically.
Normal|`\\`|Decrease split size horizontally.
Normal|`\`|Decrease split size horizontally.
Normal|`\|`|Increase split size horizontally.
Normal|`<Space>=`|Equalize split sizes.
@ -309,3 +309,315 @@ Command|Description
Command|Description
---|---
`battery_level`|Print battery charge level (if available).
## Bootstrap.
Shortcuts to install different stuff.
Command|Description
---|---
`bootstrap_cargo`|Install cargo.
`bootstrap_texlive`|Install TeXLive package.
`bootstrap_grub`|Install grub theme. Requires root.
`bootstrap_ffmpeg`|Install ffmpeg in flatpak to make `~/app/bin/ffmpeg` work.
## Checksum.
Command|Description
---|---
`checksum new`|Create checksums recursively.
`checksum check`|Check previously created checksums.
## Chmod.
Command|Description
---|---
`x [FILE]`|Make file executable.
## Color.
### How to use.
Most of the time you want to use it with `echo`. To make `echo` respect colors, you need to use `-e` flag like that:
```bash
export color_default="\033[0m"
export color_red="\033[0;31m"
echo -e "${color_red}hello world!${color_default}" # will print "hello world!" in red.
```
Don't forget to use `color_default` at the end, or your whole terminal will be red.
### List of colors.
Please note that colors depend on Terminal Emulator and may vary based on its settings.
|Color|Code|
|---|---|
|default|`\033[0m`|
|blue|`\033[0;34m`|
|blue (bold)|`\033[1;34m`|
|cyan|`\033[0;36m`|
|cyan (bold)|`\033[1;36m`|
|green|`\033[0;32m`|
|green (bold)|`\033[1;32m`|
|purple|`\033[0;35m`|
|purple (bold)|`\033[1;35m`|
|red|`\033[0;31m`|
|red (bold)|`\033[1;31m`|
|white|`\033[0;37m`|
|white (bold)|`\033[1;37m`|
|yellow|`\033[0;33m`|
|yellow (bold)|`\033[1;33m`|
## Copy/paste.
Command|Description
---|---
`echo a | copy`|Copy `a` to system clipboard.
`paste > file.txt`|Paste system clipboard to a file (or pipe).
## File copy (cp).
Command|Description
---|---
`cp [FROM] [TO]`|Copy files or dirs. Actually, it is an alias for `rsync -ahP`.
`cp_merge [FROM] [TO]`|Mirror directories. Same as `rsync --delete`.
`cp_link`|Copy directory by recursively creating hardlinks and directories.
`bcp`|Default `cp` command.
## Date.
Command|Description
---|---
`today`|Return today's date in `YYYYmmdd` format.
`dow`|Return today's day of week, where 1 is Monday.
## Dconf (gnome settings).
Command|Description
---|---
`dconf_load`|Load custom settings.
`dconf_save`|Export all current setting in a file to inspect.
## Disk.
Command|Description
---|---
`df`|Show free disk space (only physical media).
`du [DIR]`|Show disk usage.
## Docker.
Command|Description
---|---
`docker_volumes [CONTAINER]`|Show volumes of a specified container.
`docker_health`|Show containers that exited with an error code.
`docker_prune`|Heavy cleanup to free up space.
`docker_ip [CONTAINER]`|Show IP of a specified container.
`docker_update`|Update all Docker images.
`dc`|Short for `docker compose`.
`dcu [SERVICE]`|Start a compose service.
`dcd [SERVICE]`|Remove a compose service.
`dcp [SERVICE]`|Pull image for a compose service.
`dcl [SERVICE]`|Show logs for a compose service.
`dcr [SERVICE]`|Restart a compose service.
`dcs [SERVICE]`|Stop a compose service.
`dcdu [SERVICE]`|Recreate a compose service.
`dcpu [SERVICE]`|Update and recreate a compose service.
`dcul [SERVICE]`|Start a compose service and show its logs.
## Environment variables.
Variable|Description
---|---
`PATH`|Defines where to find binaries. Modified to also include `$HOME/app/bin/` recursively.
`LANGUAGE`|Specifies `UTF-8` as default.
`EDITOR`|Specifies nvim as a default editor.
`MANPAGER`|Specifies nvim as a default `man` viewer.
`JAVA_HOME`|Specifies where JDK is stored.
`ANDROID_SDK_ROOT`|Specifies where Android SDK is stored.
`TEXMFVAR`, `TEXMFCONFIG`, `TEXMFLOCAL`|Specifies paths for TeXLive user directories.
## Ffmpeg.
Command|Description
---|---
`ffmpeg_mux_audio [SOUND] [RESULT]`|Mux external audio into one container with video (replaces original audio). Run inside dir with original video. [SOUND] names should be the same for each video.
## Files.
Command|Description
---|---
`o [FILE]`|Open file with default GUI app.
## Fix.
Contains simple fixes for warious issues.
Command|Description
---|---
`fix_ethernet_speed [SPEED]`|Specify ethernet speed if it failed to set correct speed automatically. [SPEED] can be 10/100/1000 etc.
`fix_files_sftp`|Make Nautilus forget incorrect password for SFTP connection.
## Git.
Command|Description
---|---
`git_tag`|Print git tag.
`gps`|Git push.
`gpsf`|Git push --force.
`gpl`|Git pull.
`gl`|Git log.
`gs`|Git status.
`gst`|Git stash.
`gd`|Git diff.
`gc [MESSAGE]`|Git commit.
`gch`|Git checkout.
`gb`|Git branch.
`gf`|Git fetch --all.
`gt`|Git tag.
`gi`|Delete files updated in git ignore.
`gpc`|Git patch create.
`gp`|Git patch (apply).
`ga`|Git add with preview.
`gr [COUNT]`|Git rebase. 2 last commits by default. 0 means from root.
`gu [NAME] [EMAIL]`|Configure git user (project).
`guv`, `guf`|My own user combos for personal and work.
## Ls.
Command|Description
---|---
`l`|List files in current dir.
`ll`|List including hidden files.
`lll [DEPTH] [PATH]`|Show file tree.
`llll`|List everything recursively.
`la`|List alphabetically.
`laa`|List all alphabetically.
## Name.
Those are scripts to manipulate file names. They are all exported and available for `parallel`. If no [FILES] specified, it applies to all files inside current directory.
Command|Description
---|---
`name [FILES]`|Replace all non-alphanumeric characters in file with underscores.
`name_hash [FILES]`|Replace all file names with hashes, keep extension.
`name_hash_check [FILES]`|Check all file hashes.
`name_series [SEASON]`|Rename files to Jellyfin's show format: `Episode S01E01.mkv`.
`name_manga [SEASON]`|Rename files to Kavita's manga format: `Name Vol.1 Ch.01.cbr`.
`name_ext [EXTENSION] [FILES]`|Change file extensions.
## Ncdu.
Command|Description
---|---
`ncdu`|Show recursive disk usage. Only on the same filesystem.
## Notify.
Command|Description
---|---
`notify`|Send notification.
`notify_silent`|Send silent notification.
## Own.
Command|Description
---|---
`own [USER] [FILE]`|Change ownership & permissions to specified user. Ownership changes only when root.
## Permissions.
Command|Description
---|---
`perm`|Recursively change permissions not to share: 700 for dirs and 600 for files.
`perm_share`|Recursively change permissions to share: 755 for dirs and 644 for files.
## Ps.
Command|Description
---|---
`ps [PROGRAM]`|Show process info for matching [PROGRAM] name.
## Shopt.
Shopt|Description
---|---
`dotglob`|When using `*` to match files, hidden files that start with a dot are also included.
`globstar`|Allows the use of `**` for recursive search.
`autocd`|Change directories without writing `cd`.
## Su.
Command|Description
---|---
`s`|An alias for `su` cause I'm lazy.
## Terminal.
Command|Description
---|---
`tsize`|Prints terminal size.
## Tmux.
Command|Description
---|---
`ta [NAME]`|Attach to session by name.
`td`|Detach from session.
`tl`|List all sessions.
`tr`|Rename session.
`tn`|Name window.
`tk [NAME]`|Kill session.
`tka`|Kill all sessions.
## To-do.
Command|Description
---|---
`todo`|Open editor for `~/.todo.md` file.
## Toolbx.
Command|Description
---|---
`tb [NAME]`|Attach to box by name.
`tbk [NAME]`|Kill box by name.
`tb_rpmfusion [NAME]`|Install RPMFusion package to box by name.
`tbl`|List all boxes.
## Try.
Command|Description
---|---
`try`|Repeat the command every 2 seconds until it exits with success.
## Umask.
By default, umask is `077` which means group and others have no access when files are created.
## Vdl.
Command|Description
---|---
`vdl [LINK]`|Download video/playlist.
`vdl_file [FILE]`|Download all links from a file.
`vdl_update`|Update playlist that was downloaded with `vdl` before.
`vdl_update_all`|Recursive `vdl_update`.
## Vi.
Command|Description
---|---
`vi`, `v`|Aliases for `nvim`.
## Wallpaper.
Command|Description
---|---
`wallpaper [FILE]`|Set specified file as a wallpaper.
## Watch.
Command|Description
---|---
`w`|Alias for `watch`.
`ww`|Alias for `watch` that updates every 0.1 seconds.