How to use mklauncher

is a command line tool, which allows you to create application launchers, with a single line. To create a launcher, you must open a terminal and start a session as administrator :

$ su -l


To know all the available options run :

# mklauncher -help

- NOTE -

Code       Description

%f            A single file.
%F           A list of files.
%u           A single URL.
%U           A list of URLs.

Examples of use

Create launcher without custom image :

# mklauncher -n "Wine config" -e "winecfg"

Create launcher with standard image :

# mklauncher -n "Wine config" -e "winecfg" -i "mk-wine.png"

Create launcher with custom image :

# mklauncher -n "Wine config" -e "winecfg" -i "/opt/icons/wine.png"

Create launcher with executable in a non-standard location :

# mklauncher -n "Firefox web browser" -e "/opt/firefox/firefox %U" -i "/opt/icons/firefox.png" -mime "web-browser:"

Create launcher with executable in a non-standard location, for the current user only :

# mklauncher -u -n "Firefox web browser" -e "/opt/firefox/firefox %U" -i "/opt/icons/firefox.png" -mime "web-browser:"

[VIDEO] "Firefox universal installation"


Launch an emulator through "wine" :

# mklauncher -n "Crude Buster" -e "wine MameUI32.exe roms/" -i "/opt/icons/rb-Crudeb.png" -p "/opt/mame32" -cat "Game" -k "wine;mame;Game;"

Launch a "Linux" emulator :

# mklauncher -n "Circle of the moon" -e "mednafen 'Circle of The'" -i "/opt/icons/circlemoon.png" -p "/opt/GameBoy" -cat "Game" -k "mednafen;GameBoy;Game;"


Launch a "Java" application :

# mklauncher -n "JEditor" -e "java -jar JEditor.jar" -i "/opt/icons/JEditor.png" -p "/opt/JavaApps" -cat "Development" -k "Editor;Java;Development;"

Automatic launcher

Create a "Java" automatic launcher, see option "-mime" :

# mklauncher -n "Java launcher" -e "java -jar %f" -i "mk-java.png" -p "/opt/JavaApps" -cat "Development" -k "Java;Launcher;Development;" -mime "application/java-archive;application/x-java-archive"

Select an application "Java .jar", press "right click", and choose "Run with Java launcher". Automatic launchers for other file types can be created.


Open folder by means of "xdg-utils" package :

# mklauncher -n "Global launchers" -e "xdg-open '/usr/share/applications'" -i "mk-folder.png" -cat "System" -k "Global;Launcher;"

"xdg-open" Open a folder using the default file manager. This option requires that the "xdg-utils" package be installed.

Open folder directly :

# mklauncher -n "Global launchers" -e "nautilus /usr/share/applications" -i "mk-folder.png" -cat "System" -k "Global;Launcher;"

# mklauncher -n "Global launchers" -e "dolphin /usr/share/applications" -i "mk-folder.png" -cat "System" -k "Global;Launcher;"

# mklauncher -n "Global launchers" -e "thunar /usr/share/applications" -i "mk-folder.png" -cat "System" -k "Global;Launcher;"


Open file by means of "xdg-utils" package :

# mklauncher -n "Debian GNU Linux" -e "xdg-open '/opt/books/Debian manual.pdf'" -i "mk-PDF.png" -cat "Education" -k "Linux;manual;"

"xdg-open" Open a file using the application appropriate for the file type. This option requires that the "xdg-utils" package be installed.

Open PDF file directly :

# mklauncher -n "Debian GNU Linux" -e "evince '/opt/books/Debian manual.pdf'" -i "mk-PDF.png" -cat "Education" -k "Linux;manual;"

# mklauncher -n "Debian GNU Linux" -e "atril '/opt/books/Debian manual.pdf'" -i "mk-PDF.png" -cat "Education" -k "Linux;manual;"

Create a simple symbolic link, on the desktop :

# mklauncher -link "/opt/books/Debian manual.pdf"


Open website by means of "xdg-utils" package :

# mklauncher -n "GNU Linux OS" -e "xdg-open" -i "mk-internet.png" -cat "Network"

Using the option "-url" :

# mklauncher -n "GNU Linux OS" -url "" -i "mk-internet.png" -cat "Network"

Some desktops only allow launchers of websites created with the "-url" option in the Desktop folder.

Open web site directly :

# mklauncher -n "GNU Linux OS" -e "firefox" -i "mk-internet.png" -cat "Network"

Launch how root


Run by means of terminal :

