Skip to content

Commit 861df89

Browse files
xarvexzierf
andauthored
feat(resources): provide desktop file (#870)
* feat(resources): provide desktop file Co-authored-by: Florian Zier <9168602+zierf@users.noreply.github.com> * fix(ts_qt): remove duplicate logic * fix(ts_qt): add fallback values --------- Co-authored-by: Florian Zier <9168602+zierf@users.noreply.github.com>
1 parent 0ac06a1 commit 861df89

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

nix/package/default.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ buildPythonApplication {
6464
syrupy
6565
];
6666

67+
# TODO: Install more icon resolutions when available.
68+
preInstall = ''
69+
mkdir -p $out/share/applications $out/share/icons/hicolor/512x512/apps
70+
71+
cp $src/src/tagstudio/resources/tagstudio.desktop $out/share/applications
72+
cp $src/src/tagstudio/resources/icon.png $out/share/icons/hicolor/512x512/apps/tagstudio.png
73+
'';
74+
6775
makeWrapperArgs =
6876
[ "--prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]}" ]
6977
++ lib.optional stdenv.hostPlatform.isLinux "--prefix LD_LIBRARY_PATH : ${

src/tagstudio/qt/ts_qt.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,15 @@ def start(self) -> None:
299299
appid = "cyanvoxel.tagstudio.9"
300300
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appid) # type: ignore[attr-defined,unused-ignore]
301301

302-
if sys.platform != "darwin":
303-
icon = QIcon()
304-
icon.addFile(str(self.rm.get_path("icon")))
305-
app.setWindowIcon(icon)
302+
app.setApplicationName("tagstudio")
303+
app.setApplicationDisplayName("TagStudio")
304+
if platform.system() != "Darwin":
305+
fallback_icon = QIcon()
306+
fallback_icon.addFile(str(self.rm.get_path("icon")))
307+
app.setWindowIcon(QIcon.fromTheme("tagstudio", fallback_icon))
308+
309+
if platform.system() != "Windows":
310+
app.setDesktopFileName("tagstudio")
306311

307312
# Initialize the Tag Manager panel
308313
self.tag_manager_panel = PanelModal(
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=TagStudio
4+
GenericName=Tag Management System
5+
Comment=Tag, find, and organize files
6+
Icon=tagstudio
7+
Exec=tagstudio
8+
Terminal=false
9+
Categories=AudioVideo;Qt;
10+
Keywords=files;folders;tags;

0 commit comments

Comments
 (0)