How To Autostart Programs On Linux

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • How do you "autostart" programs on Linux? While the big desktop environments (like GNOME and Plasma) simplify this, knowing how to setup your autostart programs is especially important for standalone window manager users. While there are a number of ways to do this, I'm going to show you the two ways that I use.
    WANT TO SUPPORT THE CHANNEL?
    💰 Patreon: / distrotube
    💳 Paypal: www.youtube.co...
    🛍️ Amazon: amzn.to/2RotFFi
    👕 Teespring: teespring.com/...
    DONATE CRYPTO:
    💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
    🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
    📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ
    DT ON THE WEB:
    🕸️ Website: distrotube.com/
    📁 GitLab: gitlab.com/dwt1
    🗨️ Mastodon: fosstodon.org/...
    👫 Reddit: / distrotube
    📽️ LBRY/Odysee: odysee.com/@Di...
    FREE AND OPEN SOURCE SOFTWARE THAT I USE:
    🌐 Brave Browser - brave.com/dis872
    📽️ Open Broadcaster Software: obsproject.com/
    🎬 Kdenlive: kdenlive.org
    🎨 GIMP: www.gimp.org/
    💻 VirtualBox: www.virtualbox...
    🗒️ Doom Emacs: github.com/hli...
    Your support is very much appreciated. Thanks, guys!

