F5F Stay Refreshed Software Operating Systems Automatically adjust the Nemo folder to fill the screen by snapping to a corner.

Automatically adjust the Nemo folder to fill the screen by snapping to a corner.

Automatically adjust the Nemo folder to fill the screen by snapping to a corner.

S
sirbreno
Member
191
11-15-2023, 11:48 PM
#1
LM 20.1 Cinnamon 4.8.6 I've configured three folders to launch sequentially with the default file manager. The Movies folder should snap to the upper left, Games Shortcuts to the upper right, and GoPro to the bottom right. After reviewing xdotool instructions, I'm still having trouble getting it to function properly. I suspect the issue might be due to changes made by the Mint team—since they removed the desktop state persistence a few years ago for stability reasons. Right now, each time a folder auto-launches, I need to press keys manually to position them correctly. Please help me fix this.
S
sirbreno
11-15-2023, 11:48 PM #1

LM 20.1 Cinnamon 4.8.6 I've configured three folders to launch sequentially with the default file manager. The Movies folder should snap to the upper left, Games Shortcuts to the upper right, and GoPro to the bottom right. After reviewing xdotool instructions, I'm still having trouble getting it to function properly. I suspect the issue might be due to changes made by the Mint team—since they removed the desktop state persistence a few years ago for stability reasons. Right now, each time a folder auto-launches, I need to press keys manually to position them correctly. Please help me fix this.

D
dayEric
Member
71
11-17-2023, 02:51 AM
#2
– Unless there’s something I’m overlooking, which seems unlikely, the command “gnome-terminal -e bashscript.sh file” works by opening the Gnome terminal and running the specified script. It typically opens just one Nemo window with the top selection from the three you want, ensuring the next window launches only after the first one. Unless there’s another confirmation, it appears I can achieve this by using a custom Nemo command that launches before my bash script, so the windows appear snapped in place without needing the fourth to open first. This solution is considered adequate for now.

Here’s the bash script you provided…
My thanks to Termy for nemo && { sleep 0.5s; xdotool key --window xdotool getactivewindow ‘Super+Right’; } and a user named Welcome for tweaking the script so it auto-opens and snaps to corners.

Script to automatically open Nemo windows & snap them to corners – Linux Mint Forums

In short: pick the folders you wish to open and snap to each corner. Draft a new file (not as root) with a .sh extension, paste the script inside, make it executable. Adjust the window size in the script to match your monitor’s 4 quadrant dimensions (e.g., 1280x720 per corner). Edit the path lines in the script to point to the folders you want.

For snapping/tiling, add a step at the end of each Nemo command line. For example:
`nemo '/mnt/GoPro 1TB Backup' && { sleep 0.1s; xdotool key --window xdotool getactivewindow ‘Super+Right+Down’; }`

This ensures the window snaps to the bottom-right corner. Be sure to test each line, and let me know if you need further help. Cheers —
D
dayEric
11-17-2023, 02:51 AM #2

– Unless there’s something I’m overlooking, which seems unlikely, the command “gnome-terminal -e bashscript.sh file” works by opening the Gnome terminal and running the specified script. It typically opens just one Nemo window with the top selection from the three you want, ensuring the next window launches only after the first one. Unless there’s another confirmation, it appears I can achieve this by using a custom Nemo command that launches before my bash script, so the windows appear snapped in place without needing the fourth to open first. This solution is considered adequate for now.

Here’s the bash script you provided…
My thanks to Termy for nemo && { sleep 0.5s; xdotool key --window xdotool getactivewindow ‘Super+Right’; } and a user named Welcome for tweaking the script so it auto-opens and snaps to corners.

Script to automatically open Nemo windows & snap them to corners – Linux Mint Forums

In short: pick the folders you wish to open and snap to each corner. Draft a new file (not as root) with a .sh extension, paste the script inside, make it executable. Adjust the window size in the script to match your monitor’s 4 quadrant dimensions (e.g., 1280x720 per corner). Edit the path lines in the script to point to the folders you want.

For snapping/tiling, add a step at the end of each Nemo command line. For example:
`nemo '/mnt/GoPro 1TB Backup' && { sleep 0.1s; xdotool key --window xdotool getactivewindow ‘Super+Right+Down’; }`

This ensures the window snaps to the bottom-right corner. Be sure to test each line, and let me know if you need further help. Cheers —