Cannot launch script on KDE startup

Forum rules
Before you post please read how to get help
Post Reply
compiler
Level 1
Level 1
Posts: 6
Joined: Sat Oct 13, 2012 12:15 pm

Cannot launch script on KDE startup

Post by compiler » Fri Sep 28, 2018 1:49 pm

Hi all.

I'm trying to launch a shell script when KDE launches, and none of the methods suggested in other posts work. I'm not a newbie user (Linux user since 1996) and I'm starting to think something's broken in KDE startup, or there's some concept here that I don't understand.

System: Linux Mint 18 with KDE 4.

The script is just:

Code: Select all

compiler@laptop: ~/Desktop  $ cat ~/bin/xmodmap_laptop.sh 
#!/bin/bash
xmodmap ~/.Xmodmap-hplaptop

compiler@laptop: ~/Desktop  $ ls -l ~/bin/xmodmap_laptop.sh
-rwxrwxr-x 1 compiler compiler 40 Sep 28 19:42 /home/compiler/bin/xmodmap_laptop.sh
What I tested and didn't work:

- Created symlink in ~/.config/autostart (this is the path configured in System Settings -> Applications -> Locations -> Autostart path).

- Copied the script with +x permissions inside ~/.config/autostart/

- Performed the same operations in ~/.kde/Autostart/ .

- Added the script to autostart in System Settings -> Startup and Shutdown -> Add Program.

- Added the script to autostart in System Settings -> Startup and Shutdown -> Add Program (run in terminal).

- Added the script to autostart in System Settings -> Startup and Shutdown -> Add Script (with symlink checkbox checked).

- Added the script to autostart in System Settings -> Startup and Shutdown -> Add Script (without symlink checkbox checked).

- Tested also to put absolute paths inside the script (/usr/bin/xmodmap /home/compiler/bin/...).

- Replaced the xmodmap command with "touch /tmp/testfile" (and it's never created).


I don't know what I'm doing wrong so I'd appreciate any help on this.

Thanks and best regards

compiler
Level 1
Level 1
Posts: 6
Joined: Sat Oct 13, 2012 12:15 pm

Re: Cannot launch script on KDE startup

Post by compiler » Fri Sep 28, 2018 1:56 pm

While writing this question, I noticed this:

Code: Select all

ii  kde-baseapps-bin                                4:16.04.3-0ubuntu1~ubuntu16.04~ppa63
Is this the official KDE shipped with Linux Mint 18? Should be KDE 5.6?

Hoser Rob
Level 12
Level 12
Posts: 4344
Joined: Sat Dec 15, 2012 8:57 am

Re: Cannot launch script on KDE startup

Post by Hoser Rob » Sat Sep 29, 2018 9:54 am

compiler wrote:
Fri Sep 28, 2018 1:56 pm
While writing this question, I noticed this:

Code: Select all

ii  kde-baseapps-bin                                4:16.04.3-0ubuntu1~ubuntu16.04~ppa63
Is this the official KDE shipped with Linux Mint 18? Should be KDE 5.6?
Was thinking much the same thing. Mint 18 KDE comes with PLasma 5, and I wouldn't run KDE Plasma 4 in anything newer than Mint 17.3. General lack of backwards compatibility in Linux and all. And 17.3 going EOL next year.

compiler
Level 1
Level 1
Posts: 6
Joined: Sat Oct 13, 2012 12:15 pm

Re: Cannot launch script on KDE startup

Post by compiler » Sat Sep 29, 2018 10:35 am

Hoser Rob wrote:
Sat Sep 29, 2018 9:54 am
Was thinking much the same thing. Mint 18 KDE comes with PLasma 5, and I wouldn't run KDE Plasma 4 in anything newer than Mint 17.3. General lack of backwards compatibility in Linux and all. And 17.3 going EOL next year.
But ... I installed this laptop using Linux Mint 18 KDE edition. But it doesn't have KDE 5, it ships with KDE 4 (and I didn't setup any PPA to go back to KDE 4, so I'm surprised with the versions).

Maybe if I was able to install KDE Plasma 5, this would fix my problem...

Any idea on how to install KDE5 ? :?

gm10
Level 12
Level 12
Posts: 4186
Joined: Thu Jun 21, 2018 5:11 pm

Re: Cannot launch script on KDE startup

Post by gm10 » Sat Sep 29, 2018 11:17 am

compiler wrote:
Fri Sep 28, 2018 1:49 pm
System: Linux Mint 18 with KDE 4.

The script is just:

Code: Select all

compiler@laptop: ~/Desktop  $ cat ~/bin/xmodmap_laptop.sh 
#!/bin/bash
xmodmap ~/.Xmodmap-hplaptop
- Added the script to autostart in System Settings -> Startup and Shutdown -> Add Program.
How did you add it? Probably the wrong command line. But why a script at all? It's just a single command you're trying to run... Just add this command as a startup application:

Code: Select all

xmodmap /home/compiler/.Xmodmap-hplaptop

compiler
Level 1
Level 1
Posts: 6
Joined: Sat Oct 13, 2012 12:15 pm

Re: Cannot launch script on KDE startup

Post by compiler » Sat Sep 29, 2018 11:41 am

gm10 wrote:
Sat Sep 29, 2018 11:17 am
But why a script at all? It's just a single command you're trying to run... Just add this command as a startup application:

Code: Select all

xmodmap /home/compiler/.Xmodmap-hplaptop
Tested. Didn't work. It doesn't make any sense :(

gm10
Level 12
Level 12
Posts: 4186
Joined: Thu Jun 21, 2018 5:11 pm

Re: Cannot launch script on KDE startup

Post by gm10 » Sat Sep 29, 2018 11:44 am

compiler wrote:
Sat Sep 29, 2018 11:41 am
gm10 wrote:
Sat Sep 29, 2018 11:17 am
But why a script at all? It's just a single command you're trying to run... Just add this command as a startup application:

Code: Select all

xmodmap /home/compiler/.Xmodmap-hplaptop
Tested. Didn't work. It doesn't make any sense :(
Well, does it run when you run it manually? In particular, does that /home/compiler/.Xmodmap-hplaptop file even exist?

compiler
Level 1
Level 1
Posts: 6
Joined: Sat Oct 13, 2012 12:15 pm

Re: Cannot launch script on KDE startup

Post by compiler » Sun Sep 30, 2018 3:47 pm

gm10 wrote:
Sat Sep 29, 2018 11:44 am
Well, does it run when you run it manually? In particular, does that /home/compiler/.Xmodmap-hplaptop file even exist?
Yes, of course, the script works perfectly when launched manually.

In fact, if I change the script contents with "touch /tmp/testfile", the file is never created. The script has +x and works from the terminal so...

Post Reply

Return to “KDE”