Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-05-09 23:08:06

JmaCWQ
Member
Registered: 2022-12-06
Posts: 61

[SOLVED] Copy/Paste on Desktop without asking for Confirmation?

Hello All,

If I'm viewing any folder with Thunar and copy/paste any file in that same folder, it auto creates the copy and names it "filename (copy 1).extension".
But if I do this on the Desktop I always get the "Confirm to replace files" message box and have to select an option.
On older versions of Xfce this wasn't the case and it would auto create the copy without asking, which I'd prefer.

Is there a way to reinstate this behaviour so that if I copy/paste something on the Desktop it just creates the copy without asking each time?

If I right click and "Open in new window" on the Desktop, then minimise that window, then on the Desktop copy/paste something it works as desired and auto creates the copy without asking.
But if I close the Desktop window that's minimised it stops working and the "Confirm to replace files" message appears again.

Thanks

Snapshot created on: 20240506_2146
System:    Kernel: 5.10.0-28-amd64 [5.10.209-2] x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.10.0-28-amd64 root=UUID=<filter> ro quiet 
           nosplash consoleblank=0 
           Desktop: Xfce 4.18.1 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.18.0 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.3_x64 Wildflower June 03  2023 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Desktop System: Dell product: OptiPlex 9020 v: 01 serial: <filter> Chassis: 
           type: 15 serial: <filter> 
           Mobo: Dell model: 00V62H v: A01 serial: <filter> BIOS: Dell v: A09 date: 11/20/2014 
