1
0
Fork
You've already forked scripts
0
forked from rldane/scripts
Some of my scripts that I wrote, which I use daily
  • Shell 99.1%
  • sed 0.9%
lpolish 70c4ff90fd Refactor script to remove if-else construct for centering text
Refactor script to remove if-else construct for centering text
- Eliminated the if-else construct by using parameter expansion with a fallback to `cat`.
- This simplification maintains functionality while improving code readability and efficiency.
2024年07月15日 04:12:53 +00:00
todo-txt A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
acpi_upower Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
addscript New scripts and many updates: 2023年08月04日 22:04:08 -05:00
aptsearch A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
backlight Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
battnotify second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
bibleweb removed a todo note for a feature I've already added. 2024年07月03日 07:34:08 -05:00
blogme Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
bt New script: bt -- 2024年02月04日 17:26:59 -06:00
calc A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
centertext Refactor script to remove if-else construct for centering text 2024年07月15日 04:12:53 +00:00
clipboardtoprimarysel Minor updates: 2024年04月10日 07:40:10 -05:00
clipclear Several changes and a few new scripts: 2023年11月05日 14:19:39 -06:00
clipdisp added a -h 2024年07月03日 17:03:50 -05:00
clipwatch New scripts and many updates: 2023年08月04日 22:04:08 -05:00
cpubar second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
cpugov instead of just grabbing the /sys/devices/system/cpu/cpufreq/policy*/scaling_governer files as they come, the script now does a kludgy find ... -exec ls -v ... to list the files in numerical order (a leading zero in the filenames could have prevented this, Linus. 2024年07月08日 18:57:58 -05:00
cputoggle Added array bounds-checking to cputoggle: 2024年07月14日 22:34:05 -05:00
cwmstatus Updates to several scripts, mostly for OpenBSD: 2023年11月19日 23:01:41 -06:00
darkmode Two new scripts and some other changes: 2024年05月18日 15:41:45 -05:00
datestamp A few minor updates and one small new script: 2023年04月29日 21:53:55 -05:00
daylog second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
diceroll second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
displaywindowtitle One new script and a few updates: 2024年05月27日 12:42:06 -05:00
dot-bash_functions-sample second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
dotconfig-i3status-config-sample updated obsdstatus and searchall... 2023年03月14日 14:22:38 -05:00
dpilove added 'dpilove' script 2023年01月21日 14:04:26 -06:00
duck Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
duh Several changes and a few new scripts: 2023年11月05日 14:19:39 -06:00
emoji-picker added an --fzf option because I couldn't get emojis to show up in rofi for some reason 2024年07月11日 13:05:45 -05:00
fcal Minor updates to backlight and fcal: 2024年04月11日 23:30:04 -05:00
fclist-to-csv A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
fileage Updated fileage to work with the BSD's by switching from using "date" to 2024年01月11日 10:55:32 -06:00
filefind Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
fileparentdirfind A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
filesizebreakdown second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
findmenu Some more minor modifications: 2024年03月15日 14:59:01 -05:00
folderfind A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
fontpicker second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
formatphonenumber changed to use the clipi/clipo clipdisp script 2024年07月03日 07:36:32 -05:00
gping second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
ipscan ipscan now prints "(this device)" on the line listing the ip address of the device it is being run on 2024年07月14日 22:39:21 -05:00
kjvfilter Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
LICENSE Updates to LICENSE and timetracker: 2024年05月14日 20:58:27 -05:00
manfind Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
mdis added a -p "prompt" parameter which works just like --prompt="prompt", for convenience 2024年07月14日 22:45:50 -05:00
mkcachedir New script: mkcachedir, updates to seven others... 2023年04月03日 22:30:18 -05:00
motionwatcher second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
mousetoggle A couple updates and a new script: mousetoggle 2023年12月29日 02:58:46 -06:00
naturalscrolling second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
new_workspace Changes to four scripts: 2024年01月02日 23:07:19 -06:00
nmapscan second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
notice had a problem where one system had the fqhn in the $HOSTNAME variable, so I set a $hostname variable to the output of `hostname -s', and used that instead 2024年07月09日 04:38:18 -05:00
obsdstatus A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
patchlog fixed a typo in patchlog (double "=" instead of single in sh test) 2023年03月10日 23:18:19 -06:00
pinglog Some more minor modifications: 2024年03月15日 14:59:01 -05:00
pkg_size second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
pkgbins now gives a helpful error message if you fail to specify a package name 2024年07月10日 01:12:09 -05:00
pkgsizes Updated pkgsizes, searchall, and system_updates_checker to support Fedora and dnf 2024年02月04日 16:42:53 -06:00
powertrack tiny typo in a comment 2024年07月10日 01:20:42 -05:00
primaryseltoclipboard Minor updates: 2024年04月10日 07:40:10 -05:00
processcheck updated processcheck to work better under BSD. Had to account for some output differences when displaying time in ps between Linux and BSD. Updated the sed command, also cleaned up the return code variable increment line to be more modern 2023年01月21日 02:10:02 -06:00
psgrep A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
README.md add new script "winresize" to README.md 2024年07月13日 14:53:22 -05:00
say second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
scrunch second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
searchall Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
showclip Updates to several scripts, mostly for OpenBSD: 2023年11月19日 23:01:41 -06:00
smartcd Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
smartman Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
sndionotify second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
stsizes Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
suspend added some comments to clarify the -c option to die(), which I had forgotten about 2024年07月10日 01:17:58 -05:00
swayrot Some more minor updates (20240521): 2024年05月21日 12:27:58 -05:00
system_updates_checker Updated pkgsizes, searchall, and system_updates_checker to support Fedora and dnf 2024年02月04日 16:42:53 -06:00
temperaturechart A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
temps fixed an error in my grep command for openbsd 2024年06月30日 01:21:11 -05:00
termbar second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
terminaldir New scripts and many updates: 2023年08月04日 22:04:08 -05:00
terminaldir.desktop forgot git add again, lol 2023年01月23日 06:41:48 -06:00
termsize Some very minor updates + one new script: 2023年03月20日 21:51:58 -05:00
textrot10+3 second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
textrot13 second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
tootcounter One new script and a few updates: 2024年05月27日 12:42:06 -05:00
tootme A few new scripts, one rename, and a bunch of changes: 2024年06月16日 11:30:37 -05:00
tootuser A few minor changes: 2024年07月10日 01:38:09 -05:00
trackpad New script: mkcachedir, updates to seven others... 2023年04月03日 22:30:18 -05:00
tupdate The script now attempts to install tut via go install if you want it to (if it's not already installed). Hoping the maintainer picks tut up again, as it's a wonderful utility that hasn't seen an update in a while. 2024年07月03日 14:46:24 -05:00
ulocate ulocate no longer restricts matches to the filename itself, but will match the search term anywhere along the path 2024年07月06日 12:19:21 -05:00
updateall updateall - removed the "checkrestart" invocation (I always found it more annoying than helpful) and added some logic to check "cargo" for crates that need updating 2024年07月13日 23:56:02 -05:00
updateuserdb Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
urlsanitize New scripts: 2023年09月06日 09:02:30 -05:00
volume Some more minor updates (20240521): 2024年05月21日 12:27:58 -05:00
vrms-pacman second try's the charm. Helps to use git add, n00b ;) 2023年01月19日 06:45:33 -06:00
windowlist Huge commit -- sorry, I need to make these more atomic 😁 2024年06月29日 09:44:24 -05:00
winresize new script: winresize 2024年07月13日 14:51:51 -05:00
wofi-calc 20240509: Some minor changes and a couple new scripts 2024年05月09日 13:52:13 -05:00
workspace-name A couple new scripts and a few modest changes: 2024年02月19日 08:33:41 -06:00

scripts

todo: update this README

Some of my scripts that I wrote, many of which I use frequently.

I've tried to add some explanatory comments to the beginning of each one

Any comments you see that look like "## needsterm ##" at the beginning of a file are tags that I sometimes use

Contents:

  • LICENSE - MIT License

  • README.md - This file

  • acpi_upower - Linux script to scrape upower and produce acpi-like output. also projects total battery or charging time based on remaining and percentage

  • addscript - Creates a new script in my ~/bin or ~/bin/scripts directory, populates it with a shebang and shopt, makes it executable, and opens it in the $EDITOR

  • aptsearch - "apt search" is a little slow, and produces visually bloated output (3 lines per entry). This script calls "apt-cache search" for a slightly faster search, but also caches a list of packages from "dpkg -l" (updating if the list is over 4 hours old), and uses that to print an indication if a package in the search results is installed (like "apt search"). Since it's calling "apt-cache search," the output is a lot leaner (only one line per entry). Requires the "fileage" script in this repo

  • backlight - Control backlight in Linux and OpenBSD, useful when bound to keys like Ctrl-Super-+/-

  • battnotify - Script gets battery status in Linux and OpenBSD and sends a notification via notify-send

  • bibleweb - When provided a book and chapter (and optional translation) as parameters, it fetches the text from biblehub.com, does some sed processing to remove extraneous footnotes and unwanted characters, and either displays it in the terminal or using enscript and zathura

  • blogme - A script to simplify writing a pelican-style markdown blog post. Automatically fills out the header with date and title (based on first line entered)

  • bt - a TUI-ish (menu-driven) front-end to bluetoothctl for simple commands like connect and disconnect

  • calc - bc-based calculator for dmenu

  • centertext - Takes text input from $* (ARGV) or STDIN and centers it, filling the left and right margins with spaces. Uses tput to get current terminal columns

  • clipboardtoprimarysel - Move contents of clipboard to primary selection buffer

  • clipclear - Clear the primary and secondary selection buffers, and clipboard

  • clipdisp - Clipboard dispatcher: runs xclip or wl-copy/paste depending on your environment

  • clipwatch - Watch the clipboard for changes and print them

  • cpubar - Prints a CPU utilization bar horizontally down the terminal

  • cpugov - Get status of or control cpu governors (similar to powerprofilesctl, but dead-simple)

  • cputoggle - provides an easy interface for turning individual CPU cores on and off. Requires that the /sys/devices/system/cpu/cpu*/online files are writeable to the user. Optionally depends on "lscpu" for a pretty status display

  • cwmstatus - Takes the output of i3bar and adds the current cwm window group number. Also calls xterm to place the bar on the bottom of the screen (will likely need tweaking for your monitor setup). Depends on obsdstatus, which in turn depends on i3status (comes with the i3/i3-gaps package)

  • darkmode - This is an experimental script to set a dark mode for gtk & qt apps. It is based on scripts found in the dark-mode.d directory of https://gitlab.com/WhyNotHugo/darkman.git

  • datestamp - a simple script to print a standard formatted datestamp or put it in the system clipboard

  • daylog - A little one-line-per day journal program. Looks for and appends to a file called daylog.txt in ~/Documents/Journal/

  • diceroll - Prints a percentage (a roll of 2D10 or 1D100), using /dev/urandom as the PRNG

  • displaywindowtitle - uses zenity to display the current window title. Useful for window managers that don't display a title bar, or for windows that may have a very long title

  • dot-bash_functions-sample - A sample of my ~/.bash_functions file. Some functions in this file are needed by two of these scripts: duh (mountpoint() (but only for OpenBSD) and pkg_size (simplify())

  • dotconfig-i3status-config-sample - A sample of my i3status config. obsdstatus and cwmstatus may be dependent on some particulars of how i3status is configured/formatted

  • dpilove - A simple script to calculate the ppi of a screen. Based loosely on the https://dpi.lv website. Created because I found that site too slow to load

  • duck - A command-line interface to DuckDuckGo, which can call a variety of graphical and terminal web browsers depending on configuration and command-line options

  • duh - Like running du -sh * |sort -h, but including hidden files and excluding mountpoints. Requires the mountpoint() function in my bash_functions sample file if on BSD (calls the mountpoint command in Linux). Note: the mountpoint() function is somewhat half-baked, but is an initial best effort at reproducing the functionality

  • emoji-picker - My fork of https://github.com/end-4/fuzzel-emoji, works in X11, Wayland, and terminal

  • fcal - The calendar filter - takes a set of days as parameters and filters the output of cal/ncal/gcal to show only those days on the calendar

  • fclist-to-csv - This script runs fc-list and dumps every possible value using the tags found in fontconfig.h Depends on XOrg (obviously) and fc-list

  • fileage - Reports the age of a file in hours. Needed by updateuserdb

  • filefind - Finds a file based on regex and uses dmenu as a picker to open it. Dependent on updateuserdb

  • fileparentdirfind - Finds a file's parent directory based on regex and uses dmenu as a picker to open it. Dependent on updateuserdb

  • filesizebreakdown - Find all the files in the current directory and gives a breakdown of storage used by each file type (by extension)

  • findmenu - A dmenu/bemenu interface for triggering the filefind/folderfind/fileparentdirfind scripts

  • folderfind - Finds a folder based on regex and uses dmenu as a picker to open it. Dependent on updateuserdb

  • fontpicker - lets the user pick a console font and uses setfont to change the console/fb font. Only tested on Debian-based and Arch-based Linux distros

  • formatphonenumber - Simply take the clipboard, detect a (U.S.) phone number, and format it nicely, e.g., (123) 456-7890

  • gping - Like cpubar, shows ping times in a graphical way going down the terminal

  • ipscan - uses ping and netcat to scan the subnet for devices

  • kjvfilter - a sed script that attempts to filter the "Authorized Version" / "King James Bible" language into something approaching modern English.

  • manfind - implements man -K (full text search of man db) on systems lacking that function, such as the BSDs

  • mdis - menu dispatcher, detects X11 or wayland and tries to find a suitable menu utility, like dmenu, bemenu, rofi, wofi, or fuzzel

  • mkcachedir - A script I created in OpenBSD to create directories in /tmp for symlinks pointing to /tmp from ~/.cache (using RAMDisk as cache for performance).

  • motionwatcher - A script I wrote to start the 'motion' security camera app whenever the screen was locked. Hasn't been used in a while

  • mousetoggle - A simple script to toggle the mouse pointer on or off using xinput (X11 only). Written for my current OpenBSD laptop

  • naturalscrolling - Uses xinput to enable "natural" scrolling direction for trackpads

  • new_workspace - For i3wm (X11): Figure out which is the next empty workspace and switch to it

  • nmapscan - Calls nmap to scan the subnet

  • notice - a user-level motd-like utility meant to use a single text file synced between all your systems

  • obsdstatus - calls i3status and adds the missing memory usage info for OpenBSD

  • patchlog - Scans through the /var/syspatch directory in OpenBSD and lists the installed patch names, files, and comments

  • pinglog - Simple script to ping an ip address on the internet every minute and keep a log of internet uptime

  • pkgbins - Searches the file list for the given package names and returns the files in various bin directories (just greps for 'bin'). Works in FreeBSD, OpenBSD and Debian, RPM, and Arch-based Linux distros

  • pkg_size - OpenBSD: takes a list of packages from the command line and calls pkg_add -mis to determine the amount the filesystems would grow by if the package (and all its uninstalled depenencies) were installed. Calls the simplify function from my .bash_functions to convert any number of bytes to the largest SI unit equivalent (e.g., KiB, MiB, GiB)

  • pkgsizes - Shows all installed packages sorted by increasing size. Works on Debian, rpm, and Arch-based Linux distros and OpenBSD

  • powertrack - Linux-only: calls acpi_upower (another script here) with some parameters every 60 seconds and logs the output to ~/powerstat.txt. Useful for observing trends in power consumption and battery life in laptops

  • primaryseltoclipboard - Copies the primary selection buffer to the system clipboard

  • processcheck - Given a list of programs as args, it checks to see if they are running and prints an error if they aren't. I use this in my .bashrc to make sure that things like syncthing and redshift are running

  • psgrep - like pgrep, but shows the actual ps output, optionally summing up the memory used by all listed processes

  • say - Tries to find a speech synthesis program to speak the words given by STDIN or arguments

  • scrunch - lossy PNG compressor. Not as good as manually doing it in GIMP. Depends on imagemagick's convert

  • searchall - searches all package managers that I'm familiar with: apt, zypper, pacman, OpenBSD pkg_locate or https://openports.pl, yay (AUR), flatpak, snap, and brew.

  • showclip - Shows the contents of the clipboard both in X11 and Wayland

  • smartcd - relies upon my ulocate family of scripts and fzf. You give it a search path, fzf lets you pick a directory, and it goes to it

  • smartman - Calls man, falls back to using tldr if the manpage isn't found, calls back to running $command --help if tldr doesn't find anything

  • sndionotify - watches sndioctl -m (OpenBSD) and sends a notification when the system volume changes

  • stsizes - Shows the size of syncthing folders, useful for deciding which folders to sync on a new machine with limited space

  • suspend - Simple script that syncs the buffers a couple times and calls the command to suspend the machine. For Linux, OpenBSD, and FreeBSD

  • swayrot - rotate a swaywm screen

  • system_updates_checker - attempts to be a very fast script to check the recency of system updates and remind the user if updates are needed. I run it in my .bashrc on every login

  • temperaturechart - prints a temperature char down the terminal like cpubar and gping. Relies on vcgencmd (Raspberry Pi) or sensors (general Linux)

  • temps - Attempts to report current system temperature in OpenBSD and Linux.

  • termbar - My version of https://github.com/vetelko/termbar/blob/master/bars/gonzalo/termbar. I no longer use it in favor of cwmstatus

  • terminaldir.desktop - the desktop file for the terminaldir script

  • terminaldir - Spawns a terminal at a working directory given as an argument. useful when paired with terminaldir.desktop and used as the default program for opening directories (instead of opening a file manager)

  • termsize - reports the size of the terminal once or until q is pressed. Created because some terminals don't display the size of the terminal (in columns and rows) as they are being resized

  • textrot10+3 - A silly rot13 variant the rotates consonants and vowels separately, producing vaguely pronouncable output

  • textrot13 - A very basic rot13 program

  • todo-txt/timetracker - A front-end for the timetracker plugin to todo.sh that adds a lot of features

  • todo-txt/todo - A front-end for todo.sh/todo-txt which adds a lot of features

  • todo-txt/tstat - A quick status display for todo.sh

  • tootcounter - Uses toot whoami to keep a daily counter of how many toots you toot on Mastodon

  • tootme - My front-end for the toot-editor mode. Gracefully handles failures and toot-too-long conditions

  • tootuser - interactively look up a fediverse user using toot. Pick one with a menu (depends on mdis), and copy to the clipboard (depends on clipdisp)

  • trackpad - Enable and disable the trackpad. uses xinput

  • tupdate - A script I created to update the tut Mastodon TUI client using go install and git. Also installs the manpages for tut

  • ulocate - my own locate script, just for files in my home directory. used by filefind/folderfind/fileparendirfind and calls updateuserdb

  • updateall - Updates all package managers I'm familiar with. Runs pkcon for KDE Neon, apt for debian-based distros, pacman for arch-based distros, zypper for OpenSuSE, yay for the AUR, syspatch and pkg_add on OpenBSD, checks freebsd-update (but doesn't update) and runs pkg upgrade on FreeBSD, and secondary sources flatpak, snap, and homebrew

  • updateuserdb - the updatedb equivalent of my ulocate command

  • urlsanitize - Attempts to sanitize links to icky websites like youtube to more human-friendly alternative front-ends like Invidious

  • volume - Changes the system volume in Linux (using amixer), OpenBSD, and FreeBSD. Useful with a hotkey daemon, or a hotkey service within a tiling window manager

  • vrms-pacman - a "Virtual Richard M. Stallman" program (https://packages.debian.org/bullseye/vrms) for pacman. Usually fails miserably because far too many Arch packages lack the license info

  • windowlist - list windows in your swaywm session

  • wofi-calc - This is my fork of https://github.com/Zeioth/wofi-calc I've cleaned it up a good bit and hopefully made it more readable.

  • winresize - Uses mdis to pop up a message asking what resolution to resize the window to, and then runs xdotool to select the window and then resize it. Useful when you want to resize a window to a precise value, such as setting your browser window to a very common full-screen-equivalent size to make fingerprinting more difficult.

  • workspace-name - Uses xprop to get the name of the current workspace / virtual desktop in both X11 and Wayland. Falls back to specifying the desktop number if no name is found.