diff options
| author | filip <“filip.rabiega@gmail.com”> | 2026-01-21 10:36:12 +0100 |
|---|---|---|
| committer | filip <“filip.rabiega@gmail.com”> | 2026-01-21 10:36:12 +0100 |
| commit | 88f0243428c4cf39029c8ffc5a7e1634951158a0 (patch) | |
| tree | f8b05b9f056dd72b7955f90560c453b4c317bd92 | |
| parent | 83954961af8b6337da100e038561f2fd975ac1fe (diff) | |
| download | chadscripts-88f0243428c4cf39029c8ffc5a7e1634951158a0.tar.gz chadscripts-88f0243428c4cf39029c8ffc5a7e1634951158a0.tar.bz2 chadscripts-88f0243428c4cf39029c8ffc5a7e1634951158a0.zip | |
add comments to some scripts
| -rwxr-xr-x | batterylow | 1 | ||||
| -rwxr-xr-x | bmks | 13 | ||||
| -rwxr-xr-x | brightness | 1 | ||||
| -rwxr-xr-x | de | 1 | ||||
| -rwxr-xr-x | deploy | 1 | ||||
| -rwxr-xr-x | dictloop | 23 | ||||
| -rwxr-xr-x | dpass | 3 | ||||
| -rwxr-xr-x | dz | 1 | ||||
| -rwxr-xr-x | dz-feed | 1 | ||||
| -rwxr-xr-x | echovol | 1 | ||||
| -rwxr-xr-x | engadd | 1 | ||||
| -rwxr-xr-x | inpath | 1 | ||||
| -rwxr-xr-x | logrm | 1 | ||||
| -rwxr-xr-x | lsn | 2 | ||||
| -rwxr-xr-x | maimpick | 1 | ||||
| -rwxr-xr-x | mansplain | 1 | ||||
| -rwxr-xr-x | mounter | 1 | ||||
| -rwxr-xr-x | newnote | 1 | ||||
| -rwxr-xr-x | newscript | 1 | ||||
| -rwxr-xr-x | newsup | 1 | ||||
| -rwxr-xr-x | notesplain | 1 | ||||
| -rwxr-xr-x | packsize | 1 | ||||
| -rwxr-xr-x | printpath | 1 | ||||
| -rwxr-xr-x | remaps | 1 | ||||
| -rwxr-xr-x | rmw | 3 | ||||
| -rwxr-xr-x | rssadd | 1 | ||||
| -rwxr-xr-x | scan | 2 | ||||
| -rwxr-xr-x | todo | 1 | ||||
| -rwxr-xr-x | via-feed | 11 | ||||
| -rwxr-xr-x | via-open | 2 | ||||
| -rwxr-xr-x | viaup | 2 |
31 files changed, 56 insertions, 27 deletions
@@ -1,4 +1,5 @@ #!/bin/sh +# This script sends notifications when battery is low. # those variables may be unnecessary export DISPLAY=:0 @@ -1,4 +1,5 @@ #!/bin/bash +# This script is for handling bookmarks. # set prefered launcher PREFERED_LAUNCHER="dmenu" @@ -69,10 +70,10 @@ bmks_check() { case "$1" in "help") show_usage ;; -"add") url=$2; bmks_add ;; -"del") bmks_del ;; -"ls") bmks_ls ;; -"dmenu") PREFERED_LAUNCHER=$1; bmks_display ;; -"fzf") PREFERED_LAUNCHER=$1; bmks_display ;; -*) bmks_display ;; + "add") url=$2; bmks_add ;; + "del") bmks_del ;; + "ls") bmks_ls ;; + "dmenu") PREFERED_LAUNCHER=$1; bmks_display ;; + "fzf") PREFERED_LAUNCHER=$1; bmks_display ;; + *) bmks_display ;; esac @@ -1,4 +1,5 @@ #!/bin/sh +# This script is for managing system brightness. It is envoked by dwm. case "$1" in up) sudo brightnessctl s "10%+" ;; @@ -1,3 +1,4 @@ #!/bin/sh +# Garbage script for translating words into and from German. sdcv -u 'German - English' -u 'English - German' "$1" @@ -1,4 +1,5 @@ #!/bin/sh +# Helper script to deploy my website automatically. user="root" host="rabiega.xyz" @@ -1,16 +1,21 @@ -#!/usr/bin/zsh +#!/bin/sh +# Script for checking multiple definitions one after another -setopt aliases -source "$ZDOTDIR/aliasrc" +# Load aliases if available +if [ -n "$ZDOTDIR" ] && [ -f "$ZDOTDIR/aliasrc" ]; then + . "$ZDOTDIR/aliasrc" +fi -[ "$#" -ne 1 ] && { +# Argument check +if [ "$#" -ne 1 ]; then echo "Usage: dictloop <dict>" >&2 exit 1 -} -dict="$1" # a command-line dictionary +fi -while true; do - echo "Enter a word: " +dict=$1 + +while :; do + printf "Enter a word: " read -r word if [ -z "$word" ] || [ "$word" = "exit" ]; then @@ -20,5 +25,3 @@ while true; do "$dict" "$word" done - -exit 0 @@ -1,6 +1,7 @@ #!/bin/sh +# Select a password in dmenu and copy it dir="${PASSWORD_STORE_DIR:-$HOME/.password-store}" password=$(find "$dir" -type f -name '*.gpg' | -sed 's/.*\/\(.*\)\.gpg$/\1/' | dmenu -i -p "Pass:") + sed 's/.*\/\(.*\)\.gpg$/\1/' | dmenu -i -p "Pass:") [ -n "$password" ] && pass show -c "$password" @@ -1,3 +1,4 @@ #!/bin/bash +# Select a pdf file in dmenu and open it in zathura dz-feed | dmenu -p "dz" -i -l 15 | xargs -r zathura @@ -1,4 +1,5 @@ #!/bin/sh +# Cache pdf files to be opened with dz cache="$HOME/.cache/dz" @@ -1,4 +1,5 @@ #!/bin/sh +# Print current volume on standard output volume=$(pactl list sinks | grep -A 15 'Sink #0' | grep 'Volume:' | awk '{print $5}' | tr -d '%' | head -1) mute=$(pactl list sinks | grep -A 15 'Sink #0' | grep 'Mute' | awk '{print $2}') @@ -1,3 +1,4 @@ #!/bin/sh +# Garbage script to add obscure words to file echo "$1" >> "$HOME"/langs/english/obscure_words @@ -1,4 +1,5 @@ #!/bin/sh +# Check if a command is in PATH in_path() { cmd=$1 path=$2 res=1 @@ -1,4 +1,5 @@ #!/bin/sh +# Remove a file and log the removal removelog="/var/log/remove.log" @@ -1,7 +1,7 @@ #!/bin/sh - # New and better ls # TODO: fix simlinks, flags break them for some reason, maybe switch to eza + ls_new() { LC_ALL=C $(which ls) -lAFh --color=always "$1" | awk '{ name = $9; @@ -1,5 +1,4 @@ #!/bin/sh - # It lets you choose the kind of screenshot to take, including copying # the image or even highlighting an area to copy. scrotcucks on suicidewatch right now. @@ -1,4 +1,5 @@ #!/bin/sh +# Choose a man manual in dwm and open it in zathura arg="$( man -k . | dmenu -l 15 | awk '{print $1}')" [ -n "$arg" ] && man -Tpdf "$arg" | zathura - @@ -1,5 +1,4 @@ #!/bin/bash - # Mounts Android Phones and USB drives (encrypted or not). This script will # replace the older `dmenumount` which had extra steps and couldn't handle # encrypted drives. @@ -1,4 +1,5 @@ #!/bin/sh +# Add a new note dir="$OBSIDIAN_HOME" @@ -1,4 +1,5 @@ #!/bin/sh +# Add a new script newscript() { file="$HOME/.scripts/$1" @@ -1,4 +1,5 @@ #!/bin/sh +# Update newsboat and send a notification export DISPLAY=:0.0 export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus @@ -1,4 +1,5 @@ #!/bin/sh +# Open a markdown note in zathura dir="$OBSIDIAN_HOME" file="$(ls -1 "$dir" | sed 's/\.md$//' | dmenu -l 15 -p 'Select note:')" @@ -1,3 +1,4 @@ #!/bin/sh +# List all installed packages and list them by their size. dpkg-query -W --showformat='${Package} ${Installed-Size}\n' | sort -k2 -n -r @@ -1,4 +1,5 @@ #!/bin/sh +# Print everythin in PATH echo "$PATH" | tr ':' '\n' | while IFS= read -r dir; do [ -d "$dir" ] || continue @@ -1,4 +1,5 @@ #!/bin/sh +# Remap stuff # Increase key speed xset r rate 200 80 @@ -1,7 +1,8 @@ #!/bin/sh +# Remove whitespaces in all the files in a given directory if [ "$#" -gt 1 ]; then - echo "Usage: rm_whitespaces <dir>" >&2 + echo "Usage: rmw <dir>" >&2 exit 1 fi @@ -1,4 +1,5 @@ #!/bin/sh +# Add a new RSS feed if echo "$1" | grep -q "https*://\S\+\.[A-Za-z]\+\S*"; then url="$1" @@ -1,7 +1,7 @@ #!/bin/sh # Find all files in subdirectories (excluding top-level files) -file=$(find . -mindepth 2 -type f 2>/dev/null | sed 's|^\./||' | sort | dmenu -i -p "Select a file:") +file=$(find . -mindepth 2 -type f 2>/dev/null | sed 's|^\./||' | sort | dmenu -l 15 -p "Select a file:") # If a file was selected if [ -n "$file" ]; then @@ -4,7 +4,6 @@ # # Select an existing entry to remove it from the file, or type a new entry to # add it. -# file="$HOME/.local/opt/todo" touch "$file" @@ -5,8 +5,15 @@ cache="$HOME/.cache/via" if [[ "$1" == "-r" ]] || [[ ! -e "$cache" ]]; then cat "$HOME/.config/via/shortcuts" > "$cache" cat "$HOME/.config/via/websites" >> "$cache" - find "$HOME" -mindepth 1 \( -type d -name ".*" ! -path "$HOME/.scripts" -o -path "$HOME/cell" -o -path "$HOME/phone/*" \) -prune -o -print | sort >> "$cache" - # notify-send "via cache updated." + find "$HOME" -mindepth 1 \ + \( \ + -type d -name ".*" ! -path "$HOME/.scripts" \ + -o -path "$HOME/cell" \ + -o -path "$HOME/phone/*" \ + \) -prune \ + -o -print \ + | sort >> "$cache" + # notify-send "via cache updated." fi if [ "$CRON" = "1" ]; then @@ -48,7 +48,7 @@ while read -r arg; do sxiv "$arg" & ;; *) - exit 1 + $TERMINAL $EDITOR "$arg" & ;; esac ;; @@ -4,4 +4,4 @@ export HOME=/home/filipek via-feed -r > /dev/null -notify-send "via cache updated." +# notify-send "via cache updated." |