# mklauncher -n "Gedit(root)" -e "su -c 'gedit'" -i "mk-text.png" -terminal -cat "Utility" -k "Gedit;root;"

Run by means of "gksu" :

# mklauncher -n "Gedit(root)" -e "gksu gedit" -i "mk-text.png" -cat "Utility" -k "Gedit;root;"

This option requires that the "gksu" package be installed.

WAYLAND and administrative privileges

To create a launcher that runs applications with administrative privileges, you need to use "xhost" (server access control program for X), and a script as follows :

1)Create a "sh" script, with the following name :

    "Application name" + ""

Example :

The content of this script should be :

xhost +si:localuser:root
gksu synaptic
xhost -si:localuser:root

2)Grant execution permissions to the script :

$ su -l
# chmod +x

3)Copy the script to a standard location, example :

# cp /usr/local/bin

4)Create a launcher with "mklauncher" :

# mklauncher -n "Synaptic package manager" -e "" -i "mk-package.png" -cat "System" -k "Synaptic;package;manager;"

This option requires that the "gksu" package be installed.

Remove launcher

# mklauncher -r "Firefox web browser"

Remove launcher for current user only :

# mklauncher -u -r "Firefox web browser"

- NOTE -

The "-r" option can only erase launchers that were previously created with "mklauncher". To erase launchers that were not created with "mklauncher", it is necessary to write the real name of the file ".desktop". You can use the file manager to copy and paste the names of the ".desktop" files.

# mklauncher -r 'start_smb'

Remove launcher for current user only :

# mklauncher -u -r 'start_smb'

It is also possible to eliminate the launchers directly :

# rm '/usr/share/applications/start_smb.desktop'

# rm '/home/[Current user]/.local/share/applications/start_smb.desktop'

Fix desktop

If is not possible to detect the path of the desktop, use "-fix-desktop" to correct this problem. Example :

# mklauncher -fix-desktop "/home/[user]/darbastalis"

# mklauncher -fix-desktop "/home/[user]/Scriptorio"

# mklauncher -fix-desktop "/home/[user]/Namizje"


"mklauncher" includes the following standard icons, which can be used with the parameter "-i":

mk-app.png         mk-script.png             mk-wine.png       mk-java.png
mk-game.png       mk-link.png               mk-folder.png      mk-remote.png
mk-group.png       mk-file.png                mk-text.png         mk-image.png
mk-html.png          mk-audio.png           mk-video.png      mk-package.png
mk-photo.png        mk-media.png          mk-print.png        mk-optical.png
mk-pendrive.png   mk-server.png          mk-pc.png           mk-script2.png
mk-PDF.png          mk-game2.png         mk-game3.png    mk-game4.png
mk-python.png      mk-ruby.png             mk-php.png         mk-js.png
mk-graphics.png   mk-freepascal.png   mk-hint.png         mk-internet.png

Combinations of mime types

web-browser:    video-editor:       python-editor:      js-editor:
text-editor:         design-editor:     c-editor:               java-editor:
image-editor:     audio-editor:       c++-editor:           perl-editor:
pdf-editor:          script-editor:       pascal-editor:  
mail-editor:        ruby-editor:         php-editor:

It is possible to use several combinations at the same time, example :

    -mime "text-editor:c-editor:c++-editor:"

    -mime "php-editor:image/png;image/jpeg;"

To view the details of a specific combination, execute "mklauncher" with the name of the desired type combination, such as :

# mklauncher -mime "web-browser:"
# mklauncher -mime "text-editor:"

To see all the type combinations in detail, run the command :

# mklauncher -mime "predefined-list"

To create a text file, run the command :

# mklauncher -mime "predefined-list" > "predefined-list.txt"

The text file "predefined-list.txt" contains detailed information on each combination of mime types.

How to create an ".png" icon

To create a custom icon, you must follow the following procedure :

1)Take a screenshot that contains the desired image.

2)Open the captured image with an image editor, for example "Gimp".

3)Copy an area of 256x256 px, and save how a new "Namefile.png" file.

4)Use the "iconrb" command to create a new file with rounded edges :

    $ iconrb "Namefile.png"

5)Place this file in an accessible location, example :


6)Use the new PNG icon to create a launcher :

    # mklauncher -n "My app" -e "my_app" -i "/opt/icons/rb-Namefile.png"

Do you have questions?

You can ask any question about "mklauncher", simply you must open a new "Support Request Ticket".

<< Open a new Ticket >>