Skip to content
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

Add "Create Desktop Entry" Selector box #1510

Open
groovy-boiler opened this issue Dec 18, 2024 · 0 comments
Open

Add "Create Desktop Entry" Selector box #1510

groovy-boiler opened this issue Dec 18, 2024 · 0 comments

Comments

@groovy-boiler
Copy link

Description:
I would like to propose the addition of a clickable setting box in the Firo-Qt wallet that allows users to easily create a desktop entry for the application. This feature would enhance user experience by providing a straightforward way to add the wallet to the desktop environment, making it more accessible.

Proposed Implementation:

  • Add a checkbox in the settings menu labeled "Create Desktop Entry".

  • When checked, the application should:
    1. Create a .desktop file at ~/.local/share/applications/firo-qt.desktop with the following content:

    [Desktop Entry]
    Comment=Firo-Qt Full Node Wallet 
    Exec=path to location of this extracted folder/firo-qt
    Icon=~/.local/share/icons/hicolor/scalable/apps/firo-qt.svg
    Name[en_US]=Firo-Qt Wallet
    Name=Firo-Qt
    Categories=Finance;Network;
    StartupNotify=true
    Terminal=false
    Type=Application
    

    2. Install the Icon: Copy the firo.svg icon from the binary to ~/.local/share/icons/hicolor/scalable/apps/firo-qt.svg.

  • If the user unchecks the box, the application should remove the existing
    desktop entry if it was created previously from selecting it.

Benefits:

  • Simplifies the process for users who may not be familiar with manually creating .desktop files.
  • Increases the visibility and accessibility of the Firo-Qt wallet on the user's desktop environment.
  • This would not require root permissions since it would be in the home folder.
  • This also would be flexible for Tails users, allowing them to copy the ~/.local/share/applications/firo-qt.desktop and the ~/.local/share/icons/hicolor/scalable/apps/firo-qt.svg to their dotfiles folder.

Additional Notes:

  • This feature could be particularly beneficial for new users who may not know how to create a desktop entry manually.
  • Would benefit all users of the linux releases and make starting Firo-Qt wallet more convenient
  • It would be great to have a confirmation dialog to inform users that the desktop entry has been created or removed.

Disclaimer:
I'm not sure how exactly this could be implemented for the windows release but maybe something like the Windows Shell API to create the shortcut launcher:

#include <windows.h>
#include <shobjidl.h> 

void CreateShortcut(const std::wstring& shortcutPath, const std::wstring& targetPath, const std::wstring& iconPath) {
    CoInitialize(nullptr);
    IShellLink* pShellLink = nullptr;
    HRESULT hres = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&pShellLink);

    if (SUCCEEDED(hres)) {
        IPersistFile* pPersistFile = nullptr;
        pShellLink->SetPath(targetPath.c_str());
        pShellLink->SetIconLocation(iconPath.c_str(), 0);
        
        hres = pShellLink->QueryInterface(IID_IPersistFile, (LPVOID*)&pPersistFile);
        if (SUCCEEDED(hres)) {
            pPersistFile->Save(shortcutPath.c_str(), TRUE);
            pPersistFile->Release();
        }
        pShellLink->Release();
    }
    CoUninitialize();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant