Toggle monitors when connected

Forum / NoMachine for Linux / Toggle monitors when connected

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #48230
    dante
    Participant

    Hi, I have NoMachine on a Linux workstation, which has a monitor and a HDMI dongle connected. I would like a way to turn off the monitor and toggle to the dongle when a NoMachine session is active, then toggle back to the monitor when disconnected.

    I know there is a blank remote display feature, but i would like to actually switch to the dongle as my remote client uses a resolution not supported by the monitor. Currently my method involves switching to the dongle in display settings (and disabling the monitor) and having to switch back before I log out. If this is not a feature already implemented, was thinking of writing a script that would automate this, maybe using xrandr. but I’m a bit inexperienced and not sure how to listen for an active session. Any pointers or existing solutions would be appreciated.

    #48254
    Britgirl
    Keymaster

    You can try with “custom scripts”, they’re also supported in the free version. Take a look at the following article:

    Server Automation Interface: some examples to use custom scripts triggered on server/node events
    https://kb.nomachine.com/AR02L00787

    and any of the guides of the Enterprise products. Here’s the link to the Enterprise Desktop guide (like the free version but with more features) https://kb.nomachine.com/DT10R00171#11.3.

    You could use, for example, UserScriptAfterSessionStart (in node.cfg) executed as user, not as user nx. Prepare your script and run it at disconnection to restore the previous monitor configuration.

    #
    # Specify absolute path of the custom script to be executed after the
    # session start-up. The script can accept session ID, username, node
    # host and node port as its input.
    #
    #UserScriptAfterSessionStart “”

    or

    #
    # Specify absolute path of the custom script to be executed after
    # the session is disconnected. The script can accept session ID, user-
    # name, node host and node port as its input.
    #
    #UserScriptAfterSessionDisconnect “”

Viewing 2 posts - 1 through 2 (of 2 total)

This topic was marked as solved, you can't post.