[Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

[Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

Well, the question is entirely in the title. I would be happy if I could do that without using Compiz or any other fancy manager of the same kind.

Thank you. :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
twerq
Level 3
Level 3
Posts: 111
Joined: Sun Jul 05, 2020 10:55 am

Re: How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by twerq »

Hi APSchmidt
APSchmidt wrote: Mon Jul 13, 2020 12:26 pm I would be happy if I could do that without using Compiz or any other fancy manager of the same kind
AFAIK thunar itself unable to set position for its window.
You may control applications gui with wmctrl
Also there are xdotool, which some folks prefer more.

Or consider switch to nemo. Then you'll be able to position window by executing nemo --geometry ...

Whatever option you choose, add it to ~/.local/share/applications/Thunar.desktop
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

twerq wrote: Mon Jul 13, 2020 1:34 pmAFAIK thunar itself unable to set position for its window.
You may control applications gui with wmctrl
Also there are xdotool, which some folks prefer more. Or consider switch to nemo. Then you'll be able to position window by executing nemo --geometry ... Whatever option you choose, add it to ~/.local/share/applications/Thunar.desktop
Thank you for your answer. :)

Isn't there a file manager for Xfce that just remembers its last position and automatically starts at that position when started?
twerq
Level 3
Level 3
Posts: 111
Joined: Sun Jul 05, 2020 10:55 am

Re: How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by twerq »

twerq wrote: Mon Jul 13, 2020 1:34 pm Isn't there a file manager for Xfce that just remembers its last position
Session Manager able to remember gui last position. Check Xfce4-session if it suits you. This is default session manager for Xfce.
dm999

Re: How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by dm999 »

I'm not aware of a way to select an exact screen position but this method always opens Thunar in the centre of the screen -

Settings Manager > Window Manager Tweaks > Placement > move the slider to Large
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

twerq wrote: Tue Jul 14, 2020 5:30 amSession Manager able to remember gui last position. Check Xfce4-session if it suits you. This is default session manager for Xfce.
I'm already using it. I remember trying it in Tricia but it never started Thunar where the windows were, even after saving the current session.

I just tried it again and it works!!! Thank you for nudging me into trying it again. :D
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

dm999 wrote: Tue Jul 14, 2020 5:48 am I'm not aware of a way to select an exact screen position but this method always opens Thunar in the centre of the screen - Settings Manager > Window Manager Tweaks > Placement > move the slider to Large
Thanks for your suggestion. I use it already so that Firefox and Thunderbird (and many others) start centred on screen. :)
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

APSchmidt wrote: Tue Jul 14, 2020 6:06 am
twerq wrote: Tue Jul 14, 2020 5:30 amSession Manager able to remember gui last position. Check Xfce4-session if it suits you. This is default session manager for Xfce.
I'm already using it. I remember trying it in Tricia but it never started Thunar where the windows were, even after saving the current session. I just tried it again and it works!!! Thank you for nudging me into trying it again. :D
So, I was using this and it worked well, until something happened that made me reconsider: viewtopic.php?f=57&t=325389

I'm back to not saving the current session and starting Thunar on login. That would be great if I could use a script setting the start position of each Thunar window though.
twerq
Level 3
Level 3
Posts: 111
Joined: Sun Jul 05, 2020 10:55 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by twerq »

APSchmidt wrote: Mon Jul 20, 2020 7:16 am That would be great if I could use a script setting the start position of each Thunar window though.
You should check viewtopic.php?p=1846201#p1846201. Get familiar with one of suggested options. Then just arrange your solution as script and add it to "Startup Applications" list.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

twerq wrote: Mon Jul 20, 2020 11:04 amYou should check viewtopic.php?p=1846201#p1846201. Get familiar with one of suggested options. Then just arrange your solution as script and add it to "Startup Applications" list.
I'm unable to do that. :)

Edit: I would have tried Devilspie but it's broken: https://www.mail-archive.com/ubuntu-bug ... 04443.html
twerq
Level 3
Level 3
Posts: 111
Joined: Sun Jul 05, 2020 10:55 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by twerq »

APSchmidt wrote: Tue Jul 21, 2020 3:27 am I'm unable to do that. :)
Ok. Here is the example of how one can manipulate the application window.
I will try to help if some of the futher steps are not clear for you.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

