You are not logged in.
Pages: 1
Is there a way to make Thunar runs always on the center of screen?
Last edited by s3idani (2023-04-18 23:19:03)
Offline
You can easily set all windows to open center screen via Settings Manager > Window Manager Tweaks > Placement. However, assuming that you are looking to just center thunar, there is not built-in way to do this as smart placement puts the thunar window in an empty space on the screen if center placement is not selected.
It might be possible using a tool like xdotool or devilspie. But it depends on how you start thunar.
For example, if starting from the command line, you could:
thunar && xdotool getactivewindow windowmove 480 280...adjust 480 and 280 to be the top-left x,y coordinates of the window as it centers on your screen.
If starting from the thunar menu item, you would need to change the Exec= line in the thunar.desktop file to something like:
Exec=sh -c "thunar %U && xdotool getactivewindow windowmove 480 280"If starting via Ctrl+N from an existing window, its not possible using xdotool.
devilspie works a little differently in that it looks for windows as they load by, for example, class name, and applies rules to the window, including centering it. This would handle all the different instances noted above with one solution and no need to change .desktop files.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Thank you for replying. I'll take a look at devilspie and give a feedback.
Offline
The easiest way is to go to window manager improvement > position and set it to large, this way you will disable smart window placement.
Arch Linux Xfce - 64Bit Linux User #621110 GitHub
Offline


If starting from the thunar menu item, you would need to change the Exec= line in the thunar.desktop file to something like:
Exec=sh -c "thunar %U && xdotool getactivewindow windowmove 480 280"
OMG! Sorry for the necro but I'm on desktop with dual monitors and have just been putting up with Thunar windows opening on the wrong monitor ever since I installed this distro.
This solution ALMOST works for me when launching from terminal:
thunar && xdotool getactivewindow windowmove 480 280But it seems that 'getactivewindow' detects the TERMINAL window as the active one (the one I'm using to execute the command) and so the Thunar window still opens on the wrong monitor.
I typically use "Super+e" command to open a new Thunar window and after altering the .desktop file the window still opens on the second monitor. I'm thinking it's a focus issue so I unchecked the "Automatically give new windows focus" box but still no change. Any other focus settings I'm forgetting?
Linux Mint 22.1 XFCE 4.18
Offline


This solution ALMOST works for me when launching from terminal:
thunar && xdotool getactivewindow windowmove 480 280But it seems that 'getactivewindow' detects the TERMINAL window as the active one (the one I'm using to execute the command) and so the Thunar window still opens on the wrong monitor.
If you are running on a slower computer, you may need to grant some time for the computer to open the application. You can consider adding a short sleep command to the command to allow the window to open:
thunar & sleep 1.0 && xdotool getactivewindow windowmove 480 280Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


If you are running on a slower computer, you may need to grant some time for the computer to open the application. You can consider adding a short sleep command to the command to allow the window to open:
thunar & sleep 1.0 && xdotool getactivewindow windowmove 480 280
CPU is a 5800X3D and GPU is a 6750XT
With that command, the same thing happens but it gives this result:
$ thunar & sleep 1.0 && xdotool getactivewindow windowmove 480 280
[1] 3218887
[1]+ Done thunarI'm guessing the number is a PID?
Linux Mint 22.1 XFCE 4.18
Offline


Yeah, thats just the shell spitting out the PID when you send an app to the background.
What if you set the sleep time to 2.0? Does the thunar window move then?
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


OMG! Sorry for the necro but I'm on desktop with dual monitors and have just been putting up with Thunar windows opening on the wrong monitor ever since I installed this distro.
I had this issue a while back.
As I recall, I used the Settings -> Display to set/reset the primary monitor and fixed the problem.
Offline


As I recall, I used the Settings -> Display to set/reset the primary monitor and fixed the problem.
Wow! So I checked in Display and monitor 1 was already set as Primary Display. Just for fun, I turned off the toggle then turned it back on and hit Apply.
Now it works with sleep value 1.0 or even 0.5. Thanks!
Although wtf? How is my CPU of 5800X3D and a 6750XT GPU in my newly built PC "slow"??? The more I learn about XFCE and Linux the less I understand lol
Added later 01 min 32 s:
Yeah, thats just the shell spitting out the PID when you send an app to the background.
What if you set the sleep time to 2.0? Does the thunar window move then?
I had Primary Display toggle on correctly, but I turned it off and back on again and then hit Apply and now it works. It also works with sleep value of 0.5. I still don't get why my computer is running Mint XFCE slowly with my current hardware? I thought XFCE was lightweight? Still doesn't work with the .desktop file though so I can't bind it to a hotkey.
Last edited by dbaser (2025-12-21 00:29:30)
Linux Mint 22.1 XFCE 4.18
Offline


I had Primary Display toggle on correctly, but I turned it off and back on again and then hit Apply and now it works. It also works with sleep value of 0.5. I still don't get why my computer is running Mint XFCE slowly with my current hardware? I thought XFCE was lightweight? Still doesn't work with the .desktop file though so I can't bind it to a hotkey.
Is the thunar daemon process running?
Try removing the sleep command now - perhaps its not needed.
thunar & xdotool getactivewindow windowmove 480 280What might be happening is that the second command (xdotool) is executing before the thunar window is mapped. Adding a small sleep amount just delays the second command briefly from running giving the thunar window time to map itself.
Last edited by ToZ (2025-12-21 00:33:54)
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Pages: 1
[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 590.09 KiB (Peak: 607.51 KiB) ]