darix
(darix)
March 20, 2019, 4:03pm
8
#!/bin/bash
# MIT License
#
# Copyright (c) 2016-2017 Tobias Ellinghaus
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
This file has been truncated. show original
also needs:
#!/bin/bash
# Partly stolen from http://imagejdocu.tudor.lu/doku.php?id=diverse:commandline:imagej
# Detect readlink or realpath version
# if GNU readlink is known to be installed, this code can be replaced by "alias ReadLink='readlink -f'"
ReadLink='readlink' # Default
OS=$(uname)
if [ "$OS" = "Darwin" -o "$OS" = "FreeBSD" ] && which greadlink >/dev/null 2>&1; then
# Using GNU readlink on MacOS X or FreeBSD
ReadLink='greadlink -f'
elif [ "$OS" = "Darwin" -o "$OS" = "FreeBSD" -o "$OS" = "Linux" ] && which realpath >/dev/null 2>&1; then
if [ -f "$(which readlink)" ] && readlink --version | grep coreutils >/dev/null 2>&1; then
ReadLink='readlink -f' # use GNU readlink
else
# Using realpath on MacOS X or FreeBSD
ReadLink='realpath'
fi
else
ReadLink='echo'
echo "Please install realpath or GNU readlink. Symbolic links may not be resolved properly" >&2
This file has been truncated. show original
maybe I should include that in my RPM.
So kinda a solved problem :))
If you prefer to do it in another language (e.g. one could imagine hooking up something in rapid-photo-downloader), then you find the needed dbus calls in the script.