Skip to content

Instantly share code, notes, and snippets.

@gm10
gm10 / copy-dir-with-annotation.sh
Created June 25, 2019 14:04
Copy directories while preserving metadata::annotation (Caja Notes)
#!/bin/bash
#
# Copy directories while preserving metadata::annotation
# (C) 2019 gm10
#
if [[ -z $1 || -z $2 ]]; then
echo "Usage: $(basename $0) <source-directory> <target-directory>"
exit
fi
if [[ ! -d $1 ]]; then
@gm10
gm10 / add_backgrounds.py
Created December 10, 2018 09:37
Recursively add all new images in a given path to ~/.config/mate/backgrounds.xml
#!/usr/bin/python3
"""
Recursively adds all new images in a given path to ~/.config/mate/backgrounds.xml
"""
import os, sys
from pathlib import Path
import mimetypes
if not len(sys.argv) == 2 or not os.path.exists(sys.argv[1]):