A collection of scripts and utilities for *nix.
Find a file
Berke Kocaoğlu aebfcf2118
wallpaper: fix -x mpv
Regression in d792ce9993.
2024-09-19 11:23:10 +03:00
.github CI: install X11 dependencies 2024-08-28 09:18:54 +03:00
.hooks .make: move to root 2024-04-07 18:06:32 +03:00
.woodpecker CI: install X11 dependencies 2024-08-28 09:18:54 +03:00
lib Add lyra submodule 2024-01-27 10:28:57 +03:00
man man/1/agpg: reword 2024-09-12 04:51:44 +03:00
rsrc rsrc: add obs-event-sounds and volmicmute resources 2024-01-17 08:18:27 +03:00
src wallpaper: fix -x mpv 2024-09-19 11:23:10 +03:00
systemd {man,systemd,tests}/*: move to root 2024-04-07 18:10:36 +03:00
test Create test/argn-3-odd.sh 2024-09-06 01:44:08 +03:00
.gitignore .make: generate tags separately for each language 2024-04-07 18:26:40 +03:00
.gitmodules Add lyra submodule 2024-01-27 10:28:57 +03:00
.make .make: fix not uninstalling Go programs 2024-08-29 21:43:37 +03:00
CONTRIBUTING.md Create CONTRIBUTING.md 2024-02-03 13:18:01 +03:00
LICENSE LICENSE: update year 2024-01-01 20:25:40 +03:00
Makefile .make: move to root 2024-04-07 18:06:32 +03:00
README.md readme: update notable scripts 2024-08-23 12:51:21 +03:00
SECURITY.md security: update email address, remove mention of PGP 2024-09-16 16:33:38 +03:00
TODO.md todo: update 2024-09-06 02:16:19 +03:00

GitHub Codeberg CodeFactor GitHub Build Workflow Status GitHub Analyse Workflow Status GitHub 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.

Name Description
agpg Encrypt/decrypt files using gpg.
argn Slice arguments or standard input using Python's slice syntax.
backuppath Generate new paths for files compliant with GNU's --backup.
bitspersec Measure output speed from standard input.
blank-screens Fade out/in individual monitors without turning them off.
calctdiff Calculate time between dates.
cast Cast between various types.
chomp Remove last newline of standard input.
contexec Continuously execute files on change.
dev2sh Convert evdev-compatible devices' inputs to virtual keyboard & mouse macros, or dispatch shell commands.
exif-filter Filter files by EXIF properties.
expandpath & unexpandpath Perform path expansion similar to shells, or undo path expansions.
ffmw Use ffmpeg with natural command names.
gcc-otg Just-in-time compile and run C & C++ source files like Python.
gi Terminal UI for Git.
gpu-bandwidth Measure the bandwidth of a GPU.
headsetcontrol2mpris Convert headsetcontrol-compatible headset events into MPRIS commands.
isdaytime Check if its day or night time.
l Conditionally page or preview files.
latexd Automatic continuous compilation for LaTeX.
lck Mutexes for the shell.
lf-run File & image previewing for lf, with caching support. See also lf-thumbnail, lf-preview and lf-cleaner.
maptouch Map touch screens to X11 screens in environments that don't properly do this.
memory-usage Print memory usage sorted by application.
mvbulk Rename, move or delete files in bulk using your preferred editor.
neomutt-pick Use a file picker with neomutt.
nsts Easily run NIST cryptographic tests.
numsh Like NumPy, but for the shell.
obs-event-sounds OBS plugin to play sounds on user events.
openrgb-cycle Manage OpenRGB profiles.
pathfinder Mark and jump to directories & files in the terminal.
personality Calculate Myers-Briggs personality type distributions.
plot-git-log Plot a pretty graph of Git history.
prefix Add various prefixes to standard input and pass to standard output.
presentimg Easily tile images with optional borders or labels.
previewimage Preview images in the terminal.
previewtext Preview files with useful meta-information or syntax highlighting.
reparent-window Reparent X11/Xwayland windows onto other X11/Xwayland windows.
scrolls Simulate fixed-canvas text scroll in the terminal. Useful for status bars.
shell-escape Sanitize strings for shells.
shufr Like shuf, but supports consecutive uniqueness.
slash Normalise slashes of paths.
sleep-precise Like sleep, but with millisecond precision and ~3ms accuracy.
span-images Merge images into a single image using X11 geometry syntax.
std.sh A standard library for POSIX Shell.
std::string C++'s std::string for the shell.
std::unordered_map C++'s std::unordered_map for the shell.
std::vector C++'s std::vector for the shell.
stest Test files for various conditions like dmenu's stest, but with more tests & support for partial inversions.
sumduration Sum human-readable durations.
sumsize Sum human-readable sizes.
sxhkd-auto Wrapper around sxhkd to use different configurations depending on the current environment.
tabutils Copy/paste tabs in Chromium/Firefox-based browsers.
termctl Control the terminal with natural command names.
tglapp Toggle applications. Useful for hotkeys.
torso Like head & tail, but prints the in-between.
trimpdf Trim excess whitespace from PDFs.
uniqs & uniqsd Like uniq, but can work with unsorted input.
unsymlinks Reverse the effect of symlinks.
usbctl Control USB devices.
volmicmute Toggle mute status of the default microphone.
wallpaper Set periodically-changing image or video wallpapers.
warnbattery Issue audible warnings for different battery charge thresholds.
x13ctl Control ASUS ROG Flow X13 and other ASUS ROG laptops.
ytdl-or-gldl Use yt-dlp, youtube-dl or gallery-dl depending on availability and target web site support.
zraminit Initialise 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