Score:1

symlink to a bash script does not start on system startup

de flag

As per the subject, the symlink pointing to a bash script is not executed when starting Kubuntu 22.10.

If I click on the symlink from Dolphin everything works, the original script is executed.

andrea@Tehesyan:/etc/profile.d$ ls -l
totale 52
...
lrwxrwxrwx 1 root   root     71 giu 13 19:14 script-remapping-mouse-keys.sh -> /home/andrea/programmazione/bash-scripts/script-remapping-mouse-keys.sh
-rwxrwxr-x 1 andrea andrea  176 mag 19 11:24 script-resetta-wifi-al-login.sh
-rwxr-xr-x 1 root   root    269 mag 16 11:25 script-start-pulseaudio.sh

The symlink is script-remapping-mouse-keys.sh, the other bash scripts run, but they are not symlinks!

Below is the original bash script, which still runs if I start the symlink from Dolphin.

#!/bin/bash
remote_id=18
mkdir -p /tmp/xkb/symbols
cat >/tmp/xkb/symbols/custom <<\EOF

xkb_symbols "remote" {
    key <AE04> { [ Home ] };
    key <AE07> { [ End ] };
    key <AE05> { [ Prior ] };
    key <AE08> { [ Next ] };
};
EOF

setxkbmap -device $remote_id -print \
 | sed 's/\(xkb_symbols.*\)"/\1+custom(remote)"/' \
 | xkbcomp -I/tmp/xkb -i $remote_id -synch - $DISPLAY 2>/dev/null

Where could be the problem? Thanks

Raffa avatar
jp flag
Being a symlink is not an issue ... Symlinks to executable scripts are treated equal to the target script file i.e. if the target file executes directly then, symlinks to it will execute equally ... But, the issue might be this: https://askubuntu.com/a/1450655
canerandagio avatar
de flag
this seems right, but sadly KDE has problems launching scripts, sometimes it does and sometimes it doesn't, it's not reliable. I could however pause at the beginning of the original script to wait for the session to load. Thank you
canerandagio avatar
de flag
Using sleep didn't work, I fixed it by creating a .desktop file in ~/.config/autostart/
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.