twerq wrote: Tue Jul 21, 2020 5:59 amOk. Here is the example of how one can manipulate the application window.
I will try to help if some of the futher steps are not clear for you.
Thank you! :)

I can use the following commands after booting but I have no idea how to make them into a script, especially since Devilspie doesn't work. Basically, I need to store the windows IDs into variables and use these variables in the second command. It's very basic scripting but how do I do that?

Code: Select all

xdotool search --name "anne - gestionnaire de fichiers"
xdotool windowmove windowID 5 5 && xdotool windowmove windowID 5 5
twerq
Level 3
Level 3
Posts: 111
Joined: Sun Jul 05, 2020 10:55 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by twerq »

You almost have got solution. Great!
APSchmidt wrote: Wed Jul 22, 2020 2:43 am Basically, I need to store the windows IDs into variables and use these variables in the second command
Fortunately xdotool can chain its actions. And

Code: Select all

xdotool search --name "anne - gestionnaire de fichiers" windowmove 5 5 windowsize 5 5
will get windowID with name you set, then move it to x=5, y=5 and resize to 5x5. In one xdotool call!

Just check if it work for you as expected. Then modify xfce startup applications.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

twerq wrote: Wed Jul 22, 2020 11:10 amFortunately xdotool can chain its actions. And

Code: Select all

xdotool search --name "anne - gestionnaire de fichiers" windowmove 5 5 windowsize 5 5
will get windowID with name you set, then move it to x=5, y=5 and resize to 5x5. In one xdotool call!

Just check if it work for you as expected. Then modify xfce startup applications.
The command works, thanks! I added it in Session and Startup; I'll see if it works next time I reboot.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

APSchmidt wrote: Thu Jul 23, 2020 3:54 am I'll see if it works next time I reboot.
It doesn't work. I suspected so, I think the command fires before Thunar has opened a window on the desktop. I've modified the command into:

Code: Select all

sh -c  "sleep 5; xdotool search --name 'anne - gestionnaire de fichiers' windowmove 5 5 windowsize 620 310"
in the start launcher; I'll see tomorrow if it works or not. :)
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

APSchmidt wrote: Fri Jul 24, 2020 3:43 amIt doesn't work. I suspected so, I think the command fires before Thunar has opened a window on the desktop. I've modified the command into:

Code: Select all

sh -c  "sleep 5; xdotool search --name 'anne - gestionnaire de fichiers' windowmove 5 5 windowsize 620 310"
in the start launcher; I'll see tomorrow if it works or not. :)
I was right and now it works! For the other windows I could open, I use a launcher that contains the same command without the "sleep 5" part. :)
twerq
Level 3
Level 3
Posts: 111
Joined: Sun Jul 05, 2020 10:55 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by twerq »

Great! You acted proactively and now your system is a little more convenient.
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

twerq wrote: Sat Jul 25, 2020 3:49 am Great! You acted proactively and now your system is a little more convenient.
Indeed it is. I can move to something else now. Thanks to you for your help anyway! :)
twerq
Level 3
Level 3
Posts: 111
Joined: Sun Jul 05, 2020 10:55 am

Re: [Solved] How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by twerq »

APSchmidt wrote: Sat Jul 25, 2020 4:08 am Thanks to you for your help anyway!
:)
User avatar
APSchmidt
Level 3
Level 3
Posts: 129
Joined: Mon Jul 13, 2020 5:25 am

Re: How do I make so that Thunar always starts at fixed coordinates on the desktop?

Post by APSchmidt »

twerq wrote: Mon Jul 13, 2020 1:34 pm Whatever option you choose, add it to ~/.local/share/applications/Thunar.desktop
There is no Thunar.desktop at that place. :)

I'm back to this because I got another answer about that in another thread I started. There was an easier way, easier than the one I've been using so far:

1) create a script containing:

Code: Select all

#!/bin/bash
thunar &&
sh -c  "xdotool search --name 'username - gestionnaire de fichiers' windowmove 5 5 windowsize 640 360"
and change its permissions if needed.

2) then change the default command for Thunar in the applications list (thunar %F) by the full path to the script In my case:

Code: Select all

/home/username/.local/bin/thunar-home-positionneur
Now, each time I launch Thunar it's positioned in the left corner of the screen at x = 5 and y = 5 and it's redimentioned if needed. :)
Locked

Return to “Xfce”