How to create a custom xfce panel launcher on Debian 11

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to create a custom launcher, or you can call it a button because that's what we are going to use it as. Custom buttons are useful when you need custom tasks done, instead of adding only the standard button that are offered by the os, you can create a custom button which does whatever task you need done.

For example, a button that will check for updates on your Debian 11, instead of typing the update command manually, we can create a button that will check for updates automatically.

Let's begin, and create a custom button on the xfce panel that once clicked, the terminal will update our system.

1) Launch panel preferences

Hover over the panel where you want to add the custom button, right click on it, and go to Panel and click Panel Preferences, this will open the panel preferences window as shown below

2) Select panel

If you have multiple panels on your desktop, select the panel that you want to add the button on, then click to Items. Items window is the window where we are going to add the custom launcher.

3) Create custom launcher

Now on the Items window, you need to click the +Add button, next locate launcher on the items list, select it and click the add button. And you should see the panel launcher added on your panel.

Next we need to add the function to this button, double click into the launcher that got created as shown in the image below

Next add an empy item by clicking the + button at the right column.

Next, you should see this window (launcher -name-command). In this window you need to set the name

Name - Name of the button

Comment - Comment is optional

Command - Command that button will run when you click it

Working directory - The working directory of the button. This is useful when you add a button that does more than just an update, for example you could add a button that runs a python script that needs other files to be executed.

Icon - Set an icon if you want

Use startup notification - This works only if you are doing something with the file manager or menu.

Run in terminal - Check this if the command that you are running needs to be executed in a terminal. In our case we are running sudo apt update so yes we need to check this option

5) Adjust button position

By default the launcher will be added at the end of your panel. However, you can change its location by using the move function on the button. To do this, right click over the launcher and click Move, then simply drag the launcher to your favorite location on the panel.

4) Test button

Now, it's time to test your button, to see if everything works as it should.

Depending the function of the button, if you checked the option "Run in terminal" the terminal will pop up briefly when you click the button, you can uncheck this if you don't want to see the terminal when you click the custom launcher, however this depends on its function. For example, our button runs sudo apt update, terminal needs sudo access in order to perform the update, so the terminal cannot be hidden in this case, as that would leave the terminal on the password prompt window.

How to remove Launcher

If you want to remove the launcher from the panel, right click over the launcher and click the remove button. You can also remove it from the panel preferences window, select the launcher on the items list, then click remove.

Conclusion

In this tutorial you learned how to create a custom launcher on xfce panel that runs a specific task when launched. Custom launchers are very useful when it comes to boosting your productivity and improving workflow.