Desktop Entry
Desktop Entry Specification
Both the KDE and GNOME desktop environments have adopted a similar format for "desktop entries", or configuration files describing how a particular program is to be launched, how it appears in menus, etc. It is to the larger community's benefit that a unified standard be agreed upon by all parties such that interoperation between the two environments, and indeed any additional environments that implement the specification, becomes simpler.
Directory
데스크톱 어플리케이션은 아래 경로에 설치된다.
- Current user:
~/.local/share/applications/
- All user:
/usr/share/applications
Sample
파일의 기본 템플릿은 아래와 같은 형식이다.
[Desktop Entry]
Name=FooCorp Painter Pro
Exec=foocorp-painter-pro
Icon=foocorp-painter-pro
Type=Application
Categories=GTK;GNOME;Utility;
Ubuntu 14.04의 경우 ~/.local/share/applications/*.desktop
경로에 존재한다. (전역 Application의 경우 /usr/share/applications/*.desktop
에 위치한다)
[Desktop Entry]
Version=1.0
Type=Application
Name=CLion
Icon=/home/username/Applications/clion-2016.3.2/bin/clion.svg
Exec="/home/username/Applications/clion-2016.3.2/bin/clion.sh" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-clion
그 밖의 샘플 참조
- Gimp#GNOME Desktop Icon
- Godot#GNOME Desktop Icon
- Android Studio#GNOME Desktop Icon
- VLC media player#GNOME Desktop Icon
- VirtualBox#GNOME Desktop Icon
설치 및 DB 업데이트
이미 만들어진 desktop 파일이 있다면 다음 명열으로 추가할 수 있다. (수동으로 추가해도 상관 없다)
다음 명령으로 갱신한다.
로컬 디렉토리가 있을 경우:
Spec info
- TryExec
- What is the TryExec field in .desktop files? - Unix & Linux Stack Exchange
- Path to an executable file on disk used to determine if the program is actually installed. If the path is not an absolute path, the file is looked up in the $PATH environment variable. If the file is not present or if it is not executable, the entry may be ignored (not be used in menus, for example).
- A
.desktop
file with a non-empty TryExec field MUST NOT be autostarted if the value of the TryExec key does NOT match with an installed executable program. - 지정된 실행 파일이 실제로 시스템에 존재하는지 확인합니다. 만약 파일이 존재하지 않는다면, 해당
.desktop
항목은 사용자의 애플리케이션 메뉴에 표시되지 않거나 비활성화됩니다.
- Version
- Desktop Entry Specification의 버전. 숏컷을 만들려고 하는 소프트웨어의 버전이 아니다! 이 페이지를 확인할 경우
1.5
로 입력해야 한다. 반드시 필요한 필드는 아니다.
- Categories
- 애플리케이션이 사용자 메뉴에서 어떤 카테고리에 속할지를 결정하는 데 사용됩니다.
- Path
- Working Directory
- X-LXQt-Need-Tray
- LXQt 데스크탑 환경에서 사용하는 비표준(커스텀) 키로, 특정 애플리케이션이 시스템 트레이(알림 영역)에 아이콘을 필요로 하는지 여부를 나타냅니다.
- X-GNOME-AutoRestart
-
true
일 경우 자동시작한다 ??
- X-GNOME-Autostart-Phase=Initialization
-
Initialization
- ??
- StartupNotify
- 애플리케이션이 시작될 때 데스크탑 환경이 사용자에게 시각적 피드백(예: 스플래시 화면, 진행 표시기)을 제공해야 하는지를 정의합니다.
-
true
일 경우 애플리케이션이 시작될 때 시각적 피드백(예: 마우스 커서에 회전 애니메이션 등)을 제공하도록 합니다.
- StartupWMClass
- 데스크탑 환경이 실행 중인 애플리케이션의 창을 식별할 때 사용하는 창 클래스(Window Manager Class)를 지정합니다. 이것은 데스크탑 환경이 애플리케이션의 창과
.desktop
파일을 올바르게 매핑하는 데 도움을 줍니다. - 값은 애플리케이션의 창 클래스 이름(일반적으로 애플리케이션의 X11 의 WM_CLASS 속성)
- NoDisplay
- ??
- Hidden
- ??
Categories
주요 카테고리 (Main Categories)
- AudioVideo: 오디오/비디오 애플리케이션 (예: 미디어 플레이어, 비디오 편집기)
- Audio: 오디오 전용 애플리케이션 (예: 오디오 플레이어, 오디오 편집기)
- Video: 비디오 전용 애플리케이션 (예: 비디오 플레이어, 비디오 편집기)
- Development: 개발 도구 (예: IDE, 텍스트 편집기)
- Education: 교육 애플리케이션 (예: 플래시 카드 프로그램, 언어 학습 프로그램)
- Game: 게임 애플리케이션
- Graphics: 그래픽스 애플리케이션 (예: 이미지 뷰어, 사진 편집기)
- Network: 네트워크 관련 애플리케이션 (예: 웹 브라우저, 원격 데스크탑 프로그램)
- Office: 사무 애플리케이션 (예: 워드 프로세서, 스프레드시트)
- Science: 과학 관련 애플리케이션 (예: 계산기, 시뮬레이션 소프트웨어)
- Settings: 설정 애플리케이션 (예: 시스템 설정, 구성 도구)
- System: 시스템 관련 애플리케이션 (예: 터미널, 파일 관리자)
- Utility: 유틸리티 애플리케이션 (예: 텍스트 편집기, 메모장)
- HardwareSettings: 하드웨어 관련 설정 (예: 프린터 설정, 디스플레이 설정)
- Personal: 개인 애플리케이션 (예: 캘린더, 개인 정보 관리기)
보조 카테고리 (Additional Categories)
- Building: 빌드 도구 (예: 빌드 시스템, 컴파일러)
- Debugger: 디버거
- GUIDesigner: GUI 디자이너
- Profiling: 프로파일링 도구
- RevisionControl: 버전 관리 도구
- Translation: 번역 도구
- Calendar: 캘린더 애플리케이션
- ContactManagement: 연락처 관리 애플리케이션
- Database: 데이터베이스 관리 애플리케이션
- Dictionary: 사전 애플리케이션
- Chart: 차트 애플리케이션
- Email: 이메일 애플리케이션
- Feed: 피드 리더 애플리케이션
- FileTransfer: 파일 전송 애플리케이션
- HamRadio: 아마추어 무선 애플리케이션
- IRCClient: IRC 클라이언트
- InstantMessaging: 인스턴트 메시징 애플리케이션
- News: 뉴스 리더 애플리케이션
- P2P: P2P 애플리케이션
- RemoteAccess: 원격 액세스 애플리케이션
- Telephony: 전화 애플리케이션
- WebBrowser: 웹 브라우저 애플리케이션
- TextEditor: 텍스트 편집기
- WordProcessor: 워드 프로세서
- Application: 기타 애플리케이션
- Applet: 애플릿
- Shell: 셸 애플리케이션
- Accessibility: 접근성 도구
- Calculator: 계산기 애플리케이션
- Clock: 시계 애플리케이션
- TextTools: 텍스트 도구 애플리케이션
- FileManager: 파일 관리 애플리케이션
- TerminalEmulator: 터미널 에뮬레이터
- Archiving: 압축 도구
- Compression: 압축 도구
- Filesystems: 파일 시스템 도구
- Monitor: 모니터링 도구
- Security: 보안 도구
- Accessibility: 접근성 도구
Variables
- .desktop - How to change working directory when open a file with double clicking on ubuntu desktop? - Ask Ubuntu
-
%f
a single filename. -
%F
multiple filenames. -
%u
a single URL. -
%U
multiple URLs. -
%d
a single directory. Used in conjunction with %f to locate a file. -
%D
multiple directories. Used in conjunction with %F to locate files. -
%n
a single filename without a path. -
%N
multiple filenames without paths. -
%k
a URI or local filename of the location of the desktop file. -
%v
the name of the Device entry.
Autostart Spec info
저장 폴더:
-
/etc/xdg/autostart
-
~/.config/autostart/
gnome에서 GUI 로 등록하기 위한 프로그램은 gnome-session-properties 이다.
그놈 쉘 터미널에서 실행시키기
직접 터미널 에뮬레이터를 실행시키므로 Terminal=false
로 해야 별개의 터미널이 실행되지 않는다. 대충 다음과 같이 사용하면 된다:
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=AnswerML2
Exec=/usr/bin/gnome-terminal --tab -e "/home/hogonets/bin/answer-ml2.sh"
Icon=/usr/bin/share/icon.svg
Categories=Utility;