Skip to content

Repository files navigation

GitHubCodebergCodeFactorGitHub Build Workflow StatusGitHub Analyse Workflow StatusGitHub Spell Workflow Status

scripts

This repository holds a collection of over 500 scripts, utilities and libraries for Unix-like operating systems, OBS plugins and browser extensions, written in: Awk, Bash, C , C++, execline, Go, JavaScript, POSIX Shell, Perl, Python, and Rust.

Installation

git clone https://github.com/XPhyro/scripts.git # clone repository
git submodule update --init --recursive # initialise dependencies
make install # install for your user
sudo make install # or install system-wide (recommended)

You may set $PREFIX to change the installation directory. By default, it is ~/.local for your user, or /usr/local for the system.

After installation, add $PREFIX/share/scripts/include to your path. A POSIX shell standard library will have been installed here, and will be used by all shell scripts.

If you would like to use the provided wrapper scripts, also add $PREFIX/bin/wrapper to your $PATH with higher priority than the locations of the wrapped scripts.

Uninstallation

make uninstall # if you installed for your user
sudo make uninstall # if you installed system-wide

You do not need to re-set $PREFIX while uninstalling. The previously-used $PREFIX will automatically be used.

If you altered your $PATH, you may also wish to undo it.

Notable Scripts

As mentioned, there are tons of scripts and other software included in this repository. Below are some of the more prominent ones. You can take a look at src/ for the others.

NameDescription
agpgEncrypt/decrypt files using gpg.
argnSlice arguments or standard input using Python's slice syntax.
backuppathGenerate new paths for files compliant with GNU's --backup.
bitspersecMeasure output speed from standard input.
blank-screensFade out/in individual monitors without turning them off.
calctdiffCalculate time between dates.
castCast between various types.
chompRemove last newline of standard input.
contexecContinuously execute files on change.
dev2shConvert evdev-compatible devices' inputs to virtual keyboard & mouse macros, or dispatch shell commands.
exif-filterFilter files by EXIF properties.
expandpath & unexpandpathPerform path expansion similar to shells, or undo path expansions.
ffmwUse ffmpeg with natural command names.
gcc-otgJust-in-time compile and run C & C++ source files like Python.
giTerminal UI for Git.
gpu-bandwidthMeasure the bandwidth of a GPU.
headsetcontrol2mprisConvert headsetcontrol-compatible headset events into MPRIS commands.
isdaytimeCheck if its day or night time.
lConditionally page or preview files.
latexdAutomatic continuous compilation for LaTeX.
lckMutexes for the shell.
lf-runFile & image previewing for lf, with caching support. See also lf-thumbnail, lf-preview and lf-cleaner.
maptouchMap touch screens to X11 screens in environments that don't properly do this.
memory-usagePrint memory usage sorted by application.
mvbulkRename, move or delete files in bulk using your preferred editor.
neomutt-pickUse a file picker with neomutt.
nstsEasily run NIST cryptographic tests.
numshLike NumPy, but for the shell.
obs-event-soundsOBS plugin to play sounds on user events.
openrgb-cycleManage OpenRGB profiles.
pathfinderMark and jump to directories & files in the terminal.
personalityCalculate Myers-Briggs personality type distributions.
plot-git-logPlot a pretty graph of Git history.
prefixAdd various prefixes to standard input and pass to standard output.
presentimgEasily tile images with optional borders or labels.
previewimagePreview images in the terminal.
previewtextPreview files with useful meta-information or syntax highlighting.
reparent-windowReparent X11/Xwayland windows onto other X11/Xwayland windows.
scrollsSimulate fixed-canvas text scroll in the terminal. Useful for status bars.
shell-escapeSanitize strings for shells.
shufrLike shuf, but supports consecutive uniqueness.
slashNormalise slashes of paths.
sleep-preciseLike sleep, but with millisecond precision and ~3ms accuracy.
span-imagesMerge images into a single image using X11 geometry syntax.
std.shA standard library for POSIX Shell.
std::stringC++'s std::string for the shell.
std::unordered_mapC++'s std::unordered_map for the shell.
std::vectorC++'s std::vector for the shell.
stestTest files for various conditions like dmenu's stest, but with more tests & support for partial inversions.
sumdurationSum human-readable durations.
sumsizeSum human-readable sizes.
sxhkd-autoWrapper around sxhkd to use different configurations depending on the current environment.
tabutilsCopy/paste tabs in Chromium/Firefox-based browsers.
termctlControl the terminal with natural command names.
tglappToggle applications. Useful for hotkeys.
torsoLike head & tail, but prints the in-between.
trimpdfTrim excess whitespace from PDFs.
uniqs & uniqsdLike uniq, but can work with unsorted input.
unsymlinksReverse the effect of symlinks.
usbctlControl USB devices.
volmicmuteToggle mute status of the default microphone.
wallpaperSet periodically-changing image or video wallpapers.
warnbatteryIssue audible warnings for different battery charge thresholds.
x13ctlControl ASUS ROG Flow X13 and other ASUS ROG laptops.
ytdl-or-gldlUse yt-dlp, youtube-dl or gallery-dl depending on availability and target web site support.
zraminitInitialise zram.

Usage

See man COMMAND, COMMAND -h or COMMAND --help. Trivial programs & scripts do not have man pages or help dialogues, either infer usage from their names, or see the source code.

In all shell scripts, if you set $SHELL_VERBOSE to greater than 0, set -x is executed and all executed commands are printed to standard error.

Caveats

  • Some scripts assume that some of the other scripts are in your $PATH, so partial installation is not recommended.
  • In some scripts, GNU extensions like sed -i or strcasestr are used, so they may not work on strictly-POSIX environments.
  • Some scripts were written with only Linux in mind, although they may be compatible with other Unixes and Unix-likes, or may be ported with minimal modification.
  • All scripts/programs are only tested on Linux.
  • C and C++ code are only tested with the latest release of GCC. Most programs are compatible with any POSIX/ISO-conforming compilers but some use non-standard GNU/LLVM extensions.

Contributing

Please see CONTRIBUTING.md.

License

Unless otherwise stated, all software found in this repository are licensed under the MIT License. See the LICENSE file for details.

Star History

Star History Chart

About

A collection of over 500 scripts, utilities and libraries for *nix and plugins/extensions for OBS & browsers.

Topics

Resources

Contributing

Security policy

Stars

7 stars

Watchers

1 watching

Forks

Sponsor this project

Used by

Contributors

Languages