I need to run a one line startup script under gnome and systemd

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1



now what is the easiest way to run this one bash line of code at startup???



I am running Gnome 3.14.










share|improve this question


























    0















    nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1



    now what is the easiest way to run this one bash line of code at startup???



    I am running Gnome 3.14.










    share|improve this question
























      0












      0








      0








      nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1



      now what is the easiest way to run this one bash line of code at startup???



      I am running Gnome 3.14.










      share|improve this question














      nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1



      now what is the easiest way to run this one bash line of code at startup???



      I am running Gnome 3.14.







      linux gnome gnome3 systemd init-script






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 10 '14 at 3:08









      DerekDerek

      1033




      1033




















          3 Answers
          3






          active

          oldest

          votes


















          1














          You can use gnome-session-properties in terminal or using Alt+F2.



          That opens up Startup Applications Preferences in my Linux Mint (could be different for your distro).



          Give a name for your command (optional)



          Write the bash code in Command option



          Add any comment (optional)



          Alternatively, you could give a command to execute a bash file (which contains your code) in the commands option.



          UPDATE: As notified by don_crissti you have to use gnome-tweak-tool instead. I'm guessing it still has similar options.






          share|improve this answer




















          • 1





            don is right, but I downloaded it from the aur and everything worked out fine thank you!

            – Derek
            Dec 10 '14 at 3:34


















          1














          If you want to do it with systemd you create a service file as follows:



          [Unit]
          Description=Execute some nvidia command

          [Service]
          Type=oneshot
          ExecStart=nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1

          [Install]
          WantedBy=graphical.target


          You should save this file with a .service suffix ~/.config/systemd/user/ and enable it with systemctl --user enable filename.service. This way every time you start your session the command will be run. You may add some options to avoid it being run more than once per boot or adjust dependencies so it's executed earlier in the boot process.



          Check for problems and status with systemctl status filename.service.






          share|improve this answer






























            0














            Add this line to /etc/rc.local before exit 0 this will the same when system starts.






            share|improve this answer























            • I don't have an rc.local file in /etc

              – Derek
              Dec 10 '14 at 20:49











            • which Operating system u r using?

              – Security Beast
              Dec 11 '14 at 9:57











            • Arch Linux x86_64 - 3.17.6

              – Derek
              Dec 11 '14 at 23:00










            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f172451%2fi-need-to-run-a-one-line-startup-script-under-gnome-and-systemd%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            You can use gnome-session-properties in terminal or using Alt+F2.



            That opens up Startup Applications Preferences in my Linux Mint (could be different for your distro).



            Give a name for your command (optional)



            Write the bash code in Command option



            Add any comment (optional)



            Alternatively, you could give a command to execute a bash file (which contains your code) in the commands option.



            UPDATE: As notified by don_crissti you have to use gnome-tweak-tool instead. I'm guessing it still has similar options.






            share|improve this answer




















            • 1





              don is right, but I downloaded it from the aur and everything worked out fine thank you!

              – Derek
              Dec 10 '14 at 3:34















            1














            You can use gnome-session-properties in terminal or using Alt+F2.



            That opens up Startup Applications Preferences in my Linux Mint (could be different for your distro).



            Give a name for your command (optional)



            Write the bash code in Command option



            Add any comment (optional)



            Alternatively, you could give a command to execute a bash file (which contains your code) in the commands option.



            UPDATE: As notified by don_crissti you have to use gnome-tweak-tool instead. I'm guessing it still has similar options.






            share|improve this answer




















            • 1





              don is right, but I downloaded it from the aur and everything worked out fine thank you!

              – Derek
              Dec 10 '14 at 3:34













            1












            1








            1







            You can use gnome-session-properties in terminal or using Alt+F2.



            That opens up Startup Applications Preferences in my Linux Mint (could be different for your distro).



            Give a name for your command (optional)



            Write the bash code in Command option



            Add any comment (optional)



            Alternatively, you could give a command to execute a bash file (which contains your code) in the commands option.



            UPDATE: As notified by don_crissti you have to use gnome-tweak-tool instead. I'm guessing it still has similar options.






            share|improve this answer















            You can use gnome-session-properties in terminal or using Alt+F2.



            That opens up Startup Applications Preferences in my Linux Mint (could be different for your distro).



            Give a name for your command (optional)



            Write the bash code in Command option



            Add any comment (optional)



            Alternatively, you could give a command to execute a bash file (which contains your code) in the commands option.



            UPDATE: As notified by don_crissti you have to use gnome-tweak-tool instead. I'm guessing it still has similar options.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 10 '14 at 4:03









            HalosGhost

            3,75392236




            3,75392236










            answered Dec 10 '14 at 3:23









            onkar406onkar406

            1213




            1213







            • 1





              don is right, but I downloaded it from the aur and everything worked out fine thank you!

              – Derek
              Dec 10 '14 at 3:34












            • 1





              don is right, but I downloaded it from the aur and everything worked out fine thank you!

              – Derek
              Dec 10 '14 at 3:34







            1




            1





            don is right, but I downloaded it from the aur and everything worked out fine thank you!

            – Derek
            Dec 10 '14 at 3:34





            don is right, but I downloaded it from the aur and everything worked out fine thank you!

            – Derek
            Dec 10 '14 at 3:34













            1














            If you want to do it with systemd you create a service file as follows:



            [Unit]
            Description=Execute some nvidia command

            [Service]
            Type=oneshot
            ExecStart=nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1

            [Install]
            WantedBy=graphical.target


            You should save this file with a .service suffix ~/.config/systemd/user/ and enable it with systemctl --user enable filename.service. This way every time you start your session the command will be run. You may add some options to avoid it being run more than once per boot or adjust dependencies so it's executed earlier in the boot process.



            Check for problems and status with systemctl status filename.service.






            share|improve this answer



























              1














              If you want to do it with systemd you create a service file as follows:



              [Unit]
              Description=Execute some nvidia command

              [Service]
              Type=oneshot
              ExecStart=nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1

              [Install]
              WantedBy=graphical.target


              You should save this file with a .service suffix ~/.config/systemd/user/ and enable it with systemctl --user enable filename.service. This way every time you start your session the command will be run. You may add some options to avoid it being run more than once per boot or adjust dependencies so it's executed earlier in the boot process.



              Check for problems and status with systemctl status filename.service.






              share|improve this answer

























                1












                1








                1







                If you want to do it with systemd you create a service file as follows:



                [Unit]
                Description=Execute some nvidia command

                [Service]
                Type=oneshot
                ExecStart=nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1

                [Install]
                WantedBy=graphical.target


                You should save this file with a .service suffix ~/.config/systemd/user/ and enable it with systemctl --user enable filename.service. This way every time you start your session the command will be run. You may add some options to avoid it being run more than once per boot or adjust dependencies so it's executed earlier in the boot process.



                Check for problems and status with systemctl status filename.service.






                share|improve this answer













                If you want to do it with systemd you create a service file as follows:



                [Unit]
                Description=Execute some nvidia command

                [Service]
                Type=oneshot
                ExecStart=nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1

                [Install]
                WantedBy=graphical.target


                You should save this file with a .service suffix ~/.config/systemd/user/ and enable it with systemctl --user enable filename.service. This way every time you start your session the command will be run. You may add some options to avoid it being run more than once per boot or adjust dependencies so it's executed earlier in the boot process.



                Check for problems and status with systemctl status filename.service.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 4 '15 at 8:25









                miguelbernadimiguelbernadi

                33114




                33114





















                    0














                    Add this line to /etc/rc.local before exit 0 this will the same when system starts.






                    share|improve this answer























                    • I don't have an rc.local file in /etc

                      – Derek
                      Dec 10 '14 at 20:49











                    • which Operating system u r using?

                      – Security Beast
                      Dec 11 '14 at 9:57











                    • Arch Linux x86_64 - 3.17.6

                      – Derek
                      Dec 11 '14 at 23:00















                    0














                    Add this line to /etc/rc.local before exit 0 this will the same when system starts.






                    share|improve this answer























                    • I don't have an rc.local file in /etc

                      – Derek
                      Dec 10 '14 at 20:49











                    • which Operating system u r using?

                      – Security Beast
                      Dec 11 '14 at 9:57











                    • Arch Linux x86_64 - 3.17.6

                      – Derek
                      Dec 11 '14 at 23:00













                    0












                    0








                    0







                    Add this line to /etc/rc.local before exit 0 this will the same when system starts.






                    share|improve this answer













                    Add this line to /etc/rc.local before exit 0 this will the same when system starts.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 10 '14 at 12:58









                    Security BeastSecurity Beast

                    752512




                    752512












                    • I don't have an rc.local file in /etc

                      – Derek
                      Dec 10 '14 at 20:49











                    • which Operating system u r using?

                      – Security Beast
                      Dec 11 '14 at 9:57











                    • Arch Linux x86_64 - 3.17.6

                      – Derek
                      Dec 11 '14 at 23:00

















                    • I don't have an rc.local file in /etc

                      – Derek
                      Dec 10 '14 at 20:49











                    • which Operating system u r using?

                      – Security Beast
                      Dec 11 '14 at 9:57











                    • Arch Linux x86_64 - 3.17.6

                      – Derek
                      Dec 11 '14 at 23:00
















                    I don't have an rc.local file in /etc

                    – Derek
                    Dec 10 '14 at 20:49





                    I don't have an rc.local file in /etc

                    – Derek
                    Dec 10 '14 at 20:49













                    which Operating system u r using?

                    – Security Beast
                    Dec 11 '14 at 9:57





                    which Operating system u r using?

                    – Security Beast
                    Dec 11 '14 at 9:57













                    Arch Linux x86_64 - 3.17.6

                    – Derek
                    Dec 11 '14 at 23:00





                    Arch Linux x86_64 - 3.17.6

                    – Derek
                    Dec 11 '14 at 23:00

















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f172451%2fi-need-to-run-a-one-line-startup-script-under-gnome-and-systemd%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)