Skip to main content
Defeated race condition
Source Link
JayCravens
  • 340
  • 1
  • 7

I have another approach you can try out. ThisThis should work to minimize the terminal. Really, it's going to minimize any window with active focus.

#!/bin/bash

matebash -terminalc &
sleep'mate-terminal' 5
&& active_win=$(xdotool getactivewindow) 

xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.


Add a .desktop file to ~/.config/autostart/ to run on startup.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup

I have another approach you can try out. This should work to minimize the terminal. Really, it's going to minimize any window with active focus.

#!/bin/bash

mate-terminal &
sleep 5
active_win=$(xdotool getactivewindow)
xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.


Add a .desktop file to ~/.config/autostart/ to run on startup.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup

This should work to minimize the terminal. Really, it's going to minimize any window with active focus.

#!/bin/bash

bash -c 'mate-terminal' && active_win=$(xdotool getactivewindow) 

xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.


Add a .desktop file to ~/.config/autostart/ to run on startup.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup
removed cron. just isn't necessary.
Source Link
JayCravens
  • 340
  • 1
  • 7

I have another approach you can try out. This should work to minimize the terminal. Really, it's going to minimize any window with active focus.

#!/bin/bash

mate-terminal &
sleep 5
active_win=$(xdotool getactivewindow)
xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.


Add a .desktop file to ~/.config/autostart/ to run on startup.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup

I have another approach you can try out.

#!/bin/bash

mate-terminal &
sleep 5
active_win=$(xdotool getactivewindow)
xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.


Add a .desktop file to ~/.config/autostart/ to run on startup.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup

I have another approach you can try out. This should work to minimize the terminal. Really, it's going to minimize any window with active focus.

#!/bin/bash

mate-terminal &
sleep 5
active_win=$(xdotool getactivewindow)
xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.


Add a .desktop file to ~/.config/autostart/ to run on startup.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup
removed cron. just isn't necessary.
Source Link
JayCravens
  • 340
  • 1
  • 7

I have another approach you can try out.

#!/bin/bash

mate-terminal &
sleep 5
active_win=$(xdotool getactivewindow)
xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.

A simple way to run it on startup is a cron job. Run crontab -e and paste this in the editor that opens:

@reboot DISPLAY=:0 XAUTHORITY=/home/youruser/.Xauthority bash -c "/path/to/my_script.sh"

Save, then exit and now it's added to the cron file. This is a hail mary, of sorts.


You may need to addAdd a .desktop file to ~/.config/autostart/. It's the more proper way, certainly to run on startup.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup

I have another approach you can try out.

#!/bin/bash

mate-terminal &
sleep 5
active_win=$(xdotool getactivewindow)
xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.

A simple way to run it on startup is a cron job. Run crontab -e and paste this in the editor that opens:

@reboot DISPLAY=:0 XAUTHORITY=/home/youruser/.Xauthority bash -c "/path/to/my_script.sh"

Save, then exit and now it's added to the cron file. This is a hail mary, of sorts.


You may need to add a .desktop file to ~/.config/autostart/. It's the more proper way, certainly.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup

I have another approach you can try out.

#!/bin/bash

mate-terminal &
sleep 5
active_win=$(xdotool getactivewindow)
xdotool windowminimize "$active_win"

exit 0

I don't have mate-terminal, but it's working with xterm & xfce4-terminal.


Add a .desktop file to ~/.config/autostart/ to run on startup.

Example: my_script.desktop

[Desktop Entry]
Type=Application
Exec=bash -c "/path/to/my_script.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=My Shell Script
Comment=Run script on startup
added autostart setup
Source Link
JayCravens
  • 340
  • 1
  • 7
Loading
cron job
Source Link
JayCravens
  • 340
  • 1
  • 7
Loading
New script
Source Link
JayCravens
  • 340
  • 1
  • 7
Loading
added 53 characters in body
Source Link
JayCravens
  • 340
  • 1
  • 7
Loading
Post Undeleted by JayCravens
Post Deleted by JayCravens
Source Link
JayCravens
  • 340
  • 1
  • 7
Loading