bokumin.org

Github

Install executable file on Ubuntu or Debian panel (Gnome)

This article is a translation of the following my article:

 

 

* Translated automatically by Google.
* Please note that some links or referenced content in this article may be in Japanese.
* Comments in the code are basically in Japanese.

 

by bokumin

 

How to installing custom executables in Ubuntu/Debian Panel

 

 

Introduction

 

When you want to display an executable file that you have created or a package that you have built yourself because you cannot find it for some reason and want to display it in a panel.
Basically, you can use this command.

 

sudo desktop-file-install ファイル名  

 

However, this often does not work (or rather, in my case, it has never worked)
I would like to write a method to display the app in a panel format in such cases.

 

 

Create the .desktop file

 

In order to display an app on the Linux desktop, you need to create a desktop entry file (with the extension .desktop).

 

If you want only that user to see it, save it in “~/.local/share/applications
If you want it to be visible to the entire system (all users), save it in “/usr/share/applications”
. There is no problem as both are recognized by current major desktop environments (Gnome, KDE, Xfce, etc.).
This time, we will proceed with the entire system.

 

sudo nano /usr/share/applications/your-package-name.desktop #どのアプリ・パッケージかわかりやすいような名前にする
[Desktop Entry]
Version=1.0 #バージョン
Type=Application 
Name=Your App Name #アプリ・パッケージ名
Comment=this is apple #アプリの説明
Exec="/home/user/hoge/hoge-hoge" #アプリの実行ファイル
Icon=/home/user/hoge/image/icon.png #アイコン
Terminal=false #ターミナルで起動するかどうか
Categories=hoge; #カテゴリー

 

My Debian is Arm64, and I downloaded Tor-browser and used it forcibly, and I will post the .desktop file I created at that time as an example.

 

[Desktop Entry]
Name=Tor Browser
Exec=/bin/bash -c 'cd /home/bokumin/tor-browser;./start-tor-browser.desktop --d\
etach'
Icon=/home/bokumin/tor-browser/Browser/browser/chrome/icons/default/default128.\
png
Type=Application
Categories=Network;WebBrowser;

 

“bin/bash -c” written in Exec executes the command specified in bash, and I think Tor-browser would not work without it. “–detach” means it will run in the background.
In other words, this Tor-browser is not just an entry file, but a startup script that requires checking environment variables and dependencies, and proper paths for it to work.

 

If you follow the steps above, you will be able to display apps that cannot be added to the panel.

End