0

All application startups set by GUI for current user sessions are stored as files at a certain place of per home directory:

cd ~/.config/autostart

Set an application to start up with every boot by GUI causes addition of a file with a certain set of data. So, the other way around: Why not simply copy one of these files and edit them as needed?

Result:
Input

emacs -nw mate-terminal-startup.desktop

Output

[Desktop Entry]
Type=Application
Exec=/home/$USER/bin/personal-mate-terminal-startup.sh
Hidden=false
X-MATE-Autostart-enabled=true
Name[en_GB]=Term+bash
Name=Term+bash
Comment[en_GB]=Term+bash
Comment=-

personal-mate-terminal-startup.sh:

#    Personalized Mate-Terminal-Start                                                                                          
#                                                                                                                              
#    Copyleft 🄯 2024                                                                                                           
#                                                                                                                              
#    This program is free software: you can redistribute it and/or modify                                                      
#    it under the terms of the GNU Affero General Public License as published by                                               
#    the Free Software Foundation, either version 3 of the License, or                                                         
#    (at your option) any later version.                                                                                       
#                                                                                                                              
#    This program is distributed in the hope that it will be useful,                                                           
#    but WITHOUT ANY WARRANTY; without even the implied warranty of                                                            
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                                                              
#    GNU Affero General Public License for more details.                                                                       
#                                                                                                                              
#    You should have received a copy of the GNU Affero General Public License                                                  
#    along with this program. If not, see <https://www.gnu.org/licenses/>.                                                     
#                                                                                                                              
#!/bin/bash                                                                                                                    

mate-terminal --full-screen --hide-menubar --command "/usr/bin/emacs -nw /home/$USER/$specific_org_file"

(Side note: emacs invocation by full path for security. Prior implementation by which emacs has same intention, but doesn't fix the problem, because it may makes 1 relative tool invocation less, but with which itself introduces another one.)

That's quite nice, but has a problem:

startup-mate-terminal-session is inactive:

You start the computer, log in, GUI pops up, startup-mate-terminal-session pops up, you think "GREAT!", start typing, but what's this? No single character appears in startup-mate-terminal! Because right from the beginning the window is inactive. First you need to either click on it or type alt+tab and switch to mate-terminal, and only after that typed in characters reach mate-terminal.

What causes that inactivity? And more important: What changes need to be done, in order to make the application active right from the get-go at system start?

On request - specification:

  1. The window does appear.
~$ echo $XDG_SESSION_TYPE
x11
  1. xdotool? researching Yeah, right, that's probably one pathway… leaving actually just room for: Any other solutions? Especially ones so basic, that they work out-of-the-box without the need to install additional software (my distro doesn't have it, but offers it as a package in its repos)?
4
  • 1
    Not an answer to your question, but --command "which emacs" is pointless. If which emacs` works, then emacs alone will also work since which simply searches for the first emacs in your PATH which is what running emacs alone does.
    – terdon
    Commented Feb 8 at 11:56
  • 3
    Presumably, you need to set the focus to the window (the window does appear, right?). Are you using wayland or Xorg? If Xorg, you can use something like xdotool to focus.
    – terdon
    Commented Feb 8 at 11:58
  • I think there is a good chance something steals the focus in the meantime. Maybe something of this will be of help unix.stackexchange.com/questions/261003/… . Maybe adding a sleep beforehand could also help. Commented Mar 1 at 19:16
  • You might also want to somehow change your styling of inactive windows (they could appear strongly faded maybe), or use "flow/auto/focus-follows-mouse" mode, a thing more intuitive to many (but not for everyone) Commented Mar 1 at 19:17

0

You must log in to answer this question.

Browse other questions tagged .