How to run a shell script at startup

前端 未结 21 2020
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 13:39

On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my

21条回答
  •  迷失自我
    2020-11-22 14:16

    Here is a simpler method!

    First: write a shell script and save it a .sh here is an example

    #!/bin/bash
    Icoff='/home/akbar/keyboardONOFF/icon/Dt6hQ.png'
    id=13
    fconfig=".keyboard"
    echo "disabled" > $fconfig
    xinput float $id
    notify-send -i $Icoff "Internal Keyboard disabled";
    

    this script will disable the internal keyboard at startup.

    Second: Open the application " Startup Application Preferences"

    enter image description here

    enter image description here

    Third: click Add. fourth: in the NAME section give a name. fifth: In the command section browse to your .sh . sixth: edit your command section to:

    bash  path/to/file/.sh  --start
    

    seventh: click Add. Thats it! Finished!

    Now confirm by rebooting your pc.

    cheers!

提交回复
热议问题