The s/\\&/&/g operation only effect is to add "amp;" after any ampersand in the artist or song name. "&" displays just fine anyways, so there's no reason to include an operation to replace it.
The part
```
for open in $decrypted; do
[ "$uuid" = "$open" ] && break 1
done
```
exits with `0` if the variable `$decrypted` is empty, causing none of the encrypted devices to be put into the `$unopenedluks` variable. This commit fixes this problem.
* Added timeout to getforecast to prevent status bar breakage.
A 2 second timeout is used in the case that wttr.in is inaccessible when dwm is started; as otherwise it tries to curl wttr.in indefinitely, not allowing other status bar modules to be loaded.
* Update music status bar module on player state change
The previous pull request on LARBS turned out not to work, so make sure `arkenfox-auto-update` runs `arkenfox-update` as the user of the firefox profile. Otherwise it complains that it's running as root and stops.
The way of getting the username is safe, because it gets the username from the owner of the user.js file of that profile.
application/octet-stream mime-type is used for arbitrary binary files, so the best guess at opening those kind of should be based on the extension. before this all of this kind of files were tried to be opened with zathura, now it is the last resort in case the file extension is unknown.
Very arcane.
C ANSI standard requires a newline at the end. GCC will complain.
Email signatures should have a space after the -- according to the
standard. Neomutt does this automatically for you if you have a
signature.
Co-authored-by: Spenser Truex <truex@equwal.com>
The inspiration: (Luke Smith's Video: "Unix Chad JUST WON'T STOP Piping!" youtu.be/w_37upFE-qw
Execution Time: 0.15s to 0.30s on my system (opening a video then closing it to see the output of "time" command)
Very Short Summary:
1- This script feeds the "dmenu" with a list of all videos in a hard drive.
2- File paths and extensions are removed for better readability for the dmenu list.
3- Opens the chosen video file in "mpv" using the complete paths and extensions.
4- An approach of having the least amount of lines & characters while keeping the simplicity and performance has been used.
updatedb command needs to be executed at first showing the database file "~/.config/.mymlocate.db" Or the script should be changed with a new path.
For example: $updatedb -o ~/.config/.mymlocate.db -U /mnt/externaldrive
Thoroughly detailed explanation for everyone:
temp_file=$(mktemp): This command creates a temporary file using the mktemp command and stores its path in the temp_file variable. This temporary file will be used later to store the search results.
locate -d ~/.config/.mymlocate.db -b -r '.*\.\(mp4\|mkv\...)$': This command searches for files with the ".mp4" or other extension in the database located at "~/.config/.mymlocate.db". The -d flag specifies the database path, the -b flag searches for files with matching base names (ignores the path), and the -r flag allows the use of regular expressions for matching.
awk -F/ '{name=$NF; gsub(/\.(mp4|mkv)$/, "", name); print name "\t" $0}': This command processes the search results obtained from the locate command. It uses / as a field separator and works on each line of the output:
name=$NF: Stores the last field (file name with extension) in the name variable.
gsub(/\.(mp4|mkv)$/, "", name): Removes the ".mp4" or ".mkv" file extension from the name variable.
print name "\t" $0: Prints the modified file name (without extension) followed by a tab character and the original line (complete file path with the extension).
> "$temp_file": Redirects the output of the previous awk command to the temporary file created earlier.
chosen_file_name_and_path=$(cut -f1 "$temp_file" | dmenu -i -l 10 -p "Select a video file:"): This command reads the file names without extensions from the temporary file, presents them to the user using dmenu, and stores the user's selection in the chosen_file_name_and_path variable. The cut -f1 command extracts the file names, and the dmenu -i -l 10 -p "Select a video file:" command displays the list in a menu with a prompt.
mpv "$(awk -F'\t' -v chosen="$chosen_file_name_and_path" '$1 == chosen {print $2; exit}' "$temp_file")": This command plays the selected file using mpv. It uses awk to search the temporary file for the line where the first field (file name without extension) matches the user's selection and then extracts the second field (the complete file path with the extension) to pass it as an argument to the mpv command.
&& rm "$temp_file": After the mpv command has finished executing, this command removes the temporary file.
In the current update, the libreoffice package doesn't have any binary for libreoffice writer, calc, impress, draw, etc. So it's better to open all of the document using the 'libreoffice' binary as it can work in the old version of libreoffice as well as the new one.