--- /dev/null
+#!/usr/bin/env bash
+set -euo pipefail
+
+if [ "$#" -eq 0 ]; then
+ kdialog --error "No files or folders were selected."
+ exit 1
+fi
+
+stamp="$(date +%F-%H%M%S)"
+logdir="$HOME/.local/state/clamav-kde"
+logfile="$logdir/daemon-$stamp.log"
+mkdir -p "$logdir"
+
+if ! rc-service clamd status; then
+ kdialog --error "[email protected] is not running. Start the daemon first."
+ exit 1
+fi
+
+notify-send "ClamAV" "Daemon scan started"
+
+infected=0
+errors=0
+for target in "$@"; do
+ if clamdscan --fdpass --log="$logfile" -- "$target"; then
+ :
+ else
+ rc=$?
+ if [ "$rc" -eq 1 ]; then
+ infected=1
+ else
+ errors=1
+ fi
+ fi
+done
+
+if [ "$infected" -eq 1 ]; then
+ notify-send "ClamAV" "Daemon scan found infected files"
+ kdialog --title "ClamAV Daemon Scan" --textbox "$logfile" 900 600
+elif [ "$errors" -eq 1 ]; then
+ notify-send "ClamAV" "Daemon scan finished with errors"
+ kdialog --title "ClamAV Daemon Scan" --textbox "$logfile" 900 600
+else
+ notify-send "ClamAV" "Daemon scan finished clean"
+ kdialog --title "ClamAV Daemon Scan" --textbox "$logfile" 900 600
+fi
+EOF
+
--- /dev/null
+[Desktop Entry]
+Name=ClamAV
+Type=Service
+MimeType=inode/directory;application/octet-stream;
+MimeType=inode/directory;
+Actions=clamav
+# X-KDE-Submenu=ClamAV
+
+[Desktop Action clamav]
+Name=Scan With ClamAV (Daemon)
+Name=Mit ClamAV scannen (Daemon)
+Icon=security-medium
+Exec=~/.local/bin/clamav-scan-with-dolphin %F
+