Skip to content

Instantly share code, notes, and snippets.

@lduboeuf
Last active November 2, 2022 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lduboeuf/0da84c38469dcf5b77259c0b6d8ee09d to your computer and use it in GitHub Desktop.
Save lduboeuf/0da84c38469dcf5b77259c0b6d8ee09d to your computer and use it in GitHub Desktop.
to get:
dbus-send --session --print-reply \
--dest=com.canonical.Unity.Launcher \
/com/canonical/Unity/Launcher/dialer_2Dapp \
org.freedesktop.DBus.Properties.Get \
string:com.canonical.Unity.Launcher.Item \
string:'count'
to set:
//set emblem count , need to set countVisible to true
dbus-send --session --print-reply \
--dest=com.canonical.Unity.Launcher \
/com/canonical/Unity/Launcher/messaging_2Dapp \
org.freedesktop.DBus.Properties.Set \
string:com.canonical.Unity.Launcher.Item \
string:count \
variant:int32:2
dbus-send --session --print-reply \
--dest=com.canonical.Unity.Launcher \
/com/canonical/Unity/Launcher/messaging_2Dapp \
org.freedesktop.DBus.Properties.Set \
string:com.canonical.Unity.Launcher.Item \
string:countVisible \
variant:boolean:true
qdbus com.canonical.Unity.Launcher /com/canonical/Unity/Launcher/$1 org.freedesktop.DBus.Properties.Set com.canonical.Unity.Launcher.Item countVisible $2
QDBusInterface emblemCounter( "com.canonical.Unity.Launcher", "/com/canonical/Unity/Launcher/messaging_2Dapp",
"com.canonical.Unity.Launcher.Item");
emblemCounter.setProperty("count", unreadCount);
emblemCounter.setProperty("countVisible", unreadCount > 0);
//emblemCounter.call(QLatin1String("countVisible"), true);
QVariant vCount = emblemCounter.property("count");
qDebug() << "emblem count:" << vCount.toInt();
@lduboeuf
Copy link
Author

lduboeuf commented Nov 2, 2022

For focal:

dbus-send --session --print-reply
--dest=com.lomiri.Shell.Launcher
/com/lomiri/Shell/Launcher/dialer_2Dapp
org.freedesktop.DBus.Properties.Get
string:com.lomiri.Shell.Launcher.Item
string:'count'

dbus-send --session --print-reply
--dest=com.lomiri.Shell.Launcher
/com/lomiri/Shell/Launcher/dialer_2Dapp
org.freedesktop.DBus.Properties.Set
string:com.lomiri.Shell.Launcher.Item
string:count
variant:int32:2

dbus-send --session --print-reply
--dest=com.lomiri.Shell.Launcher
/com/lomiri/Shell/Launcher/dialer_2Dapp
org.freedesktop.DBus.Properties.Set
string:com.lomiri.Shell.Launcher.Item
string:countVisible
variant:boolean:true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment