 Hello and welcome today. We're gonna be sending pop-up notifications From your shell which you can use in the shell script and I'm gonna give a basic overview because there are some differences With this depending on how you use it. So we're gonna be looking at a program called notify send and Notify send is an application that sends pop-up messages to your desktop, but actually sends it to a server Application that you have running which I'll talk about more in a moment, but let's just have a quick look at it on Many distros. This is already set up with a Damon running in the background for your notifications and send notify actually works with a lot of them It's pretty standardized So I can go like this and I can say hello world and when I hit enter It's gonna pop up a message that looks like that and it just stays there I can send another one hello world again, and it puts another one there And that's the title so when you pass it something the first argument here The first string you pass it is gonna be the title so I can call I can say here I can say title and if you pass it a second string Denoting them with quotations here in a space and I can say message And you can see it gives me a title and the message and I can click on that to get rid of it Obviously we can type more than that I can type my message This is whoops, this is My message There you go now before we go any further. I'll talk a little bit more So there's this is an application that communicates with your notification name and server application. It's running in the background or I should say service application and The one I'm using is called dunce Dunst as in like Kirsten dunce. Do you know from the spider-man movies? There's a good chance that if you're running Ubuntu or something else you have another application But send notify will interact with whatever that whatever notifications system you're using There's a few of them and it send notify should communicate with them in fairly the same way now the look and feel of your message Depends on the service that you're running for your notifications and your steps. So dunce by default is is fairly ugly And I made a few modifications. I'm not gonna get into the server end of it Basically, it was a basically like HTML that I decide how this looks. It's just a configuration file I'm not getting in the server side of it. We're only talking about notify send now You notice that timed out after a while I can tell it with the dash T option when to time out and so if I say 3000 so send notify send dash T for time out 3000 would be three seconds and then I do that and there's my message and after three seconds boom it disappears. I can do one second I can do 1000th of a second which we don't even see There we go, we can do a half a second would be 500 So if you want the message to stay up just for a few seconds or a short amount of time You can set the time out there Another option you have is to give it an icon for example I can set this I'll set this for five seconds and I can do dash dash icon Equals and I can give it an icon in this case I'll say phone and you can see it puts a little icon of a phone there And after five seconds it disappears Oh, I should also mention that if you send the same notification at least with Dunst How you set up so I can do this if I keep sending it tells you how many times that same message was sent But if I give it a different message it will Give me a new line there so that one that has an extra space there So it looks the same, but it's actually different and with Dunst again I'm not getting into the Service side of it but I have it set up that I can hit control shift and spacebar to clear them all out or Let's go to my screen here if I say let's say I say a message and I say Films by Chris as the title and then I can say HTTP calling forward slash forward slash films by Chris dot com Dunst now sees that there's a URL in there and doesn't have to just be the URL I can be a message my website Now I can actually hit control shift period and that's how I have it set up You can change the the keys for you But now brings up this little bar here with the URL and I can hit enter and it'll actually open up the URL That's in that message and if there's more than one it will do that and I have it set up I can go control shift spacebar and it clears out all the messages So if I was to have multiple messages up there I can hit control shift space and it clears them all out for me. So I don't have to click on each one So but we were talking about icons here. So here's a phone icon Let's go here and look at a few different icons So here's audio headphones so you can see there's a little picture of audio headphones there and instead of just phone I can do Smartphone and it gives a little smartphone icon there. So where are these icons coming from? well, it depends on the Application or the themes that you have installed on your machine. So if I was to find in my usr folder I'll just look for phone because I know that and I'm gonna look for I'm gonna grip for icon and I'll just do that. You can see that I have usr share Icons breeze device. So all the themes I have installed on my system are gonna have the icons under usr shared icons at least on a Debian based system And you can see the names here if I just give it the name of one of these. So here's for example I Can do audio input microphone should work. Let's hope it does so And you can see it gives a little microphone there and So I can give these so I can actually go here and I can go back to my find here and what I can do is I can say look in my usr share icons folder and That'll just list everything. I guess I'll just say name And I'll say all the SVG files Oh, yeah spell icons, right? There we go. So now I have all these so I can look through these and I should be able to grab any one of these and Although it's not my systems looking at a specific folder here that I have set up as a theme But you can give it a full URL. So if you have an SVG you want You can use it. So just for example, let's say I had this SVG and I packaged it with my script I should be able to Give the full URL path here to the SVG file boom and there is an icon a very small printer error symbol so Different icons or different sizes some will show up better than others. Here's a media shuffle playlist symbolic blah blah blah Let's go ahead and just copy that full URL and here and I will paste that in here boom and Again, it's a little shuffle icon. It's very small right there. But again, it all depends on the Icons you're using let me go back here and go through some Previous ones that I was working on. So here's some headphones But if I go back a little bit further Smartphone phone Here's some audio headphones. So this Headphones is a lot bigger than those. I think these ones look better, but these ones are more visible Because they're they're larger all depends on your theme. So let's real quick look at the man file for notify send I dash send and So you can see there's a few options in here you can set an urgency level you can also set a category type I guess whether it's an error message information message. I haven't really messed with that much myself Mainly I've we've looked at dash t for time I for icon or I did dash dash icon equals You could do either and then of course there's a little help hint here They probably give you more information of things like the category and urgency But I just want to give a quick overview of notify send and hopefully I've said that right correct every time because sometimes I'll say send notify what I'm talking about it But it's notify send and again it works with different Services and the one I'm running is called Dunst which is a very lightweight one I like it a lot if you have another one running on your system You got to kill it first or install it and then install Dunst I'm not going to go into the server side too much here I you know I talked about a little bit just to explain things But I just wanted to show you how to send a message with a title a message how to time it out and add an icon because With all these tutorials that I've been working on the last couple of weeks I'm going to start showing you scripts. I've created using these techniques So I just wanted to be able to give you an overview of that. So I do thank you for watching Please visit films by chris.com. That's Chris the K So if I was to go here and then do this My website here you can search through all my videos quickly and easily from both my channels and Also, if you have things you go to the support section if you would like to support me You can do so with PayPal or patreon patreon supporters $2 and above get downloadable all my videos and I appreciate your support And the more support I get the more videos I can make So I hope that you enjoy it. I hope you visit my website like share subscribe comment all that good stuff I hope that you have a great day