added desktop file

This commit is contained in:
rdavidek 2026-01-17 11:13:45 +01:00
parent fe546f6368
commit cfac7e28ab
3 changed files with 29 additions and 0 deletions

11
kf-manager.desktop Executable file
View File

@ -0,0 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=java -jar /home/kamma/projects/kf-manager/target/kf-manager-1.0-SNAPSHOT-jar-with-dependencies.jar
Name=KF File Manager
Icon=/home/kamma/projects/kf-manager/src/main/resources/icon.png
StartupWMClass=cz-kamma-kfmanager-MainApp
Comment=Dvoupanelový souborový manažer pro Linux
Categories=Utility;System;

View File

@ -12,6 +12,9 @@ public class MainApp {
public static final String APP_VERSION = "0.0.4";
public static void main(String[] args) {
// Set application name for X11/Wayland WM_CLASS
System.setProperty("awt.app.name", "cz-kamma-kfmanager-MainApp");
// Set look and feel to system default
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

View File

@ -31,6 +31,9 @@ public class MainWindow extends JFrame {
public MainWindow() {
super("KF Manager v" + MainApp.APP_VERSION);
// Set application icon
loadAppIcon();
// Load configuration
config = new AppConfig();
@ -58,6 +61,18 @@ public class MainWindow extends JFrame {
});
}
private void loadAppIcon() {
try {
java.net.URL iconURL = MainWindow.class.getResource("/icon.png");
if (iconURL != null) {
ImageIcon img = new ImageIcon(iconURL);
setIconImage(img.getImage());
}
} catch (Exception e) {
System.err.println("Could not load icon: " + e.getMessage());
}
}
private void initComponents() {
setLayout(new BorderLayout());