Run a command on start up, please [duplicate]












0















This question already has an answer here:




  • How to run scripts on start up?

    9 answers



  • How to permanently configure keyboard

    6 answers




I install Ubuntu on my notebook bought in USA but I'm from Brazil, the problem is, because of the keyboard model, I have to run this command every time I turn on my system:



"setxkbmap -model abnt2 -layout br -variant abnt2"



How can I turn this process automatic, or maybe install a keyboard model. Sorry for bad enlgish.










share|improve this question













marked as duplicate by George Udosen, user68186, dessert command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 17 '18 at 21:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















    0















    This question already has an answer here:




    • How to run scripts on start up?

      9 answers



    • How to permanently configure keyboard

      6 answers




    I install Ubuntu on my notebook bought in USA but I'm from Brazil, the problem is, because of the keyboard model, I have to run this command every time I turn on my system:



    "setxkbmap -model abnt2 -layout br -variant abnt2"



    How can I turn this process automatic, or maybe install a keyboard model. Sorry for bad enlgish.










    share|improve this question













    marked as duplicate by George Udosen, user68186, dessert command-line
    Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Dec 17 '18 at 21:41


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















      0












      0








      0








      This question already has an answer here:




      • How to run scripts on start up?

        9 answers



      • How to permanently configure keyboard

        6 answers




      I install Ubuntu on my notebook bought in USA but I'm from Brazil, the problem is, because of the keyboard model, I have to run this command every time I turn on my system:



      "setxkbmap -model abnt2 -layout br -variant abnt2"



      How can I turn this process automatic, or maybe install a keyboard model. Sorry for bad enlgish.










      share|improve this question














      This question already has an answer here:




      • How to run scripts on start up?

        9 answers



      • How to permanently configure keyboard

        6 answers




      I install Ubuntu on my notebook bought in USA but I'm from Brazil, the problem is, because of the keyboard model, I have to run this command every time I turn on my system:



      "setxkbmap -model abnt2 -layout br -variant abnt2"



      How can I turn this process automatic, or maybe install a keyboard model. Sorry for bad enlgish.





      This question already has an answer here:




      • How to run scripts on start up?

        9 answers



      • How to permanently configure keyboard

        6 answers








      command-line keyboard keyboard-layout startup






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 17 '18 at 20:11









      Adriel Santana

      1




      1




      marked as duplicate by George Udosen, user68186, dessert command-line
      Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Dec 17 '18 at 21:41


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by George Udosen, user68186, dessert command-line
      Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Dec 17 '18 at 21:41


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          2 Answers
          2






          active

          oldest

          votes


















          1














          Instead of running a command at each startup, you'd better save those settings persistently. Open /etc/default/keyboard for editing and give it this contents:



          XKBLAYOUT="br"
          BACKSPACE="guess"
          XKBVARIANT="abnt2"
          XKBMODEL="abnt2"





          share|improve this answer





























            1














            One way to do this would be to set it up as a systemd service:





            1. Create a .service file, which, once enabled, will be run by systemd upon booting. In a text editor, create a file called mykeyboard.service and include the following (change the path/to/ part with the actual path to your script):



              [Unit]
              Description=MyKeyboard service

              [Service]
              ExecStart=setxkbmap -model abnt2 -layout br -variant abnt2

              [Install]
              WantedBy=multi-user.target


            2. Place your new .service file in the directory /etc/systemd/system/


            3. To run and have it run on boot, you would use sudo systemctl enable --now mykeyboard


            That should do it!






            share|improve this answer






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Instead of running a command at each startup, you'd better save those settings persistently. Open /etc/default/keyboard for editing and give it this contents:



              XKBLAYOUT="br"
              BACKSPACE="guess"
              XKBVARIANT="abnt2"
              XKBMODEL="abnt2"





              share|improve this answer


























                1














                Instead of running a command at each startup, you'd better save those settings persistently. Open /etc/default/keyboard for editing and give it this contents:



                XKBLAYOUT="br"
                BACKSPACE="guess"
                XKBVARIANT="abnt2"
                XKBMODEL="abnt2"





                share|improve this answer
























                  1












                  1








                  1






                  Instead of running a command at each startup, you'd better save those settings persistently. Open /etc/default/keyboard for editing and give it this contents:



                  XKBLAYOUT="br"
                  BACKSPACE="guess"
                  XKBVARIANT="abnt2"
                  XKBMODEL="abnt2"





                  share|improve this answer












                  Instead of running a command at each startup, you'd better save those settings persistently. Open /etc/default/keyboard for editing and give it this contents:



                  XKBLAYOUT="br"
                  BACKSPACE="guess"
                  XKBVARIANT="abnt2"
                  XKBMODEL="abnt2"






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 17 '18 at 21:06









                  Gunnar Hjalmarsson

                  19.1k23261




                  19.1k23261

























                      1














                      One way to do this would be to set it up as a systemd service:





                      1. Create a .service file, which, once enabled, will be run by systemd upon booting. In a text editor, create a file called mykeyboard.service and include the following (change the path/to/ part with the actual path to your script):



                        [Unit]
                        Description=MyKeyboard service

                        [Service]
                        ExecStart=setxkbmap -model abnt2 -layout br -variant abnt2

                        [Install]
                        WantedBy=multi-user.target


                      2. Place your new .service file in the directory /etc/systemd/system/


                      3. To run and have it run on boot, you would use sudo systemctl enable --now mykeyboard


                      That should do it!






                      share|improve this answer




























                        1














                        One way to do this would be to set it up as a systemd service:





                        1. Create a .service file, which, once enabled, will be run by systemd upon booting. In a text editor, create a file called mykeyboard.service and include the following (change the path/to/ part with the actual path to your script):



                          [Unit]
                          Description=MyKeyboard service

                          [Service]
                          ExecStart=setxkbmap -model abnt2 -layout br -variant abnt2

                          [Install]
                          WantedBy=multi-user.target


                        2. Place your new .service file in the directory /etc/systemd/system/


                        3. To run and have it run on boot, you would use sudo systemctl enable --now mykeyboard


                        That should do it!






                        share|improve this answer


























                          1












                          1








                          1






                          One way to do this would be to set it up as a systemd service:





                          1. Create a .service file, which, once enabled, will be run by systemd upon booting. In a text editor, create a file called mykeyboard.service and include the following (change the path/to/ part with the actual path to your script):



                            [Unit]
                            Description=MyKeyboard service

                            [Service]
                            ExecStart=setxkbmap -model abnt2 -layout br -variant abnt2

                            [Install]
                            WantedBy=multi-user.target


                          2. Place your new .service file in the directory /etc/systemd/system/


                          3. To run and have it run on boot, you would use sudo systemctl enable --now mykeyboard


                          That should do it!






                          share|improve this answer














                          One way to do this would be to set it up as a systemd service:





                          1. Create a .service file, which, once enabled, will be run by systemd upon booting. In a text editor, create a file called mykeyboard.service and include the following (change the path/to/ part with the actual path to your script):



                            [Unit]
                            Description=MyKeyboard service

                            [Service]
                            ExecStart=setxkbmap -model abnt2 -layout br -variant abnt2

                            [Install]
                            WantedBy=multi-user.target


                          2. Place your new .service file in the directory /etc/systemd/system/


                          3. To run and have it run on boot, you would use sudo systemctl enable --now mykeyboard


                          That should do it!







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Dec 17 '18 at 21:12

























                          answered Dec 17 '18 at 20:42









                          SlidingHorn

                          766




                          766















                              Popular posts from this blog

                              Mouse cursor on multiple screens with different PPI

                              Agildo Ribeiro

                              Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”