added desktop file
This commit is contained in:
parent
fe546f6368
commit
cfac7e28ab
11
kf-manager.desktop
Executable file
11
kf-manager.desktop
Executable 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;
|
||||
@ -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());
|
||||
|
||||
@ -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());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user