Edit: Newer versions posted later.
I was able to fix the "copy/paste" functionality. The problem was that the clipboard was "set" during initialization instead of when actually doing a "copy" or "cut", so it would stop working as soon as another program used the clipboard. Once I moved the "set" function to the proper place the strange behavior stopped.
For debugging I wrote some scripts that use xclip to copy and paste from the command line, I don't know if anyone else might find them useful?
g-copy
Code: Select all
#!/bin/bash
case $@ in
-h|-*help|-*usage)
echo "Usage: $(basename $0) <files to copy>"
exit 0
;;
"")
echo "Usage: $(basename $0) <files to copy>"
exit 1
;;
esac
clipboard="copy
"
for one_arg in "$@"
do
#echo "X${one_arg}X"
filename=$(realpath "${one_arg}")
#echo "${filename}"
clipboard="${clipboard}file://${filename}
"
done
echo "${clipboard}" | xclip -i -selection clipboard -t x-special/gnome-copied-files
Code: Select all
#!/bin/bash
case $@ in
-h|-*help|-*usage)
echo "Usage: $(basename $0) <files to cut>"
exit 0
;;
"")
echo "Usage: $(basename $0) <files to cut>"
exit 1
;;
esac
clipboard="cut
"
for one_arg in "$@"
do
#echo "X${one_arg}X"
filename=$(realpath "${one_arg}")
#echo "${filename}"
clipboard="${clipboard}file://${filename}
"
done
echo "${clipboard}" | xclip -i -selection clipboard -t x-special/gnome-copied-files
Code: Select all
#!/bin/bash
carriage_return=$(echo -ne '\r')
filelist=$(xclip -o -selection clipboard -t x-special/gnome-copied-files)
paste_mode=$(echo "${filelist}" | head -n 1)
#echo "X${paste_mode}X"
while read line
do
line=${line//${carriage_return}/}
#echo "X${line}X"
if [ "${line}" = "${paste_mode}" ]; then
continue
fi
filename=${line#file:\/\/}
#echo "${filename}"
if [ -e "${filename}" ]; then
if [ "${paste_mode}" = "cut" ]; then
mv -f "${filename}" .
else
cp -af --no-preserve=context,links "${filename}" .
fi
else
echo "Error parsing line: ${line}"
fi
done <<< "${filelist}"
Edit: Newer versions posted later.
But as before, be warned that they will reset your desktop background, overwrite your pin-board and possibly other unwanted changes... They are meant for woof builds. Also @peebee please DON'T upload to ibiblio unless or until you are confident that they work properly. I am posting them for more thorough testing.
Edit: Added 64 bit standalone version.
Edit2: Removed old links, newer versions posted later.