collection of small scripts and utilities that I use frequently
should be all posix-compliant
coreutils used are not listed under requirements
edit encrypted
edit an encrypted (gpg
symmetric aes256) file with $EDITOR
gpg
file
grep
diff
$EDITOR
environment variable set in your shell
ee file.norg
(unencrypted) - starts$EDITOR
onfile.norg
ee file.norg
(nonexistent) - starts$EDITOR
on a temp file and encrypts it tofile.norg
after editor exitee file.norg
(encrypted) - decrypts to a temp file, opens temp file with$EDITOR
, and re-encrypts tofile.norg
after editor exit
file picker
pick files with fzf
(descending modification date) and open dragon-drop
with them
find
sed
grep
fzf
awk
dragon-drop
- an executable (previewer) in
$PATH
run on Ctrl+O, or provide a previewer through command-line arguments
fp
- opens fzf on the current directory and opensdragon-drop
on selected filesfp dir/subdir '\.png$'
- opens fzf on the directorydir/subdir
(excluding files matching the pattern\.png$
) and opensdragon-drop
on selected filesfp . '^$' previewer.sh
- opens fzf on the directory.
(excluding nothing) with the previewerpreviewer.sh
and opensdragon-drop
on selected files
neorg export
export .norg
files to other formats (most notably pdf) using pandoc
see ne -h
for more info
ps
grep
kill
nvim
(with Neorg plugin)sed
pandoc
lualatex
see ne -h
for more info
ne file.norg
- exportfile.norg
as a pdf (default format)ne file.norg -t pdf -f
- exportfile.norg
as a pdf with formal mode onne file.norg -t latex -p ~/org/.util/preamble.tex
- exportfile.norg
as a latex file with the preamble~/org/.util/preamble.tex
qr code
scan qr codes with flameshot
and zbarimg
or create qr codes with qrencode
qrencode
flameshot
zbarimg
grep
qr d
- useflameshot
to select an area and decode qr withzbarimg
qr e -o test.png https://github.com/Apeiros-46B/scripts
- create a qr code intest.png
with a link to this repository
sed map
use a sed
expression and map a command to it with the original input as 1st argument and the result of the expression as 2nd argument
sed
sm 's/ /_/g' mv *
- replace_
in the names of the files matching the glob*
(test 1.txt
would be moved (mv
) totest_1.txt
)sm 's/test// echo test1 test2 test3
- echo original filenames oftest1
,test2
, andtest3
alongside with1
,2
, and3
(filenames withtest
removed)
toggle executable
toggle executable status of a file, using sudo
if necessary
sudo
chmod
tx file.sh
- toggle executable bit on the filefile.sh
tx file.sh
(not writable by current user) - toggle executable bit on the (not writable) filefile.sh
, withsudo
xclip
simplify pasting from x clipboard using xclip
xclip
xc test.txt
- paste the clipboard contents totest.txt
xc test.png image/png
- paste the clipboard contents as png image data totest.png
youtube
simplify downloading videos from youtube using yt-dlp
yt-dlp
yt a mp3 <a youtube link>
- downloads youtube video as mp3 audio with best-available qualityyt v mov <a youtube link>
- downloads youtube video as mov video with best-available quality
git right prompt for zsh
usage: put precmd() { RPROMPT="$(gitzsh)"; }
in your .zshrc