• ATDA@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 months ago

    of course sorry for delay.

    Requirements: wmctrl, xdotool

    My left screen is 1440p, second screen to the right is 1080 in portrait so you will have to swap the horz/vert locations to match your layout.

    #!/bin/bash
    
    # Time in seconds to wait after launch of program and manipulation of window
    timer=5
    
    # Launch FreeCAD maximized on the main screen
    freecad &
    sleep $timer  # Wait for FreeCAD to launch
    wmctrl -r "FreeCAD" -b add,maximized_vert,maximized_horz
    
    # Launch Cura on the second screen, top half
    cura &
    sleep $timer  # Wait for Cura to launch
    xdotool search --onlyvisible --name "Ultimaker Cura" windowsize 540 960 windowmove 2560 0
    
    # Launch Firefox on the second screen, bottom half
    firefox &
    sleep $timer  # Wait for Firefox to launch
    xdotool search --onlyvisible --name "Mozilla Firefox" windowsize 540 960 windowmove 2560 960
    
    echo "Applications have been launched and positioned."