DioxusLabs / DioxusLabs/dioxus

Can't change name of Dioxus application

Open
#5,198 7 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

## Feature Request

I've been looking for a way to change the name of my application (not the title of the window), which is displayed in app listings, system trays, etc.

## The Problem
As I understand it, cargo currently just takes the name of the package in Cargo.toml, e.g. subnet-calculator, and translates the name of the application to "SubnetCalculator" with no space. This is then used in .desktop file on linux.

This is how it looks:
Image

I confirmed this by setting the name of the package in Cargo.toml to:

```[package]
name = "subnet-calculatorsss"
```

And I get:
Image

## Debugging
Attempting to set the `name` variable in Dioxus.toml with something like:

```
[application]
name = "Subnet Calculator"
```
or

```
[bundle]
name = "Subnet Calculator"
```

Doesn't work or even do anything.

I then attempted to add my own .desktop, with something like: (in Dioxus.toml)

```
[bundle.linux]
resources = ["assets/SubnetCalculator.desktop"]
```

And the content:
```
[Desktop Entry]
Type=Application
Name=Subnet Calculator
Comment=IPv4/IPv6 subnet calculator and network tools
Exec=subnet-calculator
Icon=subnet-calculator
Terminal=false
Categories=Utility;Network;
StartupWMClass=subnet-calculator
```

And re-bundling I see that the file doesn't replace the .desktop file in `share/` instead it is placed in `lib/`. Which is a lower priority and doesn't get used to bundle the final .deb file:

Image

## Workaround

The current workaround is going into the `target` directory and manually editing the file in `data/usr/share/applications/SubnetCalculator.desktop` and changing the name or add other attributes.

And then rebuilding the .deb with `dpkg-deb --build data/`:
Image

### Implement Suggestion

Grant us the ability to control the name of the application via the Dioxus.toml file.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.