hiddify / hiddify-app

Multi-platform auto-proxy client, supporting Sing-box, X-ray, TUIC, Hysteria, Reality, Trojan, SSH etc. It’s an open-source, secure and ad-free.
https://hiddify.com
Other
17.47k stars 1.58k forks source link

Multiple instances on Linux #976

Open papampi opened 5 months ago

papampi commented 5 months ago

What Happened?

When you click (x) on hiddify dashboard it will be minimize to tray, if anyone dont notice its already running and instead of clicking tray icon then show dashboard click hiddify icon again it will start a new instance instead of bringing up the dashboard. As many times anyone click app icon and click close it will start new instances.

Tried many ways to bring it up from dashboard with xdotool , wmctrl, dbus, ... with no luck. So for now until hopefully it get fixed I wrote a small script to check if its running, close and start new instance and edited hiddify.desktop file. If anyone has the same issue follow this:

hiddify_start.sh:

#!/bin/bash
if pgrep -x "hiddify" > /dev/null ; then
    pkill -x "hiddify"
    sleep 1
    hiddify %U
else
    hiddify %U
fi

chmod a+x hiddify_start.sh Edit /usr/share/applications/hiddify.desktop Change: Exec=hiddify %U with Exec=/path_to_above_script/hiddify_start.sh

Minimal Reproducible Example (MRE)

Click hiddify icon to start hiddify Click close (x) Click hiddify icon again

Expected Behavior

Bring up the running hiddify from tray

Version

1.4

Platform/OS

Linux

Additional Context

https://github.com/hiddify/hiddify-next/assets/1108483/70b03bc3-e000-4014-a1f3-b8b1ad418dc9

Love-in-idleness commented 2 months ago

This issue is still present in 2.0.5

papampi commented 2 months ago

They added a "Hide/Exit" option in later versions, and it wont cause multiple instances anymore if its hidden. But when click the icon from applications menu it opens the same but shows disconnected while its connected. Icon also shows blue while it should be green.

Screenshot from 2024-08-28 12-54-06

After bring up from application menu instead of clicking icon from taskbar (Shows Disconnected but its connected). If click connect, it will disconnect and connect again.

Screenshot from 2024-08-28 12-54-23

titancomputer commented 2 months ago

try v2.3.1 and check if problem has been solved or not

papampi commented 2 months ago

try v2.3.1 and check if problem has been solved or not

Not completely fixed on 2.3.1 either, If it's hidden and click app menu (not app indicator) it opens and shows not connected while its already connected.