 A few days ago, I made a video about how you can easily add a startup sound to your Linux desktop, meaning that when you log in to your desktop environment or window manager, you get a quick 5-10 second audio clip, a sound clip that plays, letting you know, hey, your system has finished booting and you are now logged in. These were very common back in the old days of computers, Windows computers, the old Apple computers back in the day, they all had startup sounds, because back then your computers often took a while to boot up. Sometimes you would wait a minute or two for a computer to finally boot up and actually log you into your desktop. So it was nice having a sound effect there to let you know that your computer finally finished booting. Now, these sound effects are not as common on Linux desktops and really, especially modern computing, a lot of even Windows users now, you know, they just disable all system sounds anyway, but I kind of like it. So what I wanted to do today was I wanted to add some system sounds to DTOS, which is my Arch Linux post installation script. For those of you not familiar with that DTOS is a script I wrote that installs a whole bunch of my custom programs and packages, and it gives you my Exmonad desktop environment for those of you that have not seen my desktop before. You know, this is the Exmonad window manager and it's going to come with various programs and config files of mine. And one of the things I wanted to add were these startup sounds, shutdown sounds and various other system sounds. So I'm going to package up some sound files. I'm going to create a Arch Linux package. I'm going to go ahead and package this for the DTOS core repository and go ahead and see if this actually works. Then I'll run through a quick installation of DTOS to see if everything works correctly. So what I've done is I went to a website that allowed you to download free audio files, a little short audio files, and I found a bunch of computer startup sounds, shutdown sounds, files that sounded like drawers opening, drawers closing, things like that. And what I did is I created a new repository over on my GitLab. My GitLab, by the way, is gitlab.com slash dwt1. And if we view all of my repositories, I created a new one here called DTOS dash sounds. And in this, there are about eight MP3 files. These are short, just a few seconds long, various sound effects here. And other than that, it has a readme and a license here. Really not much to this repo, but this is going to serve us as a repository for our package to actually download these MP3s. So now that I have this repository, what I'm going to do, let me go back to an empty workspace here. The first thing I need to do is create a package build for what will eventually be an installable program that will be called DTOS dash sounds. So I'm going to open up Emacs here and zoom in. And I'm going to navigate to where I have this particular repository here called GitLab dash repos. And this is where I have all of my various GitLab repos. And the two repos that I'm going to be working with here are DTOS dash package build and DTOS dash core dash repo. So DTOS dash core dash repo is where all of the binaries are. This is actually the DTOS core repository, where when you install packages for DTOS, they actually get pulled from this repository. But how are these binaries that go in DTOS dash core dash repo made? Well, they're made by using the package builds that are hosted in DTOS dash package build. So let's go into DTOS dash package build. And in this repo, we have x86 underscore 64. That's the architecture for all of these packages. And this is a list of all of the packages that I package for DTOS. So this is everything that I maintain myself. And I created this one here called DTOS dash sounds. Now that's a directory. If I go in this directory, the only thing in this directory are two files. There is a package build and a dot install file. The dot install file is not necessary. It's kind of an optional file. But what I really need is a package build. And I've already created a package build. I just used a standard template that I use for all my packages. Arch package builds are essentially a shell script. I've done videos on how to build arch packages before. Check some of my past videos on that. But you can think of this as a shell script. Everything at the top here are setting various variables. The first thing I do is I give package name a name. And this package name is going to be DTOS dash sounds. So when you do a sudo pacman dash s to install this program, it will be DTOS dash sounds. That is the name of it. Give it a description. The architecture is x8664. Now that could be other architectures. If you were building, I don't know, 32-bit packages or ARM packages. But everything I do is x8664. The really important thing to have here is URL equals. And this URL equals should be the place where the source code for this program, or in this case, it's not really a program. You can think of it as kind of like a library. It's just where the files that we're pulling down are going to be hosted. And of course, they're hosted at gitlab.com slash dwt1 slash DTOS dash sounds. That's the name of the repository. As far as depends, this won't have any depends, because it's not even really a program. We're just downloading some MP3 files. Make depends, well, that's going to be get, because we're going to use get to get clone this repository. So I need a make depends of get. And then the source, this variable here, is important. That's going to be get plus URL. So get plus, and then this string here. I mentioned there is also an install file. The install equals package name dot install. So DTOS dash sounds dot install, which was the file you saw earlier was this here. And all this is, this particular file, it echoes some output when you install this at the terminal. So if I do sudo pacman dash capital S DTOS dash sounds and install this package, it's going to print out this here to the terminal. So it's going to have this little box around it. And it's going to say sound files were placed in slash opt slash DTOS dash sounds. That just gives the user whoever installed this a little useful information. That way they know exactly where those MP3s were put. Let me kill that buffer there. Let's go back into package build. And then after we get through declaring all of these variables here, assigning these variables, then the bottom is really the script. And this is usually where you're going to have two, three, maybe four shell functions that are defined. Now this is very simple here, what I'm doing. I have a function here for assigning the package version, meaning every time I do a push to my GitLab to DTOS dash sounds. So every time I update something, meaning every time I add a MP3 or edit a MP3 or remove an MP3, anytime I do something with that repository using Git, then this will automatically update the version number for DTOS dash sounds based on the count head here. This is just a easy way to automatically always update your version numbers with your packages. Otherwise every time I do an update, I would have to manually update the package build myself to actually specify an exact version of a program. I don't want to do that. But the real installation portion of the script is this here. And all of this does is it CDs into a directory that's gonna be called DTOS dash sounds. And it's going to install a directory and it's going to put everything in slash opt slash DTOS dash sound, so we're gonna put it in the slash op directory. That's a directory on your Linux system. That's typically where you'll throw programs that you compiled yourself, built from source yourself, things that weren't installed traditionally through your package manager. Often they go in slash opt. I'm putting DTOS dash sounds in slash opt just for convenience. I think that's a logical place to put those MP3 files. Then other than that, the install command here with 644 permissions, it's just gonna install all the MP3 files that are in the source directory. So the get clone of my repository is gonna put them in slash opt slash DTOS dash sounds. And then finally it's going to run the install command for license, it's gonna move the license to user share licenses DTOS dash sounds slash license. Then it's going to install the read me too. User share doc DTOS dash sounds slash read me.org. For those of you that are new to packaging programs for Linux, for like these arch package builds, the install command, install is very similar to like a copy command. And that's essentially what it's doing. It's copying things over from the source directory over to some place on the file system. One thing with arch package builds is when you're installing programs, so when you're putting these files on the file system somewhere, they actually have to be somewhere in the root file system, they cannot be in a user's home directory that's just not allowed. That's why I can't, for example, put these in slash home slash whatever username slash DTOS dash sounds, right? It has to be like a top level directory like in the root file system. That's why I'm putting it in slash opt slash DTOS dash sounds. So now that I've got this package build, we could actually build this package. Let me go back a couple of levels here to, so this is all of the package builds. All these directories here are package names in these directories. There is a package build for each one of these programs. So let me rebuild the DTOS core repository. So I'm gonna actually open a terminal for this. And let me CD into this particular directory here, DTOS dash package build. By doing LS, I've got two scripts here. One is clean up and one is build packages. Clean up is just a script to remove anything in these directories that is not a package build or not a dot install file. Because anything else in these directories is just garbage that needs to go away. So let me run that. And then finally, let me run the build packages script. What build packages is going to do, is it's going to take each one of those package builds and create a binary for that package build. So let me run that. It should ask for a sudo password at some point as we are assigning these packages and it's generating the binaries for each one of these packages assuming the script runs without failure. This usually takes about five to 10 minutes to build all of these binaries. And while that is running, let me switch back to the browser. So you saw DTOS dash sounds. That's again, just a repository that contains the MB3 files. And then if I go back to all of my repositories, there is DTOS dash package build. Again, this is just where all of the package builds for each of these programs is located. For example, DM scripts, there's the package build. You can read the package builds for everything that is hosted in the DTOS core repository. But DTOS dash package build is just the package builds, right? There is a different repository for the actual binaries and that is DTOS dash core dash repo. And this is actually what goes in your pacman.conf when you add the DTOS core repository to your system if you wanted to actually be able to use this repository. You add DTOS dash core dash repo to your pacman.conf. And in this, you have once again, a directory called x86 underscore 64. But in this directory, instead of having a bunch of package builds, you actually have a bunch of .pkg.tar.zst files. Those are the binaries. That is actually what pacman uses to actually install these particular programs. For example, there is the binary package for DM scripts. So if I run sudo pacman dash capital S DM scripts, you know, it's actually going to connect to the DTOS core repo and grab that binary. And that's what it actually uses to install DM scripts. So I hope that makes sense. I just wanted to let you know about those repositories if you want to check any of this stuff out. Let me get back to the terminal. It is still generating those packages. All right, I stepped away for a few minutes while those binaries were being generated. So that was DTOS dash package build. Now, if I go back into Dear Edd, the file manager inside Emacs here, and I just click on one of these packages like DM scripts. Now, in this directory, there's the package build that was here. But now there are these two files here, the pkg.tar.zst and the pkg.tar.zst.sig. So this is the binary and this is the signature file that was generated right from that script, that build packages script. Now these files, these need to be removed from this package build repository and they need to be moved over to the DTOS core dash repo repository. So let me close that window. Now let me move back through the directory here and now let's go into DTOS dash core dash repo. And in this repository, there is one script, build-db.sh, so build database. And what this script does, if I opened it, you guys don't really need to know what the script does, but what it does is it goes into DTOS dash package build and grabs all the binaries and all the sig files and moves them over to DTOS dash core dash repo. And then finally it actually builds a database of those that Pacman can use to actually install programs with. So let me close Emacs here and what I'm gonna do is I'm gonna open up a second terminal because I wanna keep the terminal that has DTOS dash package build open because I'm gonna need it again here in just a second, but I'm gonna cd this time into DTOS dash core dash repo. And I'm gonna run this script build-database.sh. This takes just a few seconds. So it moved all of the binaries from DTOS dash package build to DTOS dash core dash repo. Now what I wanna do is go back to DTOS dash package build and I'm gonna run the cleanup script to get rid of everything that's not a package build because there may be some extra files, some garbage laying around after generating those binaries. And now I'm gonna make a push to both DTOS dash package build and DTOS dash core repo. So I did a get status here. You can see we modified various files here. I'm gonna do get add dash U or add everything that has been updated. So we have several package builds that were updated, meaning their version number typically is what has changed. And then I'm gonna do get commit and I'm gonna do updating package builds as a commit message and then finally get push. All right, and now we have pushed all the new package builds and now let's do the same thing for get core repo. So if I do a get status on this, let me make that full screen. We have a ton of stuff. A lot of things were modified, a lot of things were deleted and then there's a couple of new files, some untracked files here. So what I'm gonna do on this one, I'm gonna do get add asterisks, meaning get add everything in this repository. And then I'm gonna do get commit and this message I'm gonna do updating database instead of updating page builds. And then finally I'm gonna do a get push of the core repo. And this push typically takes a little time as these binary packages got a little size to them. And now we're done with those two repositories. Now let me go back, because there is one more repository we need to play with. So if I go back to my get lab, I have a repository here called simply DTOS. And this repository is the DTOS script. This is the script you download to actually install DTOS. So what it does, it adds the DTOS core repository to your pacman.conf, it does this for you. And then it installs a whole bunch of packages, many of them from the standard arch repositories, most of them though, from the DTOS core repository, you know, my own custom config files and packages and stuff. So that is DTOS, the script. And what I need to do is I need to change one thing here. The DTOS script, other than the script itself has this list here, package list.txt, which is a list of all the packages that get installed. We need to add a new package because we need to add DTOS-sounds to the package list. So let me open up Emacs again. Now let me navigate to the DTOS repo and I'm gonna go to package list. And I'm just going to go down here and add DTOS-sounds to the package list. I'm gonna write and quit that. Now I need to go into the DTOS repo here. I'm gonna go into the terminal here and we need to do a get add-u for get add updated files because we updated that package list. Then I'm gonna do a get commit and I'm going to say add DTOS-sounds to package list. Then let's do a get push. And that is everything I needed to do. There's one other thing I did and I did this off camera. If I go into my Xmonad config, let me open up my Xmonad config file here and zoom in. Let me go down to the bottom where I have some key bindings here. I edited my Xmonad config and this is already going to be updated as part of DTOS. So when you guys install DTOS, you will actually get this new Xmonad config here. You will see I have a new section in the config right above the key bindings for these sounds. I specify a directory where those MP3 files are and I specify slash op slash DTOS-sounds. And then I assign a startup sound. I just create this variable. I could have named it anything but I'm gonna call it startup sound and then I have another one for shutdown sound and I have another one for the menu sound. And you see, I define these as sound directory plus plus. So this path plus and then the name of the MP3. So for startup sound, I did startup-01.mp3. Shutdown sound is shutdown-01.mp3 and the D menu sound is gonna be menu-01.mp3. Now most people are gonna be annoyed by having this D menu sound assigned here. That means every time you run D menu, you're gonna get a sound. You're not gonna get it right now even though I do have this working on my computer because I'm recording. The audio streams are not going to a place where you guys are gonna hear it but you will hear it here in a second because we're gonna do this inside a virtual machine here in a minute. I'm actually going to run through a quick installation of DTOS. But now that I have these variables assigned for these shutdown sounds, all I needed to do is add these shutdown sounds to some key bindings. For example, this key binding here, let me do a copy and I'm gonna do a paste here. What this key binding was originally was the standard exit command from Xmonad. So when I do mod shift Q, it quits out of Xmonad, right? And how that is done by running this command here, IO exit success, it just kills Xmonad. That is all that command does. Now, many people don't know this but you can actually run multiple commands with a key binding in Xmonad by using the sequence function here. And the way this works is you would do sequence underscore is the name of the function and then you need to do in brackets, you know, a command of some kind, comma, and then another command of some kind, comma, another command, whatever. And then the ending brackets and then of course the ending parentheses because we had it parentheses at the beginning here but that is a very easy way to have more than one command run inside Xmonad. So you can see the example I've got here or the very first command, you know, what is in front of this comma here is spawn my sound player plus plus shut down sound. Now my sound player, let me go to the top of the document where I have a lot of variables assigned such as my terminal, my browser, yada, yada, yada. I have a new one here called my sound player and the sound player is going to be FF play. So this is a command line audio player. It's there on any system that has FF MPEG installed. Everybody, everybody that uses Linux should have FF MPEG installed. So that is the command and I have a space at the end of that because that's very important because it's going to be F play dash no display dash auto exit space and then it's going to use this path plus you know, the name of the MP3 but there needs to be a space obviously between the path and the variable for the my sound player. That's why I had that space there. It's very important to leave that. Let me undo what I did here because I don't want to make any changes to this. I've already made these changes and pushed these. So let's run through a quick installation of DTOS. So let me switch to this workspace here where I typically run virtual machines and I've got this clone of Manjaro KDE. Actually, I haven't cloned it yet. This is an updated version of Manjaro KDE. I updated it this morning, but let me duplicate it because I often use these Manjaro VMs for testing with DTOS. I'm going to do a clone meaning it's going to make a copy of it. This could take a few minutes. So now that I have this VM cloned of Manjaro KDE, let me log into the Plasma desktop and I'm logged in here to KDE Plasma desktop. Now, the very first thing I'm going to do is open a terminal. So for those of you that want to check out DTOS, I still kind of consider it beta software. Install it at your own risk. If it's your very first time trying out DTOS, I suggest doing what I'm doing. Try it out in a virtual machine. Now, technically it should work on any Arch Linux base distribution. I often use Manjaro KDE for my testing, but because there are so many Arch Linux base distributions and they do vary, you know, every distribution does things slightly differently, I can't verify that DTOS works on every single Arch base distro, but theoretically it should. Now, first let me go ahead and run a get clone at https colon slash slash getlab.com slash dwt1. That's my get lab username slash DTOS because that's the repo we need to clone. Now, if I do an LS, you should see a new directory in your home directory, DTOS, that's the cloned repository. So CD into DTOS, you do an LS. You should see a few files here, but you have this executable script here, DTOS. So what you want to do is do a period slash DTOS to actually run the script. It's going to ask for a sudo password because you need sudo privileges to install and remove software. And you get a welcome screen, just hit okay three or four times to get past the welcome messages here. Basically it's just warning you, hey, do you really want to do this? It's kind of beta software, yes. Begin installation. It adds DTOS core repo to your pacman.conf and then it starts installing a whole bunch of packages, many of them from the Arch repo, many of them from the DTOS core repo and it looks like it is finished installing the 361 packages that it needed to install using pacman. And then once it gets through this, it should begin the DOOM Emacs installation. Yeah, it's cloning DOOM Emacs now. The DOOM Emacs installation actually takes the bulk of the time for this script to run. All right, and it looks like it finished the installation of DOOM Emacs. Once again, it's asking for a sudo password. And it's going to recompile Xmonad for us in the very last part of the DTOS installation script. It asks what do you want your user's default shell to be? You have fish, bash, ZSH as options. I'm gonna choose the first option, which really is the default is fish. And now it's going to ask do we want to go ahead and reboot that way we can go ahead and log in to DTOS and yes, let's reboot the machine. And we come to our login manager and let's go ahead and well, before we log in, we need to change from Plasma over to Xmonad. And let's see if everything looks good. You get the startup sound, right? So that DTOS sounds was definitely installed properly. I'm sure you guys heard that. Let's run a Xrander-S1920 by 1080 to get proper screen resolution here. And let's, oh, you can hear the D menu sound. If I restart Xmonad one more time, will I get the startup sound again? No, and that is by design. If I actually open my config, it doesn't look like the Emacs daemon is running. Actually it looks like Emacs still has one more thing to install the emoji package. Now let me close that and go to a terminal. I'll just start the Emacs daemon with slash user slash bin slash Emacs dash dash. Daemon and then an ampersign. It's gonna need to be a background process. Looks like the Emacs daemon is going to ask once again to download the emoji images. I don't know why this is a problem the very first time using Emacs on DTOS. Whatever reason the daemon does not automatically start it has to do with this package that it has to install first. And it says starting Emacs daemon, but it looks like it hung a little bit there. Let's see if it actually, now it started the Emacs daemon because the way that loaded that's the Emacs clamp. So now I'm gonna navigate to in my home directory .xmonad. So you have a hidden directory in your home directory called .xmonad and in that directory is where you'll find the readme.org and the xmonad.hs. So if you use org, then the readme file is the one you wanna edit if you don't use org, xmonad.hs is the file you wanna edit. But I'm gonna use the readme. The readme file actually outputs to xmonad.hs. Let me zoom in and let me go to auto start the startup hook here. And you will see why I get the Dmenu sound all the time but the startup sound when I restart xmonad it only happens the very first time I log in. It's because in my startup hook I spawn once my sound player plus the startup sound meaning only do it the one time, right? So if I actually wanna hear the startup sound again I would actually have to quit out of xmonad here and that was the shutdown sound. I don't know if you guys heard that. There was a shutdown sound. It was very fast though you could barely hear it because it shut down so quick. There's the startup sound again and a whole bunch of stuff starts up. It really shouldn't start up here because there's still some Manjaro KDE applications that are starting up which are not a part of the normal DTOS. So that is DTOS sounds. Those of you that are running DTOS it should be available for you in the repository just do a sudo pacman dash S DTOS sound. So you know this is my physical machine. Here I'm out of the host machine. So if I do a sudo pacman dash S DTOS dash sounds assuming you have the DTOS core repository as part of your pacman.conf. Yeah, there it is. DTOS dash core dash repo slash DTOS dash sounds. That package will be available for you now. Now that you still won't hear the sounds for startup and shutdown and when you open D menu and all that unless you also installed the latest Xmonad config that has those sounds as part of the key bindings and how you would do that is you would do sudo pacman dash S DTOS dash Xmonad to get the latest config files. And those config files will be placed in a folder called slash etsy slash DTOS. Go in slash etsy slash DTOS and look for dot Xmonad. The same directory that should be in your home directory just copy all those files over to the home directory to get the latest config. I don't need that though. So I will decline that update. So a little bit of a rambly kind of random video today you guys saw me working on building this one package really for DTOS and it took a while. There were several steps that I have to go through to actually do this stuff. It's one of those things I often tell people if you see package maintainers like if you're at a Linux conference or you're just talking to people and they mentioned that they happen to be a package maintainer for whatever Linux distribution they happen to work with, give those people a hug because maintaining packages is actually a rather tedious chore. It's not hard, right? But it is time consuming and the people that do it especially the people that do it just out of the goodness of their heart they don't do it for any fortune or fame, right? They just do it for the greater good. I salute each and every one of you guys. Now before I go I need to thank a few special people. I need to thank the producers of the show. Devon Dustin Gabe, James Maxim, Matt Michael, Mitchell Paul Scott-Wess, Alan Armored Dragon, Chuck Commander, Rangry Diokai, Dylan George Lee, Lennox Ninja, Mars Drum, Mike Erion, Alexander B. Zorginvedore, Polytech Realiteats, Rolex Red Prophet, Steven, Willie, these guys. They're my highest tiered patrons over on Patreon without these guys. Today's video would not have been possible. The show is also brought to you by each and every one of these fine ladies and gentlemen. All of these names you're seeing on the screen these are all my supporters over on Patreon because I don't have any corporate sponsors. I depend on you guys. If you want to see more videos about Lennox, free and open source software, building packages, subscribe to DistroTube over on Patreon. Peace, guys.