The story so far: In the beginning, qBittorrent was created. Then they released v4.5.0. This has made a lot of people very angry and been widely regarded as a bad move.
(If you just want the theme file with completely white text colors, you can download that here. Place it somewhere safe, then open qBT, and go to Tools > Preferences > Behaviour and check the checkbox for "Use custom UI theme". Then browse to the theme file, click OK, and restart qBT)
The problem
The very bad move in this case, was hard-coding foreground colours, while simultaneously not hard-coding background colours. Most, if not all, operating systems in use today will let you choose a theme for your apps, so you can probably see how this quickly becomes a problem. If your app's hard-coded foreground colour has poor contrast with the user's chosen background colour, the user is gonna have a bad time. Sure, they can change their background colour by changing their theme, but why should the user be forced to change their whole system theme because of one app that disregards user choice? So when the eminent qBT team decided to hard-code only one of these, anyone who uses a dark theme in their OS, immediately got problems.
I am a proud KDE user, and like any proud basement-dwelling nerd, I use a dark theme. This dark theme isn't even an obscure, home-brewed one, it is Breeze Dark, which ships with KDE. This works exceptionally well, and disregarding the odd Java app, it works for all apps, mostly regardless of the UI toolkit used to make them. GTK apps, check. Qt apps, check.
Continue reading...
Continuing on the theme of file management from my last post: This script takes a folder of files and randomizes all filenames, whilst keeping the filename extension. This is useful if you're sorting by name, and want to have the files presented in a random order. Some possible use cases are a folder of pictures you intend to post to a blog, do further processing on, and the order and names of the files aren't important.
Usage: cd to the directory that contains the files you wish to randomize the filenames of, then run the script.
randomize_filenames.sh:
#!/bin/bash
# Randomize file names in current working directory, keeping the filename extension
# Modified from: https://unix.stackexchange.com/a/6553
# Ignores dotfiles and subdirectories
find . -type f -not -path '*/.*' |
while read -r name; do
ext=${name##*/}
case $ext in
*.*) ext=.${ext##*.};;
*) ext=;;
esac
newName=`mktemp --dry-run XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`
mv "$name" "$newName$ext"
done
Every so often, I download something off the internet that is delivered as a multitude of files in a root folder, with no kind of sorting applied to it. Big sets of games for the PICO-8 engine, perhaps, or an assorted collection of music files. Often times these sets, especially if they are games, will go onto an embedded device like a modified games console, a flash cart, or onto an emulation handheld, which makes browsing 7349 files a nightmare using only a D-pad on a small screen. The device might not even support showing more than a specific number of files in one directory.
The solution? This Bash script! The script will create folders named 0-9 and A through Z, and move all files that start with a number or letter into its respective folder. At the end, you'll end up with a clean directory structure you can copy to your storage media, and not have to flick through hundreds of pages just because you want to play something that starts with a W.
Usage: cd to the directory containing your unsorted files, then execute the script. Files that do not start with a number or letter will not be moved.
foldersort.sh:
#!/bin/bash
shopt -s nocasematch
dirs=(0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
for file in *
do
for dir in "${dirs[@]}"
do
mkdir -p "$dir"
if [[ $file =~ ^[$dir] ]]
then
mv "$file" "$dir"
break
fi
done
done