Bug 476618

Summary: kde connect is not reconnecting, manual intervention is necessary to do so
Product: [Applications] kdeconnect Reporter: Michael <michael.hmich>
Component: commonAssignee: Albert Vaca Cintora <albertvaka>
Status: REPORTED ---    
Severity: normal CC: andrew.g.r.holmes, kde-bugs
Priority: NOR    
Version First Reported In: 23.08.2   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Michael 2023-11-06 10:24:47 UTC
kde connect works fine when it is connected
in my case it is physical connected on usb with an android phone

after a cable disconnect kde connect does not reconnect automatically, it is necessary to select the phone in kde konnect settings and hit the refresh button, or the cmd "/usr/bin/kdeconnect-cli --refresh"  also works

I tried to do it with udev, but for any reason it doesn't work

kdeconnect.rule
ACTION=="change", SUBSYSTEM=="net", NAME=="enx*" RUN+="/usr/bin/su - hm -c '/usr/sbin/kdeconnect.sh &'"

kdeconnect.sh
#!/bin/sh
/bin/sleep 5
/usr/bin/kdeconnect-cli --refresh 
/usr/bin/echo konnect.ok > /home/hm/kdekonnect.ok 

the rule is hit and the script marked to run

sudo udevadm test --action="change" /devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3:1.0/net/enx9e6d28ec460b
......
ID_NET_DRIVER=rndis_host
ID_NET_LINK_FILE=/usr/lib/systemd/network/73-usb-net-by-mac.link
ID_NET_NAME=enx9e6d28ec460b
CURRENT_TAGS=:systemd:
SYSTEMD_ALIAS=/sys/subsystem/net/devices/enx9e6d28ec460b
USEC_INITIALIZED=1701029341
run: '/usr/bin/su - hm -c '/usr/sbin/kdeconnect.sh &''
Unload module index
Unloaded link configuration context.

but is not being executed
it is the same result on Neon, LinuxMint and Arch
it doesn't matter if I have "su - hm" or "su hm"

has somebody any solution or help ?
thanks