From 2b2bf8de970f50ae5ab866bbef5deb07e388b9f0 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 24 Oct 2018 01:29:05 +0200 Subject: [PATCH] Added information regarding how to create custom actions on a launcher --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index 8c2f302..6123691 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,39 @@ Notes: - Linux/Unix: If you want to run this library as a different user, you will need to launch your application via `sudo su username /bin/sh -c "DBUS_SESSION_BUS_ADDRESS='unix:abstract=/tmp/dbus-cLtEoBPmgC' XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP program-name"`, where `unix:abstract=/tmp/dbus-cLtEoBPmgC` from `/run/user/{uid}/dbus-session`. You will also want to disable the root check + warnings via `SystemTray.ENABLE_ROOT_CHECK=false;` See [issue](https://github.com/dorkbox/SystemTray/issues/63) for more details. + - Linux/Unix: If you want to create a custom menu for the LAUNCHER icon, you must create a custom `.desktop` shortcut in order to create `Actions`. Credit to [@tresf ](https://github.com/dorkbox/SystemTray/issues/71#issuecomment-378345423) for figuring this out. + + For example: + + steam launcher screen shot + + ```ini + [Desktop Entry] + Name=Steam + Comment=Application for managing and playing games on Steam + Exec=/usr/bin/steam %U + Icon=steam + Terminal=false + Type=Application + Categories=Network;FileTransfer;Game; + MimeType=x-scheme-handler/steam; + Actions=Store;Community;Library;Servers;Screenshots;News;Settings;BigPicture;Friends; + ``` + + And then the executable path and language translations are as follows: + ```ini + [Desktop Action Store] + Name=Store + Name[de]=Shop + Name[es]=Tienda + Name[fr]=Magasin + Name[it]=Negozio + Name[pt]=Loja + Name[ru]=Магазин + Name[zh_CN]=商店 + Name[zh_TW]=商店 + Exec=steam steam://store + ```