reservebindslots() {
    local count=$1
    local paths=()

    for ((i = 0; i < count; i++)); do
        paths+=("'\/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${i}/'")
    done

    local joined=$(
        IFS=,
        echo "[${paths[*]}]"
    )

    gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "$joined"
}

custombind() {
    gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$1/ name "$2"
    gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$1/ command "$3"
    gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$1/ binding "$4"
}
