

I appreciate him trying to drum up excitement for the terminal. A lot of people are afraid of it and I understand why, but you don’t need to know everything about it in order to benefit from it.
I wanted to post some Trackmania replays to Bluesky when they first rolled out video, but they only supported up to 50MB. I dreaded having to open kdenlive, figure out how to work the GUI and then also possibly have to do some terrible math to balance size and quality. Maybe this is easier than I expected, but I found this: https://unix.stackexchange.com/questions/520597/how-to-reduce-the-size-of-a-video-to-a-target-size
ffmpeg_resize () {
file=$1
target_size_mb=$2 # target size in MB
target_size=$(( $target_size_mb * 1000 * 1000 * 8 )) # target size in bits
length=`ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$file"`
length_round_up=$(( ${length%.*} + 1 ))
total_bitrate=$(( $target_size / $length_round_up ))
audio_bitrate=$(( 128 * 1000 )) # 128k bit rate
video_bitrate=$(( $total_bitrate - $audio_bitrate ))
ffmpeg -i "$file" -b:v $video_bitrate -maxrate:v $video_bitrate -bufsize:v $(( $target_size / 20 )) -b:a $audio_bitrate "${file}-${target_size_mb}mb.mp4"
}
ffmpeg_resize file1.mp4 25 # resize `file1.mp4` to 25 MB
ffmpeg_resize file2.mp4 64 # resize `file2.mp4` to 64 MB
I’m not proficient in bash enough to have written this myself, but even I can glance over this and see it’s just doing some math for me while invoking two programs: ffprobe and ffmpeg. Easy peasy.
I put this in my ~/.bashrc and use it all the time now, it’s almost silly how simple this has made things. I get why nerds get super attached to their profiles now, I’m collecting a bunch of scripts and functions that just make life easier.
Currently I’m working on writing some scripts with ratbagctl (https://github.com/libratbag/libratbag) so when I launch a game through Steam it’ll automatically set my Logitech mouse profile for that game. You know, the thing the Logitech mouse software makes you sign up for an account and connect to the internet for. All of the control, none of the bloat 😝
EDIT: More information provided. I disagree with the upvoted comment implying you should leave your system alone because you might break something. You’re using Arch, and part of the reason to use Arch is understanding how you built and maintain your system. Understanding how to inspect your system and perform proper maintenance is a crucial part of that. Read and think carefully before taking any actions and make sure any important information is backed up before taking major actions. Without throwing too much further shade, I find it disappointing so many in the community would take that stance and discourage you from pursuing this further.
When I switched to Arch, I started a notebook in Obsidian with a bunch of different information in it, I have a section devoted to Maintenance. Here are a few things I’ve put in there:
Clean package cache with paccache: https://ostechnix.com/recommended-way-clean-package-cache-arch-linux/
Clean orphaned dependencies:
sudo pacman -Rs $(pacman -Qtdq)
Additionally, you can run
pacman -Qe
to list the packages you yourself have explicitly installed with pacman, orpacman -Qdt
to list the packages that are dependencies of other packages. Usepacman -Qm
to list packages not found in the official repositories (i.e., things installed through yay). This will allow you to review packages you may have explicitly installed in the past for some reason, but now find you no longer need.For yay, I’m unsure if I should be using
-Yc
,-Sc
, or-Scc
. If anyone has more info with that, I’d appreciate it.For flatpak:
flatpak uninstall --unused
And for journals:
journalctl --vacuum-time 7days
That’s most of the “automatic” stuff, cruft that can be cleaned out with little to no consequence. Other than that, you’ll just have to manually review what you have on your system.
If anyone has other commands or comments on the ones I provided, I’d be happy to accept further advice here as well 😃