CPU:       Info: Quad Core model: Intel Core i5-4590 bits: 64 type: MCP arch: Haswell family: 6 
           model-id: 3C (60) stepping: 3 microcode: 28 cache: L2: 6 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 26341 
           Speed: 1261 MHz min/max: 800/3700 MHz Core speeds (MHz): 1: 1261 2: 1253 3: 1239 
           4: 1199 
           Vulnerabilities: Type: gather_data_sampling status: Not affected 
           Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled 
           Type: mds mitigation: Clear CPU buffers; SMT disabled 
           Type: meltdown mitigation: PTI 
           Type: mmio_stale_data status: Unknown: No mitigations 
           Type: retbleed status: Not affected 
           Type: spec_rstack_overflow status: Not affected 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: disabled, 
           RSB filling, PBRSB-eIBRS: Not affected 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics vendor: Dell 
           driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:0412 class-ID: 0300 
           Display: x11 server: X.Org 1.20.11 compositor: xfwm4 v: 4.18.0 driver: 
           loaded: modesetting unloaded: fbdev,vesa display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") 
           s-diag: 582mm (22.9") 
           Monitor-1: VGA-1 res: 1920x1080 hz: 60 dpi: 96 size: 509x286mm (20.0x11.3") 
           diag: 584mm (23") 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4600 (HSW GT2) v: 4.5 Mesa 20.3.5 
           compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Dell 
           driver: snd_hda_intel v: kernel bus-ID: 00:03.0 chip-ID: 8086:0c0c class-ID: 0403 
           Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Dell 
           driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20 class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.0-28-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Intel Ethernet I217-LM vendor: Dell driver: e1000e v: kernel port: f060 
           bus-ID: 00:19.0 chip-ID: 8086:153a class-ID: 0200 
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 931.51 GiB used: 286.68 GiB (30.8%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD10EZEX-75M2NA0 
           size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD 
           rpm: 7200 serial: <filter> rev: 1A01 scheme: MBR 
Partition: ID-1: / raw-size: 919.51 GiB size: 904 GiB (98.31%) used: 286.68 GiB (31.7%) fs: ext4 
           dev: /dev/sda1 maj-min: 8:1 
Swap:      Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 12 GiB used: 0 KiB (0.0%) priority: -2 
           dev: /dev/sda2 maj-min: 8:2 
Sensors:   System Temperatures: cpu: 29.8 C mobo: 27.8 C 
           Fan Speeds (RPM): N/A 
Repos:     Packages: 2837 note: see --pkg apt: 2832 lib: 1536 flatpak: 5 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 
           1: deb [arch=amd64] [url]https://brave-browser-apt-release.s3.brave.com/[/url] bullseye main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb [url]http://deb.debian.org/debian[/url] bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb [url]http://deb.debian.org/debian[/url] bullseye main contrib non-free
           2: deb [url]http://security.debian.org/debian-security[/url] bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb [url]http://mx.debian.nz/mx/repo/[/url] bullseye main non-free
           Active apt repos in: /etc/apt/sources.list.d/vivaldi.list 
           1: deb [arch=amd64] [url]https://repo.vivaldi.com/stable/deb/[/url] stable main
Info:      Processes: 195 Uptime: 4h 34m wakeups: 1 Memory: 31.26 GiB used: 1.55 GiB (5.0%) 
           Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: N/A 
           alt: 10 Client: shell wrapper v: 5.1.4-release inxi: 3.3.06 
Boot Mode: BIOS (legacy, CSM, MBR)

Last edited by JmaCWQ (2025-06-06 04:17:46)

Offline

#2 2025-06-05 16:53:19

JmaCWQ
Member
Registered: 2022-12-06
Posts: 61
LinuxFirefox 128.0

Re: [SOLVED] Copy/Paste on Desktop without asking for Confirmation?

Can somebody please try the following to see if it's a further issue with the behaviour I mentioned above?

Have a file on the Desktop, right click & copy it, then right click and paste on the Desktop, when the message box comes up asking to rename or replace etc. click Replace.

Does your file disappear?

After the file vanishes, if I right click & Paste on the Desktop again I get a message "Error getting information from ~/Desktop/name-of-file no such file or directory"

Also try creating a new folder on the Desktop, leave it empty, right click & copy it, then right click on the Desktop and Paste, nothing happens.

Put some files in that folder, then from the Desktop right click and copy the folder, then right click and Paste on the Desktop, this time the message comes up asking to rename, replace etc. the files that were put in the folder.
Click Replace, open the folder and the files are gone.

As with the previous post scenario, when working with the Desktop open as a Thunar window these things don't happen, it works as it should, the empty folder gets copied and auto renamed, and the files remain inside the folder as they should when it's copied.

Those issues are repeatable every time.

Thanks

Snapshot created on: 20250525_2107
System:    Kernel: 5.10.0-35-amd64 [5.10.237-1] x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.10.0-35-amd64 root=UUID=<filter> ro quiet 
           nosplash consoleblank=0 
           Desktop: Xfce 4.18.1 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.18.0 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.3_x64 Wildflower June 03  2023 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Desktop System: Dell product: OptiPlex 9020 v: 01 serial: <filter> Chassis: 
           type: 15 serial: <filter> 
           Mobo: Dell model: 00V62H v: A01 serial: <filter> BIOS: Dell v: A09 date: 11/20/2014 
CPU:       Info: Quad Core model: Intel Core i5-4590 bits: 64 type: MCP arch: Haswell family: 6 
           model-id: 3C (60) stepping: 3 microcode: 28 cache: L2: 6 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 26339 
           Speed: 916 MHz min/max: 800/3700 MHz Core speeds (MHz): 1: 916 2: 920 3: 939 4: 959 
           Vulnerabilities: Type: gather_data_sampling status: Not affected 
           Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled 
           Type: mds mitigation: Clear CPU buffers; SMT disabled 
           Type: meltdown mitigation: PTI 
           Type: mmio_stale_data status: Unknown: No mitigations 
           Type: reg_file_data_sampling status: Not affected 
           Type: retbleed status: Not affected 
           Type: spec_rstack_overflow status: Not affected 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: disabled, 
           RSB filling, PBRSB-eIBRS: Not affected 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics vendor: Dell 
           driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:0412 class-ID: 0300 
           Display: x11 server: X.Org 1.20.11 compositor: xfwm4 v: 4.18.0 driver: 
           loaded: modesetting unloaded: fbdev,vesa display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") 
           s-diag: 582mm (22.9") 
           Monitor-1: VGA-1 res: 1920x1080 hz: 60 dpi: 96 size: 509x286mm (20.0x11.3") 
           diag: 584mm (23") 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4600 (HSW GT2) v: 4.5 Mesa 20.3.5 
           compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Dell 
           driver: snd_hda_intel v: kernel bus-ID: 00:03.0 chip-ID: 8086:0c0c class-ID: 0403 
           Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Dell 
           driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20 class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.0-35-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Intel Ethernet I217-LM vendor: Dell driver: e1000e v: kernel port: f060 
           bus-ID: 00:19.0 chip-ID: 8086:153a class-ID: 0200 
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 931.51 GiB used: 405.81 GiB (43.6%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD10EZEX-75M2NA0 
           size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD 
           rpm: 7200 serial: <filter> rev: 1A01 scheme: MBR 
Partition: ID-1: / raw-size: 919.51 GiB size: 904 GiB (98.31%) used: 405.81 GiB (44.9%) fs: ext4 
           dev: /dev/sda1 maj-min: 8:1 
Swap:      Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 12 GiB used: 0 KiB (0.0%) priority: -2 
           dev: /dev/sda2 maj-min: 8:2 
Sensors:   System Temperatures: cpu: 29.8 C mobo: 27.8 C 
           Fan Speeds (RPM): N/A 
Repos:     Packages: note: see --pkg apt: 2943 lib: 1555 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 
           1: deb [arch=amd64] [url]https://brave-browser-apt-release.s3.brave.com/[/url] bullseye main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb [url]http://deb.debian.org/debian[/url] bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb [url]http://deb.debian.org/debian[/url] bullseye main contrib non-free
           2: deb [url]http://security.debian.org/debian-security[/url] bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb [url]http://mx.debian.nz/mx/repo/[/url] bullseye main non-free
           Active apt repos in: /etc/apt/sources.list.d/vivaldi.list 
           1: deb [arch=amd64] [url]https://repo.vivaldi.com/stable/deb/[/url] stable main
Info:      Processes: 202 Uptime: 9h 22m wakeups: 1 Memory: 31.26 GiB used: 2 GiB (6.4%) 
           Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: N/A 
           alt: 10 Client: shell wrapper v: 5.1.4-release inxi: 3.3.06 
Boot Mode: BIOS (legacy, CSM, MBR)

Offline

#3 2025-06-05 17:45:47

CwF
Moderator
Registered: 2018-01-28
Posts: 310
LinuxFirefox 128.0

Re: [SOLVED] Copy/Paste on Desktop without asking for Confirmation?

Sorry, can not duplicate.
create ~/Desktop/test
create ~/Desktop/test/test.txt with contents
right click copy ~/Desktop/test
right click paste, answer replace...
all ok
right click past, answer rename
creates test (copy 1).txt in existing folder with contents, original txt file still there, does not create new directory.
...all ok

done on Debian 12.x, only condition altered is ~/Desktop is a tmpfs.

Offline

#4 2025-06-05 18:18:46

JmaCWQ
Member
Registered: 2022-12-06
Posts: 61
LinuxFirefox 128.0

Re: [SOLVED] Copy/Paste on Desktop without asking for Confirmation?

Thanks.
Seems it's only my one machine that I see it on.
I have 2 laptops, one with MX-21.3 and the other with MX-23.6 and I can't duplicate it on both of them either.
I guess I'll just have to be sure not to hit Replace instead of Rename on this particular machine so I don't lose anymore files.

EDIT: I never have the Rubbish icon shown on the Desktop but turned it on thinking maybe the files that had vanished might have been in there, but they aren't.

Last edited by JmaCWQ (2025-06-05 18:20:46)

Offline

#5 2025-06-05 20:39:25

gogogadget
Member
From: EU
Registered: 2023-03-19
Posts: 36
LinuxFirefox 139.0

Re: [SOLVED] Copy/Paste on Desktop without asking for Confirmation?

Hello,

JmaCWQ wrote:

Have a file on the Desktop, right click & copy it, then right click and paste on the Desktop, when the message box comes up asking to rename or replace etc. click Replace.

I have no box, it just copy the file and add (copy 1) to the name.


EndeavourOS
Xfce+gtk3-classic (no CSD)+Picom

Offline

#6 2025-06-05 23:43:10

Misko_2083
Member
Registered: 2015-10-13
Posts: 223
Website
LinuxFirefox 128.0

Re: [SOLVED] Copy/Paste on Desktop without asking for Confirmation?

#!/bin/bash
# copy-to-desktop-dbus.sh

dest_dir="$HOME/Desktop"
working_dir="$HOME/Desktop"
display=":0.0"
startup_id=""

# Ensure Desktop directory exists
if [[ ! -d "$dest_dir" ]]; then
    notify-send "Error" "Desktop directory not found"
    exit 1
fi

# Check if any files are provided
if [[ $# -eq 0 ]]; then
    notify-send "Error" "No files selected"
    exit 1
fi

# Initialize arrays for source and target URIs
source_uris=()
target_uris=()

# Process each selected file
for source_file in "$@"; do
    # Validate source file
    if [[ ! -e "$source_file" ]]; then
        notify-send "Error" "File not found: $source_file"
        continue
    fi

    # Extract filename and extension
    filename=$(basename "$source_file")
    name="${filename%.*}"
    ext="${filename##*.}"
    if [[ "$filename" == "$ext" ]]; then
        ext=""
    else
        ext=".$ext"
    fi

    # Find next available numbered copy
    dest_file="$dest_dir/$filename"
    counter=1
    while [[ -e "$dest_file" ]]; do
        dest_file="$dest_dir/$name (copy $counter)$ext"
        ((counter++))
    done

    # Add to URI arrays
    source_uris+=("file://$source_file")
    target_uris+=("file://$dest_file")
done

# Check if any valid files were processed
if [[ ${#source_uris[@]} -eq 0 ]]; then
    notify-send "Error" "No valid files to copy"
    exit 1
fi

# Format arrays for gdbus
source_array=$(printf "'%s'," "${source_uris[@]}")
source_array="[${source_array%,}]"
target_array=$(printf "'%s'," "${target_uris[@]}")
target_array="[${target_array%,}]"

# Perform the copy using gdbus with correct sasasss signature
gdbus call --session \
    --dest org.xfce.Thunar \
    --object-path /org/xfce/FileManager \
    --method org.xfce.FileManager.CopyTo \
    "$working_dir" \
    "$source_array" \
    "$target_array" \
    "$display" \
    "$startup_id" \
    >> /tmp/dbus-copy.log 2>&1

# Notify user of result
if [[ $? -eq 0 ]]; then
    notify-send "Success" "Copied ${#source_uris[@]} files to Desktop"
else
    notify-send "Error" "Failed to copy files. Check /tmp/dbus-copy.log"
fi

Save: Save as copy-to-desktop-dbus.sh in /home/username/scripts (or another directory in your PATH).

Make executable: chmod +x /home/username/scripts/copy-to-desktop-dbus.sh

Dependencies:
gdbus (part of glib2.0, typically pre-installed; e.g., sudo apt install libglib2.0-bin on Debian/Ubuntu).

libnotify-bin for notifications (sudo apt install libnotify-bin).

How it works:
Takes multiple selected files ("$@" from Thunar’s %F).

Validates the Desktop directory and each source file.

Builds arrays of source URIs (file://...) and target URIs with unique filenames (e.g., "file (copy 1).txt").

Calls CopyTo with the (sasasss) signature: working_dir (Desktop), source array, target array, display (:0.0), and startup_id ("").

Logs output to /tmp/dbus-copy.log and sends a summary notification.

Step 2: Add the Script as a Thunar Custom Action
Integrate the script into Thunar’s context menu for a "Copy to Desktop" action.
Open Thunar and go to Edit > Configure custom actions.

Click the + button to add a new action.

Configure the custom action:
Name: "Copy to Desktop"

Description: "Copy selected files to Desktop with auto-renaming"

Command: /home/username/scripts/copy-to-desktop-dbus.sh %F

In Appearance Condition tab:

File pattern: * (applies to all files).

Appears if selection contains: Check "Files" and "Directories".

Save the action.

Reload xfdesktop, run in terminal

xfdesktop -R

or log out and back in.

Usage:
In a Thunar window, select multiple files (e.g., file1.txt, file2.jpg), right-click, and choose "Copy to Desktop". Files are copied as file1.txt, file1 (copy 1).txt, etc., without prompting.

On the Desktop, select multiple files, right-click, and choose "Copy to Desktop" to copy them to the same directory with auto-renaming.

Last edited by Misko_2083 (2025-06-05 23:56:58)


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#7 2025-06-06 03:46:00

JmaCWQ
Member
Registered: 2022-12-06
Posts: 61
LinuxFirefox 128.0

Re: [SOLVED] Copy/Paste on Desktop without asking for Confirmation?

gogogadget wrote:

Hello,

JmaCWQ wrote:

Have a file on the Desktop, right click & copy it, then right click and paste on the Desktop, when the message box comes up asking to rename or replace etc. click Replace.

I have no box, it just copy the file and add (copy 1) to the name.

Hello,
Yes that's how it works on one of my systems, another system the box comes up and it works as expected when I click Replace, and the 3rd which is my main system it won't work and the file/s vanish.

Added later 18 min 06 s:
Very nice Misko_2083, works perfectly.

Thank you  cool

How I wish I was smart enough to do things like that  big_smile

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 617.8 KiB (Peak: 634.65 KiB) ]