Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start xfce-session in background and connect to VNC Viewer #118

Open
W5ALC opened this issue Jan 16, 2023 · 1 comment
Open

Start xfce-session in background and connect to VNC Viewer #118

W5ALC opened this issue Jan 16, 2023 · 1 comment

Comments

@W5ALC
Copy link

W5ALC commented Jan 16, 2023

I've been trying so get xfce-session to start in the background as in my vnc startup script xfce-session & but when I run this command the script just seems to close and I can't connect to the saved desktop.

I've tried many different iterations like
startxfce4 &
dbus-launch --exit-with-session startxfce4 &
dbus-launch --exit-with-session xfce4-session &

It runs just fine when i remove the &.

And it always seems to just exit the termux session and not allow login through:
the VNC Viewer app.
the VNC VIewer widget
termux-url-opener vnc://ip:port
or
am start -a android.os.BinderProxy@4de5627 -d content://data.AddressBook/entries/866832c4-1935-499f-8166-80d3195c773c -n com.realvnc.viewer.android/.app.DesktopActivity --user 0 &> /dev/null
# this is the am equivalent to clicking my desktop VNC Viewer widget.

All i'm trying to accomplish is running my desktop script and have the saved desktop load instead of the, admittedly ridiculous, 1 extra click.

Here is my desktop script which is located in ~/.shortcuts and executed with termux:widget.
/data/data/com.termux/files/home/.shortcuts/desktop
#!/data/data/com.termux/files/usr/bin/bash
vncserver -kill :1
vncserver :1
export DISPLAY=":1"
#am start -a android.os.BinderProxy@4de5627 -d content://data.AddressBook/entries/866832c4-1935-499f-8166-80d3195c773c -n com.realvnc.viewer.android/.app.DesktopActivity --user 0 &> /dev/null
#am start vnc://127.0.0.1:5901
dbus-launch --exit-with-session startxfce4 &
#sleep 10
#dbus-launch am start -a android.os.BinderProxy@4de5627 -d content://data.AddressBook/entries/866832c4-1935-499f-8166-80d3195c773c -n com.realvnc.viewer.android/.app.DesktopActivity --user 0 &> /dev/null
#am start -a android.os.BinderProxy@4de5627 -d content://data.AddressBook/entries/866832c4-1935-499f-8166-80d3195c773c -n com.realvnc.viewer.android/.app.DesktopActivity

Note : the commented lines are different things i've tried

I can gather any other information needed to help solve this odd problem. It shouldn't behave this way, right?

logcat -d # this is everything from when the Termux widget script runs until it quits.

