Login script to set up workspaces (newbie)

I am trying to run a script to start several programs in various workspaces on startup. The script is named wmstartup.sh, located in ~/.local/bin, and is marked executable. It works properly when it is run from the terminal:

#!/bin/bash
/usr/bin/sleep 5s
/usr/bin/wmctrl -s 2
/usr/bin/kitty &
/usr/bin/sleep 0.1s
/usr/bin/thunar &
/usr/bin/sleep 0.1s
/usr/bin/wmctrl -s 1
/usr/bin/thunderbird &> /dev/null &
/usr/bin/sleep 5s
/usr/bin/wmctrl -s 0

I added ~/.local/bin/wmstartup.sh to the list of items to run at login in the Session and Startup app.
When I log in, it does not appear to run. How should I proceed?

why not just place the script in ~/.config/autostart

There is an entry there, which was put there by the session-startup utility program:

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Workspace Startup
Comment=Start various programs in workspaces
Exec=/home/victor/.local/bin/wmstartup.sh
OnlyShowIn=XFCE;
RunHook=0
StartupNotify=false
Terminal=false
Hidden=false

is the desktop file marked executable? I would think your utility program would make it that way but check to make sure it is. Try changing terminal to true instead of false. Shouldn’t matter however it may help. Of course you can opt to just put the script in the autostart folder and remove the desktop file.

I found the problem. My home directory is not accessible to other users. Whatever process is trying to execute the startup commands is not owned by me. Since I don’t want to make my home directory accessible to other users, I’ll move my script to /usr/bin.
Thank you for your help!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.