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:
- The window does appear.
~$ echo $XDG_SESSION_TYPE
x11
- 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)?
--command "
which emacs" is pointless. If
which emacs` works, thenemacs
alone will also work sincewhich
simply searches for the firstemacs
in yourPATH
which is what runningemacs
alone does.xdotool
to focus.