# Mitch's scripts, utilities, and configuration I copy this down to my personal machines. Things of interest: * shell configuration ( See more information below ) * tmux configuration ( see more info below ) * tmux helper script ( For load average, uptime and memory in the status bar ) * basic configuration ( For if you don't want the custom status bar ) * [`scripts/key-check.sh`]( * Snapshot scripts. Snapshots your entire OS see below for more details. * A basic vim configuration ( also see [`vim-cfg`](https://git.riedstra.dev/mitch/vim-cfg/about) ) * A handful of build scripts with my options for some open source projects such as Vim ## Snapshot Scripts These alter the fstab in the snapshot so you can boot to it just by changing kernel boot parameters ### [`scripts/snap-btrfs.sh`](`scripts/snap-btrfs.sh`) Automatically snapshot a btrfs root filesystem assuming you're using a subvolume and the base FS is mounted in `/ROOT` [`scripts/snap-lvm.sh`](`scripts/snap-lvm.sh`) Same as above, except it doesn't keep RO snapshots around, and doesn't remove old ones. Requires LVM but the underlying FS doesn't matter ( `ext4`, `xfs`, etc ) ## `bin` directory / desktop utilities * `snipmenu`, a small [dmenu](https://dmenu.suckless.org) script for pasting snippets from the `snips` directory. * `status-bar` a *very* messy script for a `dwm` status * `vol` small script to adjust pulseaudio volume on linux * `day`/`night` scripts for turning off/on `redshift` * `wallpaper` small script to continuously adjust the wallpaper, useful for when your screen resolution changes * `backlight` directly adjust the backlight on Linux systems * `ddmenu` dmenu for demenus. Dmenu script that launches other dmenu scripts. ## Shell Configuration `kshrc` Specifically targets ksh which has been my default shell for quite a long time now. Though I do test it against `bash` and `ash` occasionally as well. Some useful features are: * Aliases * `ll`, `lt`, `g` for `grep`, `j` for `jobs`, `p` for `pwd`, etc. * [Full list here](https://git.riedstra.dev/mitch/dotfiles/tree/shell/aliases#n1) * `ls -F` by default * Aliases for `apt`, `yum`, `pacman`, etc to use `sudo` by default. * Utilize `doas` as `sudo` if installed, for instance on OpenBSD. * Utils * `set_go` can be called in `~/.kshrc.local` or similar to add the `GOROOT` and `GOPATH` `bin`'s to your `PATH`. [Example and code.](https://git.riedstra.dev/mitch/dotfiles/tree/shell/utils#n1) * Aggressively set the editor based off of a list in order of ascending preference. ( `set_editor` ) * `set_pager` same thing, except for your pager. * `debugstarttls` Useful to debug starttls. * `randmacgen` generate a random mac address. * `ipv6_local_hosts ` Returns the IPs of local nodes by using the IPv6 all nodes multicast ping. * `set_nocaps` Eliminates capslock, makes it another control key. Makes the numberpad act like it does on Windows. `alt+space` switches between US and DE layouts. * `setperms : ...` Sets file and directory modes separately and recursively across the paths * `set_title ` Sets the title of the terminal to the first argument * `timestamp`: `date +%m.%d.%y_%H.%M.%S` * `checkSSHAgent` Checks to see if there's a running SSH agent, if not it starts one and writes a configuration file. * `passenv` runs `pass` and sources the output into the shell * `_tmux_servers`, `_tmux_servers_split_commands`, `_tmux_dev`, `_tmux_session` Utilities for building tmux development environments. * Colors * Automatically assume that anything `xterm*` or `screen*` is a 256 color terminal * Colored `ls` by default. * Colored man pages * Update<br /> This provides utilities that allow for easy updating of configuration files. The most useful ones are as follows * `updatevimrc` Installs [my full vim configuration](https://git.riedstra.dev/mitch/vim-cfg/about) * `updatevimrc_basic` Installs the `.vimrc` file which is a basic but useful vim configuration. * `updatetmuxconf` Pulls in the tmux configuration from this repository. * `updateshell` Pulls the latest version of `kshrc` from this repository. * `pullkeys_github <github_username>` Creates the `~/.ssh/authorized_keys` file with the SSH keys for a given github username * `updategitconf <name>` Creates `~/.gitconfig` with the file from `gitconfig/<name>`