MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

Message
Author
madmax25
Posts: 334
Joined: Fri Apr 10, 2020 12:40 pm

MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#1 Post by madmax25 »

On my dual screen system with MX Linux 23.6 xfce installed, because I have a Gaomon graphics tablet (Type: "S620"), I installed the latest driver for Linux using the "GaomonTablet_LinuxDriver_v16.0.0.37.x86_64.deb" from the Gaomon drivers page ( see here ).

Usually, the Gaomon settings window can be started using the starter which is pointing to

Code: Select all

/usr/lib/gaomontablet/gaomontablet.sh
Unfortunately, this settings window is always starting on the left screen, but I want it to start on the right screen because the right one is my primary screen.

What can I do to let the Gaomon setting window start on the right screen, please?
Is there any chance to edit the gaomontablet.sh (or any other file, or perhaps the starter?) in order to let the Gaomon settings window start on the right screen?

My QSI:

Code: Select all

System:
  Kernel: 6.1.0-37-amd64 [6.1.140-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-37-amd64 root=UUID=<filter> ro quiet splash
  Desktop: Xfce v: 4.20.0 tk: Gtk v: 3.24.38 info: xfce4-panel wm: xfwm v: 4.20.0 vt: 7
    dm: LightDM v: 1.32.0 Distro: MX-23.6_x64 Libretto Jan 12  2025 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Desktop Mobo: MSI model: Z170A GAMING M5 (MS-7977) v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: 1.I0 date: 06/26/2018
CPU:
  Info: model: Intel Core i7-6700K bits: 64 type: MT MCP arch: Skylake-S gen: core 6 level: v3
    note: check built: 2015 process: Intel 14nm family: 6 model-id: 0x5E (94) stepping: 3
    microcode: 0xF0
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache: L1: 256 KiB
    desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 800 min/max: 800/4200 scaling: driver: intel_pstate governor: powersave
    cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 bogomips: 63999
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Vulnerable: No microcode
  Type: indirect_target_selection status: Not affected
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed mitigation: IBRS
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: IBRS; IBPB: conditional; STIBP: conditional; RSB filling;
    PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort mitigation: TSX disabled
Graphics:
  Device-1: NVIDIA GM206 [GeForce GTX 960] driver: nvidia v: 535.247.01 non-free: 530.xx+
    status: current (as of 2023-03) arch: Maxwell code: GMxxx process: TSMC 28nm built: 2014-19 pcie:
    gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:1401 class-ID: 0300
  Device-2: Creative Live! Cam Chat HD [VF0700/VF0790] type: USB
    driver: hid-generic,snd-usb-audio,usbhid,uvcvideo bus-ID: 1-4.1:4 chip-ID: 041e:4097
    class-ID: 0300 serial: <filter>
  Device-3: TerraTec GmbH Video Grabber type: USB driver: cx231xx bus-ID: 1-4.2:6
    chip-ID: 0ccd:00a6 class-ID: ef00 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.20.0 driver: X: loaded: nvidia
    gpu: nvidia display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1017x286mm (40.04x11.26")
    s-diag: 1056mm (41.59")
  Monitor-1: DP-0 pos: primary,right res: 1920x1080 hz: 60 dpi: 82 size: 598x336mm (23.54x13.23")
    diag: 686mm (27.01") modes: N/A
  Monitor-2: HDMI-0 pos: left res: 1920x1080 hz: 60 dpi: 93 size: 527x296mm (20.75x11.65")
    diag: 604mm (23.8") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 535.247.01 renderer: NVIDIA GeForce GTX 960/PCIe/SSE2
    direct-render: Yes
Audio:
  Device-1: Intel 100 Series/C230 Series Family HD Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel bus-ID: 1-4.1:4 chip-ID: 041e:4097 bus-ID: 00:1f.3 class-ID: 0300
    chip-ID: 8086:a170 serial: <filter> class-ID: 0403
  Device-2: NVIDIA GM206 High Definition Audio driver: snd_hda_intel v: kernel pcie: gen: 3
    speed: 8 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:0fba class-ID: 0403
  Device-3: Creative Live! Cam Chat HD [VF0700/VF0790] type: USB
    driver: hid-generic,snd-usb-audio,usbhid,uvcvideo
  API: ALSA v: k6.1.0-37-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel 82574L Gigabit Network driver: e1000e v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: d000 bus-ID: 03:00.0 chip-ID: 8086:10d3 class-ID: 0200
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: TP-Link Archer T4U v2 [Realtek RTL8812AU] type: USB driver: rtl8812au bus-ID: 1-4.4:8
    chip-ID: 2357:010d class-ID: 0000 serial: <filter>
  IF: wlan0 state: up mac: <filter>
Bluetooth:
  Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) type: USB driver: btusb v: 0.8
    bus-ID: 1-9:3 chip-ID: 0a12:0001 class-ID: e001
  Report: hciconfig ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 2.1 lmp-v: 4.0
    sub-v: 22bb hci-v: 4.0 rev: 22bb
  Info: acl-mtu: 310:10 sco-mtu: 64:8 link-policy: rswitch hold sniff park
    link-mode: peripheral accept service-classes: rendering, capturing, object transfer, audio,
    telephony
Drives:
  Local Storage: total: 4.09 TiB used: 3 TiB (73.4%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Seagate model: ST4000DM000-1F2168 size: 3.64 TiB
    block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5900 serial: <filter>
    rev: CC54 scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 850 EVO 500GB size: 465.76 GiB
    block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 2B6Q
    scheme: GPT
Partition:
  ID-1: / raw-size: 48.86 GiB size: 47.79 GiB (97.81%) used: 23.03 GiB (48.2%) fs: ext4
    dev: /dev/sdb9 maj-min: 8:25
  ID-2: /boot/efi raw-size: 100 MiB size: 99.2 MiB (99.20%) used: 33.5 MiB (33.8%) fs: vfat
    dev: /dev/sdb2 maj-min: 8:18
  ID-3: /home raw-size: 64.66 GiB size: 63.1 GiB (97.58%) used: 30.93 GiB (49.0%) fs: ext4
    dev: /dev/sdb10 maj-min: 8:26
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 6 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 48.0 C pch: 49.0 C mobo: N/A gpu: nvidia temp: 58 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 21%
Repos:
  Packages: 2718 pm: dpkg pkgs: 2704 libs: 1484 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 14
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
    1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64,arm64] https://brave-browser-apt-release.s3.brave.com/ stable main
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/google-earth-pro.list
    1: deb [arch=amd64] http://dl.google.com/linux/earth/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://ftp.halifax.rwth-aachen.de/mxlinux/packages/mx/repo/ bookworm main non-free
Info:
  Processes: 292 Uptime: 2h 37m wakeups: 1 Memory: 31.3 GiB used: 3.27 GiB (10.4%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI

User avatar
CharlesV
Administrator
Posts: 8051
Joined: Sun Jul 07, 2019 5:11 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#2 Post by CharlesV »

If your still looking for a method to do this, this is what I use to move things to my second screen when started in a script. You might try adding at the bottom of your script the following:

Code: Select all

wmctrl -r :ACTIVE: -e 0,1920,0,-1,-1

You may need to play with the coordinates to the beginning of the second screen (ie the 1920 in that command is assuming that.)

The x is the horizontal ( right ) and y is the vertical ( down )
wmctrl -r :ACTIVE: -e 0,x,y,-1,-1
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
uncle mark
Posts: 868
Joined: Sat Nov 11, 2006 9:42 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#3 Post by uncle mark »

I have no idea if this helps at all (or is even on point), but on my KDE install, I launch the application and then position my mouse on the desired monitor (with focus following mouse set) as the program loads.
Custom build Asus/AMD/nVidia circa 2011 -- MX 19.2 KDE
Acer Aspire 5250 -- MX 21 KDE
Toshiba Satellite C55 -- MX 18.3 Xfce
Assorted Junk -- assorted Linuxes

madmax25
Posts: 334
Joined: Fri Apr 10, 2020 12:40 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#4 Post by madmax25 »

@CharlesV

No, sorry, that didn't work.
It still keeps starting on the left screen, i.e. on the wrong screen.

Maybe I should add the code of the script, to show you what I'm actually talking about.
That script is not my own one, it was added during the installation of the driver.

Here is the script:

Code: Select all

#!/bin/bash
appname=`basename $0 | sed s,\.sh$,,`
dirname=`dirname $0`
tmp="${dirname#?}"
if [ "${dirname%$tmp}" != "/" ]; then
dirname=$PWD/$dirname
fi

echo $dirname

LD_LIBRARY_PATH=$dirname/libs
export LD_LIBRARY_PATH

echo $LD_LIBRARY_PATH

QT_QPA_PLATFORM_PLUGIN_PATH=$dirname/platforms
export QT_QPA_PLATFORM_PLUGIN_PATH
echo $QT_QPA_PLATFORM_PLUGIN_PATH

QML2_IMPORT_PATH=$dirname/qml
export QML2_IMPORT_PATH
echo $QML2_IMPORT_PATH

echo "$@"

echo $dirname/$appname

pidCore=`ps -e|grep huionCore`
if [ -n "$pidCore" ]
then
	echo "gaomonCore is running"
	echo "kill gaomonCore before restart"
	killall huionCore >/dev/null 2>&1
else
	echo "gaomonCore is not running"
fi

# $dirname/huionCore -d &

pidtablet=`ps -e|grep gaomontablet`
if [ -n "$pidtablet" ]
then
	echo "gaomontablet is running"
	echo "kill gaomontablet before restart"
	killall gaomontablet >/dev/null 2>&1
else
	echo "gaomontablet is not running"
fi

sleep 3

$dirname/huionCore -d &
$dirname/$appname "$@" -d

User avatar
CharlesV
Administrator
Posts: 8051
Joined: Sun Jul 07, 2019 5:11 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#5 Post by CharlesV »

Hmm.. that should work ... possibly the command to move it is firing before the window is actually ready...

Try adding to the bottom of the script the following:

Code: Select all

sleep 5
wmctrl -r :ACTIVE: -e 0,1920,0,-1,-1
If that delay is too long you could try shortening it - once its working.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

madmax25
Posts: 334
Joined: Fri Apr 10, 2020 12:40 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#6 Post by madmax25 »

No sorry, the window is still in the same position.

I wonder if the position is set by that sh script anyway or by another file of the driver. Could you perhaps have a look at it, please?

Here it is (see the .deb package)...

I just had a e-mail contact with the Gaomon support, but their reply was.... well, let's call it, "a bit strange". ;-)

They told me, the driver is supporting only CentOS 8 / Ubuntu 20.04 LTS and later.

I think, MX 23.6 is a later version and even based on a later Ubuntu, so the requirement is definitely met, isn't it?

EDIT:
I just have an idea. Could it be a solution if something is added into the starter to get that window on the right screen?

User avatar
CharlesV
Administrator
Posts: 8051
Joined: Sun Jul 07, 2019 5:11 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#7 Post by CharlesV »

Not sure I can get it working without that tablet, but let me get some coffee in me and get Monday into motion and I will give it a try.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
CharlesV
Administrator
Posts: 8051
Joined: Sun Jul 07, 2019 5:11 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#8 Post by CharlesV »

OK, on two machines (one a vm ) and one of my big fast rigs, I did the following and it worked perfectly:
1) at the bottom of the /lib/gaomontablet/gaomontablet.sh I added the following:

Code: Select all


sleep 10
wmctrl -r :ACTIVE: -e 0,1920,0,-1,-1

That worked, but took a while for the move to take place. Then
2) I started decreasing the time on the sleep until I found the right time ( 4 seconds in my case so

Code: Select all

sleep 10
wmctrl -r :ACTIVE: -e 0,1920,0,-1,-1

Now there was a long pause before any gaomon window showed up, and I assume it was because I have no tablet.. but all of this is on an Intel Core i7-14700K with extremely fast nvme's and gobs of ram too.. so your machine could behave FAR differently.

I would suggest starting at something like sleep 10, and if it still doesnt work, then increase that time to 15 and see if it moves then.

If this *still* doesnt work.. then we can try moving to a PID and see if we can a) find the PID for it, and then b) control it by the pid. (I have had less luck at this one, but it is another method.)
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
CharlesV
Administrator
Posts: 8051
Joined: Sun Jul 07, 2019 5:11 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#9 Post by CharlesV »

If you are still having trouble with it.. then here is another method, a little more indepth but does work as well.
(This can be put in a different script, started this up and THEN started gaomontablet for testing too.)

Add this to the bottom of your gaomontablet.sh script right after $dirname/#appname "$@" -d

Code: Select all

# Find window by title match, look every second and dont go past MAX_WAIT time
# Maximum wait time in seconds 
MAX_WAIT=200
#  ( note sleep is .1 seconds so we keep the max_wait time high!
counter=0

echo "Waiting for gaomontablet window to appear..."

while [ $counter -lt $MAX_WAIT ]; do
    # Try to find the window
    zPid=$(pidof gaomontablet)
	if [ -n "$zPid" ]; then
    	   # Get window ID from process ID
    	   zWindowID=$(xdotool search --pid "$zPid" | head -1)
    	   if [ -n "$zWindowID" ]; then
        	wmctrl -i -r "$zWindowID" -e 0,1920,0,-1,-1
                exit 0
    	   fi
	fi    
    
    echo "Window not found, waiting... ($counter/$MAX_WAIT)"
    sleep 0.15
    counter=$((counter + 1))
done

echo "Timeout: gaomontablet window not found after $MAX_WAIT seconds"
exit 1

 
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

madmax25
Posts: 334
Joined: Fri Apr 10, 2020 12:40 pm

Re: MX 23.6 xfce - How to make Gaomon settings window start on right monitor, please?

#10 Post by madmax25 »

No, sorry, it's still not working. Well, sometimes it does, but sometimes it does not. I close it with the context menu of the tray icon, where it says "Exit". but there's still the gaomontablet.sh visible in the task manager.
With your last code added, it sometimes starts in the proper screen, but not always. Sometimes (often), the status tray extension crashes.
So far, it is nothing to rely on, even after trying several values for MAX_WAIT and sleep, sorry.

I remember having the same issue back in MX 19.x, but there, I was able to find a solution in using Compiz, because it has a module inside, where I was able to set the settings window of the Gaomon driver to open at a wanted position on a wanted screen.
But unfortunately, Compiz doesn't seem to be supported properly by MX 23.x, anymore.

EDIT:
Meanwhile, I think, I found a totally different solution.
I just gave up on the Gaomon driver and moved to the OpenTabletDriver.
Probably, it will take me a while to get familiar with it, but actually, it looks quite interesting and it does what it is supposed to, without a misplaced settings window.

But nevertheless, thank you very much for your efforts to help!
Last edited by madmax25 on Mon Aug 18, 2025 8:01 pm, edited 2 times in total.

Post Reply

Return to “Software / Configuration”