01-15 23:53:21.273 10668 10668 D Termux:TermuxService: onStartCommand 01-15 23:53:21.276 10668 10668 D Termux:TermuxService: ACTION_SERVICE_EXECUTE intent received
01-15 23:53:21.276 10668 10668 D Termux:TermuxService: Executing foreground "(1007) Execution Intent Command" TermuxSession command
01-15 23:53:21.276 10668 10668 D Termux:TermuxService: Creating "(1007) Execution Intent Command" TermuxSession
01-15 23:53:21.276 10668 10668 V Termux:TermuxService: (1007) Execution Intent Command: 01-15 23:53:21.276 10668 10668 V Termux:TermuxService: Current State: Pre-Execution 01-15 23:53:21.276 10668 10668 V Termux:TermuxService: Executable: /data/data/com.termux/files/home/.shortcuts/desktop
01-15 23:53:21.276 10668 10668 V Termux:TermuxService: Arguments: - 01-15 23:53:21.276 10668 10668 V Termux:TermuxService: Working Directory: null 01-15 23:53:21.276 10668 10668 V Termux:TermuxService: inBackground: false 01-15 23:53:21.276 10668 10668 V Termux:TermuxService: isFailsafe: false 01-15 23:53:21.276 10668 10668 V Termux:TermuxService: isPluginExecutionCommand: true 01-15 23:53:21.276 10668 10668 V Termux:TermuxService: Result Pending: false 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: (1007) Execution Intent Command: 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: Current State: Executing 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: Executable: /data/data/com.termux/files/usr/bin/sh
01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: Arguments: 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: Arg 1: `sh` 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: Arg 2: `/data/data/com.termux/files/home/.shortcuts/desktop` 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: Working Directory: /data/data/com.termux/files/home
01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: inBackground: false 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: isFailsafe: false 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: isPluginExecutionCommand: true 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: Result Pending: false 01-15 23:53:21.280 10668 10668 D Termux:TermuxSession: Running "(1007) Execution Intent Command" TermuxSession
01-15 23:53:21.284 10668 10668 D Termux:TermuxService: Processing sessionAction "0" for session "desktop"
01-15 23:53:21.304 10668 10668 D Termux:PermissionUtils: com.termux already has Display over other apps (SYSTEM_ALERT_WINDOW) permission
01-15 23:53:21.321 10668 10757 D OpenGLRenderer: setSurface called with nullptr 01-15 23:53:21.321 10668 10668 I ViewRootImpl@10edc58[SettingsActivity]: dispatchDetachedFromWindow
01-15 23:53:21.325 10668 10668 D InputTransport: Input channel destroyed: 'bcb3cad', fd=126 01-15 23:53:21.325 10668 10668 I ViewRootImpl@599b144[TermuxActivity]: stopped(false) old=true 01-15 23:53:21.325 10668 10668 D Termux:TermuxActivity: onStart 01-15 23:53:21.340 10668 10668 I ViewRootImpl@599b144[TermuxActivity]: stopped(false) old=false 01-15 23:53:21.340 10668 10668 V Termux:TermuxActivity: onResume 01-15 23:53:21.343 10668 10668 I DecorView: notifyKeepScreenOnChanged: keepScreenOn=false 01-15 23:53:21.344 10668 10668 I DecorView: notifyKeepScreenOnChanged: keepScreenOn=false 01-15 23:53:21.344 10668 10668 V Termux:TermuxTerminalViewClient: Requesting TerminalView focus and showing soft keyboard
01-15 23:53:21.344 10668 10668 V Termux:TerminalView: Setting cursor blinker rate to 0 01-15 23:53:21.344 10668 10668 V Termux:TerminalView: Cursor blinker disabled 01-15 23:53:21.344 10668 10668 I DecorView: notifyKeepScreenOnChanged: keepScreenOn=false 01-15 23:53:21.344 10668 10668 I ViewRootImpl@599b144[TermuxActivity]: handleAppVisibility mAppVisible=false visible=true
01-15 23:53:21.345 10668 10757 D OpenGLRenderer: setSurface called with nullptr 01-15 23:53:21.362 10668 10668 I ViewRootImpl@599b144[TermuxActivity]: Relayout returned: old=(0,0,2190,1080) new=(0,0,2190,1080) req=(2190,1080)0 dur=16 res=0x7 s={true 489204699536} ch=true fn=-1 01-15 23:53:21.363 10668 10757 D OpenGLRenderer: eglCreateWindowSurface 01-15 23:53:21.369 10668 10668 I ViewRootImpl@599b144[TermuxActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11387 android.view.ViewRootImpl.performTraversals:4185 android.view.ViewRootImpl.doTraversal:2911 01-15 23:53:21.374 10668 10757 I BufferQueueProducer: ViewRootImpl@599b144[TermuxActivity]#52(BLAST Consumer)52 queueBuffer: queued for the first time. 01-15 23:53:21.375 10668 10668 I ViewRootImpl@599b144[TermuxActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$addFrameCompleteCallbackIfNeeded$3$ViewRootImpl:4987 android.view.ViewRootImpl$$ExternalSyntheticLambda16.run:6 android.os.Handler.handleCallback:938
01-15 23:53:21.375 10668 10668 I ViewRootImpl@599b144[TermuxActivity]: [DP] rdf() 01-15 23:53:21.375 10668 10668 D ViewRootImpl@599b144[TermuxActivity]: reportDrawFinished (fn: -1)
01-15 23:53:21.375 10668 10668 V ViewRootImpl@599b144[TermuxActivity]: updateAppliedLetterboxDirection, direction=2, Caller=android.view.ViewRootImpl.handleDispatchLetterboxDirectionChanged:12740 01-15 23:53:21.378 10668 10668 I AssistStructure: Flattened final assist data: 3444 bytes, containing 1 windows, 27 views
01-15 23:53:21.399 10668 10668 I ViewRootImpl@599b144[TermuxActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
01-15 23:53:21.400 10668 10668 D InputMethodManager: startInputInner - Id : 0 01-15 23:53:21.400 10668 10668 I InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
01-15 23:53:21.644 10668 10668 I IMM_LC : showSoftInput(View,I) 01-15 23:53:21.645 10668 10668 I IMM_LC : ssi() - flag : 0 view : com.termux reason = SHOW_SOFT_INPUT
01-15 23:53:21.645 10668 10668 I IMM_LC : ssi() view is not EditText 01-15 23:53:24.601 10668 10668 D Termux:TermuxSession: The "(1007) Execution Intent Command" TermuxSession exited normally
01-15 23:53:24.601 10668 10668 D Termux:TermuxSession: Processing "(1007) Execution Intent Command" TermuxSession result
01-15 23:53:24.601 10668 10668 V Termux:TermuxService: The onTermuxSessionExited() callback called for "(1007) Execution Intent Command" TermuxSession command
01-15 23:53:24.602 10668 10668 D Termux:TermuxService: (1007) Execution Intent Command: 01-15 23:53:24.602 10668 10668 D Termux:TermuxService: Previous State: Executing 01-15 23:53:24.602 10668 10668 D Termux:TermuxService: Current State: Executed 01-15 23:53:24.602 10668 10668 D Termux:TermuxService: 01-15 23:53:24.602 10668 10668 D Termux:TermuxService: Exit Code: 0 01-15 23:53:24.602 10668 10668 D Termux:TermuxService: 01-15 23:53:24.610 10668 10668 V Toast : show: caller = com.termux.app.TermuxActivity.showToast:580
01-15 23:53:24.610 10668 10668 V Toast : show: focusDisplayId = 0, isFocusInDesktop = false mCustomDisplayId=-1 isDexDualMode=false
01-15 23:53:24.610 10668 10668 V Toast : show: isActivityContext = true 01-15 23:53:24.621 10668 10668 V ToastPresenter: Text: \1] in android.widget.ToastPresenter@2b65dc6
01-15 23:53:24.630 10668 10668 I ViewRootImpl@55c7187[Toast]: setView = android.widget.LinearLayout@3aa9052 TM=true
01-15 23:53:24.651 10668 10668 I ViewRootImpl@55c7187[Toast]: Relayout returned: old=(144,72,2280,1080) new=(1080,0,1253,119) req=(173,119)0 dur=10 res=0x7 s={true 489204725696} ch=true fn=-1 01-15 23:53:24.652 10668 10757 D OpenGLRenderer: eglCreateWindowSurface 01-15 23:53:24.652 10668 10668 I ViewRootImpl@55c7187[Toast]: [DP] dp(1) 0 android.view.ViewRootImpl.reportNextDraw:11387 android.view.ViewRootImpl.performTraversals:4185 android.view.ViewRootImpl.doTraversal:2911 01-15 23:53:24.654 10668 10757 I BufferQueueProducer: ViewRootImpl@55c7187[Toast]#53(BLAST Consumer)53 queueBuffer: queued for the first time.
01-15 23:53:24.655 10668 10668 I ViewRootImpl@55c7187[Toast]: [DP] pdf(0) 0 android.view.ViewRootImpl.lambda$addFrameCompleteCallbackIfNeeded$3$ViewRootImpl:4987 android.view.ViewRootImpl$$ExternalSyntheticLambda16.run:6 android.os.Handler.handleCallback:938 01-15 23:53:24.655 10668 10668 I ViewRootImpl@55c7187[Toast]: [DP] rdf() 01-15 23:53:24.655 10668 10668 D ViewRootImpl@55c7187[Toast]: reportDrawFinished (fn: -1) 01-15 23:53:25.031 17479 17479 I dbus-daemon: [session uid=10292 pid=17477] Activating service name='org.xfce.Xfconf' requested by ':1.0' (uid=10292 pid=17472 comm="xfce4-session" label="u:r:untrusted_app_27:s0:c36,c257,c512,c768") 01-15 23:53:25.072 17479 17479 I dbus-daemon: [session uid=10292 pid=17477] Successfully activated service 'org.xfce.Xfconf'
01-15 23:53:25.379 17479 17479 I dbus-daemon: [session uid=10292 pid=17477] Activating service name='org.gtk.vfs.Daemon' requested by ':1.3' (uid=10292 pid=17501 comm="xfwm4" label="u:r:untrusted_app_27:s0:c36,c257,c512,c768") 01-15 23:53:25.429 17479 17479 I dbus-daemon: [session uid=10292 pid=17477] Successfully activated service 'org.gtk.vfs.Daemon'
01-15 23:53:26.622 10668 10757 D OpenGLRenderer: setSurface called with nullptr 01-15 23:53:26.622 10668 10757 D OpenGLRenderer: setSurface() destroyed EGLSurface 01-15 23:53:26.623 10668 10757 D OpenGLRenderer: destroyEglSurface

@W5ALC
Copy link
Author

W5ALC commented Jan 16, 2023

This is the output when the script is ran without &:

Killing Xvnc process ID 5371

New 'localhost:1 ()' desktop is localhost:1

Starting applications specified in /data/data/com.termux/files/home/.vnc/xstartup
Log file is /data/data/com.termux/files/home/.vnc/localhost:1.log

(xfwm4:6788): xfwm4-WARNING **: 01:01:31.139: Unsupported GL renderer (llvmpipe (LLVM 15.0.6, 128 bits)).

** (xfdesktop:6819): WARNING **: 01:01:33.475: Failed to get system bus: Could not connect: No such file or directory
libclock-Message: 01:01:34.084: could not get proxy for org.freedesktop.login1

(xfce4-panel:6807): libclock-WARNING **: 01:01:34.085: could not instantiate a sleep monitor

(xfce4-session:6758): xfce4-session-WARNING **: 01:01:37.620: failed to run script: Failed to execute child process “/usr/bin/pm-is-supported” (No such file or directory)

(xfce4-session:6758): xfce4-session-WARNING **: 01:01:37.646: failed to run script: Failed to execute child process “/usr/bin/pm-is-supported” (No such file or directory)

(xfce4-session:6758): xfce4-session-WARNING **: 01:01:37.656: failed to run script: Failed to execute child process “/usr/bin/pm-is-supported” (No such file or directory)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant