dired

Mass file conversion using find and exec

convert mp3 to opus The short solution find ./ -type f -name '*.mp3' -exec sh -c 'ffmpeg -i "{}" -f wav - | opusenc --music - "{}.opus"' \; The full journey to the solution The first trick was just to use ffmpeg to convert to .wav, and then to take that .wav output and feed it to opusenc1 ffmpeg -i input.mp3 -f wav - | opusenc –bitrate 256 - output.opus

dragon drag-on with emacs dired

Dragon drag-and-drop The “dragon"1 application (think drag-on) is super handy for #emacs #exwm and probably was made for tiling window managers like iw3m. Go from dired to, eg, Google Drive drag-and-drop. . Footnotes 1 Dragon is available from https://github.com/mwh/dragon

dired no hiline

I was trying to make sure that hl-line mode (to highlight a line) is not on in my dired buffers without changing its presence anywhere else, since it messes up display of my diredfl permission faces. Unfortunately, the following didn’t work, probably because “setting” isn’t the same thing as calling the variable. What was the best way to selectively disable hl-line-mode? There were many good answers on Reddit1. (add-hook 'dired-mode-hook (lambda () (setq-local global-hl-line-mode nil hl-line-mode nil) ;; I wasn't sure on the relationship between ;; these two, or even which one was being used )) Learning along the way: global- is unrelated to hl-line-mode It turns out that global-hl-line does not share anything in common with hl-line-mode other than the end result, so altering one does not alter the other.

Colorize chmod strings in dired

How do I colorize the chmod privileges string? I am using dired+ and dired-hacks and have the ability to colorize the FILES based on the chmod string, but I want the string itself to have colors. I had this a little bit ago but somehow it went away. For example, each column in so that the eye can follow the colors down and easily see permission differences within a directory.

Customizing a Font-Face (dired directories)

I sensed I could improve how my directories appeared in dired, instead of just being bold-face. The question was, how to find which face to change to get the desired result? Digging through my customize-faces options was tedious and sometimes misses the tree for the forest unless you know which one you’re looking for. Locating the face at point Enter the beautiful self-documenting nature of Emacs. Put your cursor on the thing you want to change (remember, our whole philosophy emacs inherited from *Nix is that everything is text).

Bulk multi-line find and replacement with Dired instead of SED

Scenario: I have a directory full of code files (in this case, 51 of them) that each need a find-and-replace executed; however, it is adding a line to part of the code, so replace one line with several. This means that SED cannot do the trick; you’ll get errors like, > > > sed: -e expression #1, char 49: unterminated `s' command Rather than spending the time figuring out how to encode things for SED, the simplest solution was just to use emacs inimitable dired.