Skip to content

feat(resources): provide desktop file #870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 18, 2025
Merged

feat(resources): provide desktop file #870

merged 3 commits into from
Mar 18, 2025

Conversation

xarvex
Copy link
Member

@xarvex xarvex commented Mar 16, 2025

Summary

Provides a desktop file, and exposes it and the relevant icon for the Nix package.

Fixes: #415
Fixes: #422
Fixes: #847

Note that I cannot test pinning functionality as I do not use a desktop environment. Would appreciate help with testing that. Otherwise, I will create a virtual machine.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86 (NixOS)
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable
    • Nix package building

@zierf
Copy link
Contributor

zierf commented Mar 16, 2025

Looks pretty good. I would say it now works as intended.

My system provides a KDE Wayland session.

nixpkgs: github:NixOS/nixpkgs/c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5?narHash=sha256-C7jVfohcGzdZRF6DO%2BybyG/sqpo1h6bZi9T56sxLy%2Bk%3D (2025-03-15 20:13:08)
$> nix-shell -p nix-info --run "nix-info -m"

 - system: `"x86_64-linux"`
 - host os: `Linux 6.13.6-xanmod1, NixOS, 25.05 (Warbler), 25.05.20250315.c80f6a7`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.12`
 - nixpkgs: `/nix/store/alzxn3hjisc84hrlv44x6hni48crww26-source`

I've temporarily switched my system flake's input to the commit in this PR.

tagstudio = {
  url = "github:TagStudioDev/TagStudio/77a1ac0d18b1ae9ffa8629f2cf92e352466bf941";
  inputs.nixpkgs.follows = "nixpkgs";
};

After that, I have a suitable entry in my Application Launcher.
Launcher

The AppMenu/GlobalMenu is still there and now has the appropriate icon and application title.
Global Menu

I was also able to pin the window to my dock (just a floating KDE bar using built-in functionality).
PinWindow Open
(Application open)

PinWindow Closed
(Application closed and still pinned)


If I don't install TagStudio via my system flake and run it directly from GitHub, it no longer has an icon or title (almost to be expected).

nix run github:TagStudioDev/TagStudio/77a1ac0d18b1ae9ffa8629f2cf92e352466bf941#tagstudio-jxl

AppMenu, run from GitHub

Dock, run from GitHub

I think this should be sufficient for a quick test for new users. I don't know if it would even be possible to create a desktop file when running directly, since the application isn't installed on the system.

@xarvex
Copy link
Member Author

xarvex commented Mar 16, 2025

I initially thought about prefixing XDG_DATA_DIRS to provide the desktop file and icon in that way, however that would mean stripping the user's ability to customize. I went ahead and provided default values instead for the application name and icon.

This won't address things like pinning, as there is no desktop entry, but that makes sense to me when the application is not installed.

@zierf zierf mentioned this pull request Mar 16, 2025
3 tasks
@CyanVoxel CyanVoxel added Type: Bug Something isn't working as intended Type: QoL A quality of life (QoL) enhancement or suggestion Priority: Medium An issue that shouldn't be be saved for last System: Linux For Linux/BSD distributions labels Mar 17, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5.2 milestone Mar 17, 2025
@xarvex xarvex added the Type: Installation Installing, building, and/or launching the program label Mar 17, 2025
@CyanVoxel CyanVoxel added the Status: Mergeable The code is ready to be merged label Mar 17, 2025
@CyanVoxel CyanVoxel merged commit 861df89 into main Mar 18, 2025
10 checks passed
@CyanVoxel CyanVoxel deleted the desktop-file branch March 18, 2025 01:35
@CyanVoxel CyanVoxel removed the Status: Mergeable The code is ready to be merged label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium An issue that shouldn't be be saved for last System: Linux For Linux/BSD distributions Type: Bug Something isn't working as intended Type: Installation Installing, building, and/or launching the program Type: QoL A quality of life (QoL) enhancement or suggestion
Projects
None yet
3 participants