Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Failing to create a startup script [SOLVED]

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Failing to create a startup script [SOLVED]

#1 Post by silvaf6 »

Heloo! :)

I'm trying to create a startup script but with no sucess.
I tried everything, or almost.

Here is the content of the script (disableCaps.sh):

Code: Select all

#!/bin/bash
xmodmap -e 'clear Lock'&
xmodmap -e 'keycode 66 = F15'&
I added it to Startup Application and nothing. I tried adding only the command : "xmodmap -e 'clear Lock' && xmodmap -e 'keycode 66 = F15'" and nop!
(note: I have done this before like 2 years ago and it worked!)

I go to "~/.config/autostart/" and I see the file with the content:

Code: Select all

[Desktop Entry]
Comment=
Terminal=false
Name=Disable Caps-Lock
Exec=/home/silva/Scripts/disableCaps.sh
Type=Application
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_US]=Disable Caps-Lock
Comment[en_US]=
X-GNOME-Autostart-Delay=4
I followed this tutorial: https://debian-administration.org/artic ... ith_Debian and it didn't run as well. Maybe because update-rc.d is outdated ? I dunno

I have applications like : dropbox, guake and transmition running at startup without any problem... The script/ command runs fine on the terminal. I as well gave the script permissions to run.
I'm using Cinnamon

Also, thanks!
Last edited by silvaf6 on 2017-06-17 21:45, edited 5 times in total.

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Failing to create a startup script

#2 Post by phenest »

Your desktop file Exec entry should begin with sh, i.e. sh /home/silva/Scripts/disableCaps.sh
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#3 Post by silvaf6 »

phenest wrote:Your desktop file Exec entry should begin with sh, i.e. sh /home/silva/Scripts/disableCaps.sh
You mean like this:

Code: Select all

[Desktop Entry]
sh /home/silva/Scripts/disableCaps.sh
Type=Application
Exec=/home/silva/Scripts/disableCaps.sh
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_US]=Disable Caps-Lock
Comment[en_US]=
X-GNOME-Autostart-Delay=4
Doesn't work... Did you mean inside the script?

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Failing to create a startup script

#4 Post by phenest »

Like this:

Code: Select all

[Desktop Entry]
Type=Application
Exec=sh /home/silva/Scripts/disableCaps.sh
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_US]=Disable Caps-Lock
Comment[en_US]=
X-GNOME-Autostart-Delay=4
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#5 Post by silvaf6 »

nop, that aint it...

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#6 Post by silvaf6 »

Here I go home spend another couple of hours on this.

dcihon
Posts: 279
Joined: 2012-09-23 16:18
Been thanked: 3 times

Re: Failing to create a startup script

#7 Post by dcihon »

This worked for me when I put it in the Startup Applications app:

Code: Select all

bash -c "$HOME/somescript.sh"

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#8 Post by silvaf6 »

Thanks. But anyways, I fixed Gnome and there is an option to disable caps lock in gnome tweak tool, so i won't be needing the script now :D

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Failing to create a startup script

#9 Post by debiman »

the first question would have been:
does the script work as intended when you execute it manually?

dcihon
Posts: 279
Joined: 2012-09-23 16:18
Been thanked: 3 times

Re: Failing to create a startup script

#10 Post by dcihon »

Debiman,
I see he does't care anymore about how to do this.
Also he said this in one of his posts:
The script/ command runs fine on the terminal. I as well gave the script permissions to run.
I'm using Cinnamon

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#11 Post by silvaf6 »

This seems to be an issue with "xmodmap" running at startup. I've seen some other solutions online like creating an ~/.xmodmap or something.
I'm gonna mark this as solved and if I need help again i'll request it :D

Thank you and a good afternoon to all of you.

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Failing to create a startup script

#12 Post by phenest »

silvaf6 wrote:so i won't be needing the script now :D
silvaf6 wrote:I'm gonna mark this as solved
Except it isn't. You never made the startup script work. It's not a solution, because you gave up and did something else instead. Next time you need a startup script, you'll be asking this question all over again.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#13 Post by silvaf6 »

dcihon wrote:This worked for me when I put it in the Startup Applications app:

Code: Select all

bash -c "$HOME/somescript.sh"
I've tried this out and didn't work :)

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#14 Post by silvaf6 »

phenest wrote:
silvaf6 wrote:so i won't be needing the script now :D
silvaf6 wrote:I'm gonna mark this as solved
Except it isn't. You never made the startup script work. It's not a solution, because you gave up and did something else instead. Next time you need a startup script, you'll be asking this question all over again.
Ok, i'll unmarked it as solved and I'm gonna stop being lazy and work it out :p

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#15 Post by silvaf6 »

ok, furquan handed me a solution here : http://forums.debian.net/viewtopic.php? ... 86#p646886

Just had to add the script to the crontab :D

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Failing to create a startup script [SOLVED]

#16 Post by phenest »

silvaf6 wrote:I go to "~/.config/autostart/" and I see the file with the content:

Code: Select all

[Desktop Entry]
Comment=
Terminal=false
Name=Disable Caps-Lock
Exec=/home/silva/Scripts/disableCaps.sh
Type=Application
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_US]=Disable Caps-Lock
Comment[en_US]=
X-GNOME-Autostart-Delay=4
Now let's see if you can make it work this way. This is how I run startup scripts.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script [SOLVED]

#17 Post by silvaf6 »

phenest wrote:
silvaf6 wrote:I go to "~/.config/autostart/" and I see the file with the content:

Code: Select all

[Desktop Entry]
Comment=
Terminal=false
Name=Disable Caps-Lock
Exec=/home/silva/Scripts/disableCaps.sh
Type=Application
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[en_US]=Disable Caps-Lock
Comment[en_US]=
X-GNOME-Autostart-Delay=4
Now let's see if you can make it work this way. This is how I run startup scripts.
This doesnt work and nvm the crontab thing, only works sometimes... I'm gonna try the "~/.xmodmap" thing.

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#18 Post by silvaf6 »

ok.

I created a file "~/.Xmodmap" with the following content:

Code: Select all

clear lock
keycode 66 = F15
The "keycode 66 = F15" works, but not the "clear lock".
At least i'm on the right track!

silvaf6
Posts: 70
Joined: 2017-06-12 16:45

Re: Failing to create a startup script

#19 Post by silvaf6 »

nvm of that.

"clear Lock" was not working in "~/.Xmodmap" or in a startup script, so I replaced it with: "setxkbmap -option ctrl:nocaps" and made a second script: "xmodmap -e 'keycode 66 = F15'". Got the job done.

Good night :D

Post Reply