КОМЕНТАРІ • 117

  • @jackkeifer
    @jackkeifer 2 роки тому +8

    Great explanation for auto-starting! I have to admit, I'm one of those users that never did it this way. 👍👍

  • @philzeo
    @philzeo 2 роки тому +1

    KDE user here. I love how simple the autostart program is 😁 autostart my dock, my Konsole, my Backup application. Nothing more, nothing less. No kruft, all easy.
    Thanks for showing us some more ways to make it work on other desktops!

  • @phonewithoutquestion80
    @phonewithoutquestion80 2 роки тому +17

    I use xinitrc and have ever since I ditched the display manager. You can even automate the "startx" command to trigger every time you log into the tty, making it behave more like somewhat of a DM.

    • @groos3449
      @groos3449 2 роки тому

      Same, it's much better this way. However I place my apps on my .xprofile to keep my .xinitrc more organized

    • @lucasrodrigues9766
      @lucasrodrigues9766 2 роки тому

      Is there a way of using xinitrc with a display manager? I wanted some script to run after I select the dwm window manager through a xfce login, but I do not know how I can do that

    • @lucasrodrigues9766
      @lucasrodrigues9766 2 роки тому

      I have tried using a script in the dwm.desktop file, yet it could not find the file, sometimes it simply returned to the xfce login screen instead of opening the dwm window

    • @Tjk918
      @Tjk918 2 роки тому +1

      @@lucasrodrigues9766 Try using a .xprofile file. They are supported by most DMs

    • @lucasrodrigues9766
      @lucasrodrigues9766 2 роки тому

      @@Tjk918 thanks

  • @Abdo70t
    @Abdo70t 2 роки тому +4

    like your tutorials alot, simple and to the point thanks

  • @Jeff_Seely
    @Jeff_Seely Рік тому +2

    This is really great information thank you Derek. I want to start the proper screen resolution for each window manager and this clearly explained it.

  • @Muneeb100
    @Muneeb100 2 роки тому +3

    I really needed this one. Thanks

  • @somedude7624
    @somedude7624 2 роки тому +2

    Hey Thanks,
    You uploaded it just when I neeed it.

    • @vaisakhkm783
      @vaisakhkm783 2 роки тому

      Yes.. i just search it yeaterday and gone nuts as things put in xinitrc not starting....
      🙃i just wanted compton and wal to start but not from WM config file... that is not working sometimes

  • @QuotePilgrim
    @QuotePilgrim 2 роки тому +1

    Well, .desktop files have an option to run commands in the terminal so, yes, you can put the Htop desktop file in your autostart folder and it will work.
    If you're using a GUI desktop file editor it should be a checkbox saying "run in terminal", if editing it manually with a text editor, it's a line saying "Terminal=true" (or "false").

  • @donpeer4477
    @donpeer4477 2 роки тому +1

    What a great topic! I've been wondering if removing an app got everything out and, thanks to your video, I found that there are actually leftover .desktop files laying around on my system. Well, no longer! Kudos, Derek ;)

  • @ruandiablo
    @ruandiablo 10 місяців тому

    Thank you, my friend! It is equal in Windows, just Win+R shell:startup to acess the folder

  • @SirStevenGilroy
    @SirStevenGilroy 2 роки тому +3

    What about `/etc/init.d` or the `/etc/rc*` scripts and directories? How do you decide between using these, or the autostart files you mentioned in this video?

  • @KeebHoard
    @KeebHoard 7 місяців тому

    Great video. Thanks for the really good, in depth explanation of how these things are really meant to work. It's nice to get some light shed upon the situation.

  • @kychemclass5850
    @kychemclass5850 2 роки тому

    Been using Linux (Thank you God!!) for year now and I know how to "startup" auto-start. Tq DT.

  • @systemuser9636
    @systemuser9636 2 роки тому

    Thanks for the morning video DT!

  • @billeriksson1057
    @billeriksson1057 2 роки тому +5

    In order to connect hardware and software in the correct order, it is important to be able to schedule the start-up of the components. Linux Mint has made it easy for the user by specifying a delay when specifying the startup programs! How do you do in other Distros that lack this?

    • @glidersuzuki5572
      @glidersuzuki5572 2 роки тому

      Which software specifically? I had no issue without any auto starting programs except systemd services.

    • @billeriksson1057
      @billeriksson1057 2 роки тому +1

      @@glidersuzuki5572 Hello,
      Sometimes it is important that the start-up takes place in a predictable way and not randomly. Same every time. Simple example: That the network works and the server is up and running. Then the synchronization software in the computer can be started. The alternative without a specific starting order, I get error messages and problems! Guaranteed! The computer I am currently running has four servers and three clouds connected. The mutual starting order is essential. You do not want some system programs in the early start-up. For example, "Update Manager", "System Reports Manager" and "Panel Program for Print Queue". These are delayed by default in Linux Mint. Anyway, it's so easy to work with the boot order in Linux Mint so you can treat yourself to that luxury! (More complicated cases exist of course) 🙄

    • @rizkyadiyanto7922
      @rizkyadiyanto7922 2 роки тому

      systemd is made to solve that problem. though probably a bit complicated and need some time to read the manual for new users.

    • @idjtoal
      @idjtoal 2 роки тому +1

      @@rizkyadiyanto7922 Or you could just have a directory of init scripts, with names that started with 01, 02, 03, and so on. Not complicated, no need to read a manual, things running in a specific order every time.

    • @paulg3336
      @paulg3336 2 роки тому

      @@rizkyadiyanto7922 On my mythtv system I have an overide file: mythtv_backend_override.conf that tells systemd not to start mythbackend until the hardware tuners have initialised

  • @blasm1713
    @blasm1713 2 роки тому +1

    This is what i needed. Thank you so much!!

  • @YannMetalhead
    @YannMetalhead 2 роки тому +1

    Good video.

  • @nuligebla1173
    @nuligebla1173 2 роки тому +1

    Does it have to be .desktop files, or can it be soft links? Because these desktop files already exist, no? I know they're small, but they get updated when you update, and copying them around always seems to cause problems, like icon file names being changed, etc.

  • @oalfodr
    @oalfodr 2 роки тому +3

    What is wrong with using .xprofile? When using .xprofile, I do not need to make desktop files for all my scripts and programs that do not have desktop files (a lot of programs I use do not have desktop files)

    • @ivailogeimara
      @ivailogeimara 2 роки тому

      Unlike .xprofile and older methods (like .profile), xdg-autostart works with Wayland too. Some people use Wayland instead of XOrg.

  • @MykeHawke-r9r
    @MykeHawke-r9r 3 місяці тому

    Thank you for making this video.

  • @k1lluachan
    @k1lluachan Рік тому

    that's exactly what i need how do i auto-start a terminal program in Linux inside mi desktop environment

  • @gokulrajr6195
    @gokulrajr6195 2 роки тому +1

    "Pro-tip: Have mpv play an autostart sound when you login" 🔥 -DT

  • @Asim-Mias
    @Asim-Mias 2 місяці тому +1

    Hi, when I open Kali Linux The terminal and Firefox browser open aromatically, how can I disable them when I boot? Peace ✌🏼

  • @emacsking4310
    @emacsking4310 2 роки тому +2

    I will make EKOS - Emacs King OS, here the features.
    Muli ISO - KDE, XMonad, BSPWM, i3WM, EXWM
    Super Easy - It will have a keybinding sheet that can be pulled with one key or button on the bar, all programs will be documented on the wiki too.
    Just works - It will be Fedora based prob, stable, up to date packages also.
    No proprietary software - Free operating system.
    Software:
    Fish shell
    Emacs (optional)
    Ungoogled Chromium
    Neomutt
    SCIM
    Dmenu/Rofi
    Etc..Etc..
    Combo DTOS LARBS.

  • @barrenaedu
    @barrenaedu 2 роки тому

    DT, how are you? A been using linux for 10 years or more, another way not discussed very much among users and maybe you can talk about it is creating auto run scripts using systemd and init.d as it is very easy and insane powerfull. I used them a lot as they run in sudo mode you can do lot of things during linux initialization. Good vibes, i see some of your videos some times, good contribution to the linux comunity from your side Regards!

  • @oldbeardedtech993
    @oldbeardedtech993 2 роки тому +3

    Any way to add a 10 second delay to an autostarted app? Like if you need internet connection before the application starts?

    • @scheimong
      @scheimong 2 роки тому +3

      If you use systemd (which is likely), you can create a custom service (a "unit file") that launches your application, and set it to run only after the system reaches a particular "checkpoint" (technically known as a "target"). One of those built-in checkpoints is `network-online.target`, which pretty much means what it says.

    • @scheimong
      @scheimong 2 роки тому +4

      That's the clean way to do it IMO. There's also the quick and dirty way, which is to edit the `.desktop` file, and simply insert `sleep 10s && ` after `Exec=`...

  • @theodorealenas3171
    @theodorealenas3171 2 роки тому +1

    I'm confused. Can't you write a bash script and make that autostart somehow?

  • @heroe1486
    @heroe1486 2 роки тому +1

    Even on tiling wm we rely on premade solution like exec_always on i3

  • @rinzieronzie
    @rinzieronzie 2 роки тому

    Awesome new upload!

  • @therealchonk
    @therealchonk 2 роки тому +2

    I thought systemd (systemctl --user) would be part of this video.

  • @OctaviusPelagius
    @OctaviusPelagius 2 роки тому

    Hey @DistroTube for starting the Emacs daemon I'd consider a systemd unit since you'd have a lot of control over it to restart the daemon in cases like major updates to the Doom plugins for instance.

  • @edwardzdankiewicz9068
    @edwardzdankiewicz9068 2 роки тому

    This topic needs a mention of start on power on vs start on log-in.

  • @send2gl
    @send2gl 2 роки тому

    Useful advice.

  • @YannMetalhead
    @YannMetalhead 2 роки тому

    Thank you!

  • @agneaybnair9519
    @agneaybnair9519 2 роки тому +1

    Hey DT, I feel that astro vim beats doom emacs

  • @NerdTouchingGrass
    @NerdTouchingGrass Рік тому +1

    the problem with linux is ive been looking for 45min on how to start synergy on boot up and its 1 check box in windows.

  • @thomasa.anderson2238
    @thomasa.anderson2238 2 роки тому

    There actually many other way to auto strart things. The two main solution are the systemd service management (if you have systemd of course) and the crontab for task scheduling. In fact crontab is more powerful than that. You can schedule script execution per week month day or per hour minutes and seconds. And also schedule task on reboot shutdown and things like that.

  • @waraiotoko374
    @waraiotoko374 2 роки тому +1

    Does anyone know how to open a program in qtile but in the selected workspace?

  • @Nikolai508
    @Nikolai508 2 роки тому

    Awesome, I've found that the on screen keyboard starts up as a background process on login for me, never use it so will see if I can stop it.

  • @wyattstorms9711
    @wyattstorms9711 Рік тому

    How do you get new programs to run? Do you have to make them executable first, and what is the right way to do that?

  • @amos660
    @amos660 2 роки тому

    Hey DT, what’s your take on ed the Unix line editor?

  • @Torvating
    @Torvating 2 роки тому

    Hey DT how do you handle with programs/software not made for Tiling Window Manager. Like: MegaSync, Steam, Flameshot, etc ?

  • @pelletized
    @pelletized 2 роки тому +1

    How would i autostart a shell script? i don't suppose dropping the sh file into the autostart folder would work?

    • @DistroTube
      @DistroTube  2 роки тому +2

      You could probably just add a .desktop file for you shell script. Make sure that the 'exec' line within the .deskop file points to your shell script.

    • @ivailogeimara
      @ivailogeimara 2 роки тому +2

      As DistroTube said you need to create a .desktop file to start your script. This is an example desktop file:
      ```
      [Desktop Entry]
      Type=Application
      Name=CustomScript
      Exec=/bin/sh /home/user/.config/autostart/script.sh
      StartupNotify=false
      Terminal=false
      ```
      `Name` can be anything.
      `Exec` specifies the command that should be executed. `script.sh` is a "sh"(Bourne Shell) script so I'm using `/bin/sh` to run it. If it's a "bash" script I'd use `/bin/bash /home/user/.config/autostart/script.sh`
      `Terminal` if set to `true` will open the default terminal emulator app and launch the script in there. In most cases you don't want that so it should be set to `false`

  • @ayush-that
    @ayush-that 2 роки тому

    thank you so much

  • @nolan412
    @nolan412 2 роки тому

    Here to hear if it's init scripts, systemd services, XDG autostart, xinitrc, dot profile, or what am I missing?

  • @soanvig
    @soanvig 2 роки тому

    Why the heck WM have autostart capability. While i somewhat understand they provide shortcuts, the autostart though? How is it related to "managing windows"...

  • @nehajain2974
    @nehajain2974 2 роки тому

    How to autostart programs if we are using a raspberrypi lite?? Kindly guide

  • @TheCannonFather
    @TheCannonFather 2 роки тому

    Semi Newbie with a question. Curious if there is way to dictate which workspaces a program opens up in. I would like to group certain apps to certain desktops. I realise that it's probably different per WM but I wanted to know if its doable at all.

  • @bahathir_
    @bahathir_ 2 роки тому +1

    I am using the old skool method, the .xinitrc. It can be as simples as a single line in the .xinitr rc ..
    emacs -fs
    Xorg will run GNU Emacs in full-screen, when start the X11 Window session with 'startx' from text console. Yes, I am still using the old skool 'startx' method. Anyway, my basic .xinitrc just like this.
    # Set resolution
    xrandr --output HDMI-1 --mode 1920x1080
    # Set the beautiful full black wallpaper for 'root window'
    xsetroot -solid black
    # Enable auto blank and monitor's energy saving mode
    xset +dpms
    # Start st terminal emulator with GNU Screen
    st -g 90x25+0+0 -e screen -Rd&
    # Finally start my favorite minimalist window manager.
    evilwm -snap 5

  • @anujv2909
    @anujv2909 2 роки тому

    I really like that shirt, can you give the link ?

  • @nabhasan
    @nabhasan 2 роки тому

    I want application to auto start without need to login in the system.

  • @dcprom0396
    @dcprom0396 2 роки тому

    Could you add this wallpaper to your wallpapers GitLab repo please?

  • @HzYDuB
    @HzYDuB 2 роки тому

    surprised that systemd wasn't mentioned

  • @s8x.
    @s8x. 11 місяців тому

    Is there a way to do this with Hyprland?

  • @lguedes768
    @lguedes768 2 роки тому

    I'm welling to try dtos on a vanilla arch install maybe

  • @Zakaros1000
    @Zakaros1000 2 роки тому

    When I installed CoreControl I was following a youtube tutorial in which it was supposed to configured to autostart, that problem was that I didn't get to autostart the program whichout asking me for the user password. That was hella annoying because I have to enter the password to log in and then enter the password again because CoreControl was asking for it when was autostarted. It's sad that I didn't get an answer in this video for those types of programs that ask for user password whenever they are started.

  • @Jennifer_Prentice
    @Jennifer_Prentice 2 роки тому

    Hi DT . I have a Corsair keyboard and I use CKB-NEXT and I use the terminal command for systemctl enable . I think this just creates an auto start file into the same directory.. Is there anything I should know about using this command instead of just dragging and dropping the files into the directory?

    • @wikingagresor
      @wikingagresor 2 роки тому

      It is just using systemd to do it for you.

    • @ivailogeimara
      @ivailogeimara 2 роки тому

      * `systemctl --user start/enable` - starts a systemd service / makes a systemd service start on user login. User specific systemd services are located in `.config/systemd/user`
      * xdg-autostart i.e. the thing that reads `.config/autostart` and starts the programs in there is another way to autostart apps. Every modern DE is programmed to scan that dir for .desktop files and start them when the DE is started.
      These are 2 ways to autostart a program on login as non-root user. Systemd services are more advanced though and can do more that just start programs on login. You can specify start order, dependencies and more.

  • @platpig7749
    @platpig7749 Рік тому

    can i do this with steam big picture moad

  • @user-xg7hi5mh3g
    @user-xg7hi5mh3g 5 місяців тому

    How to autostart an application on torizon OS

  • @fictitiousnightmares
    @fictitiousnightmares Рік тому

    I still after watching all these videos on how to do it can't get terminal to open up and run bpytop on startup on Linux Mint. Seems simple, but yeaaahh. I created a .desktop file for it and put in:
    [Desktop Entry]
    Type=Application
    Name=bpytop
    Exec=bpytop
    StartupNotify=false
    Terminal=true
    and put it in the .config/autostart directly. It shows up in the gui when turning on and off autostart items, but it doesn't seem to run. Even after making it executable. Shrug.

  • @MerkDolf
    @MerkDolf 2 роки тому +1

    Auto start sound "Welcome you have mail"

  • @synen
    @synen 2 роки тому

    Does DT OS include this very same setup DT uses? Thanks.

  • @tralphstreet
    @tralphstreet 2 роки тому

    I have an autostart script that gets executed by qtile on startup with a method I got in the docs. There's a problem tho. Things started with that scripts do not get killed when the session ends, so logging out and logging back in results in duplicate applications/scripts running in the background. Do you know how I can fix this? Maybe making desktop files for the programs instead of running them with a script, and then using dex to launch those would work?

    • @idjtoal
      @idjtoal 2 роки тому

      Just have the script check to see if the thing is running? " if ps -ef | grep -v grep | grep firefox; then echo 'firefox is running'; else echo 'firefox not started yet'; fi " kind of thing?

    • @rizkyadiyanto7922
      @rizkyadiyanto7922 2 роки тому

      systemd

  • @Larimuss
    @Larimuss Рік тому

    G. Nome sound so wrong 😂 I don’t know official name but I just assumed it was like the English word gnome with silent G

  • @VINNUSAURUS
    @VINNUSAURUS 2 роки тому

    Create a desktop shortcut for the app from the menu and copy it 🤪

  • @cqwickedwake7651
    @cqwickedwake7651 2 роки тому

    I just use systemd because its the best!

  • @Quicken2k
    @Quicken2k 2 роки тому

    Hi. What file manager is that?.

    • @donpeer4477
      @donpeer4477 2 роки тому +1

      Slow down the video and you'll see that Derek is using pcman

    • @Quicken2k
      @Quicken2k 2 роки тому

      @@donpeer4477 Thanks. Looks Nice is why I asked.

    • @emacsking4310
      @emacsking4310 2 роки тому +3

      I think emacs

  • @help2day
    @help2day 2 роки тому

    It is to avoid those apps

  • @kolegakolegi
    @kolegakolegi 2 роки тому

    Well I'm guilty of using Cron inwtead

  • @Walker956
    @Walker956 2 роки тому +1

    Yeah, working for other people sucks.

  • @greendsnow
    @greendsnow 7 місяців тому +6

    Too much talk.

  • @dakotavega6313
    @dakotavega6313 3 місяці тому

    "GAnome"

  • @livingcodex9878
    @livingcodex9878 2 роки тому

    おはようございます

  • @IvanAlexHC86
    @IvanAlexHC86 2 роки тому +1

    first

  • @mozzy09
    @mozzy09 Рік тому +1

    youve wasted my time

  • @mkedzier123
    @mkedzier123 2 роки тому

    As usual - simple thing that is made needlessly complicated on Linux.

    • @lunaticmode638
      @lunaticmode638 2 роки тому

      agreed

    • @user-he4ef9br7z
      @user-he4ef9br7z 2 роки тому +3

      How so?

    • @emacsking4310
      @emacsking4310 2 роки тому

      Lol. How is it complicated? If you want it easier use KDE or some. Yet another idiot filtered by change, when there is a million ways to do it and way easier than Windows.

  • @kadensharpin2156
    @kadensharpin2156 2 роки тому

    Create a "oneshot" .service file. /etc/systemd/system/.service
    systemctl enable .service

  • @glowiak3430
    @glowiak3430 2 роки тому +2

    This is bloat. I just insert "program &" to my ~/.xinitrc

  • @dimitrioskoulartsas6184
    @dimitrioskoulartsas6184 2 роки тому +1

    AwesomeWM users probably need to put their autostart entries in the rc.lua, as AwesomeWM does not respect ~/.config/autostart and /etc/xdg/autostart

    • @dimitrioskoulartsas6184
      @dimitrioskoulartsas6184 2 роки тому

      @Spada I am an AwesomeWM user and I always had this issue

    • @dimitrioskoulartsas6184
      @dimitrioskoulartsas6184 2 роки тому

      @Spada Awesome is the only tiling manager that I have tried. So, I am not sure how it compares to other managers.

  • @sotecluxan4221
    @sotecluxan4221 2 роки тому