In this post I show you a simple way to add preference persistence to your Cinnamon or GNOME Shell extension using JSON.
|
||
In this post I show you a simple way to add preference persistence to your Cinnamon or GNOME Shell extension using JSON. In this post, I demonstrate how you can add D-Bus support to a GNOME Shell or Cinnamon extension and allow a command line utility to control the operating characteristics of the extension via a command line utility. This post discusses the D-Bus interface to the GNOME Shell and Cinnamon and shows you how a simple command line tool called cinnamon-tool can be used to enable or disable Cinnamon extensions via D-Bus. The documentation on retrieving or setting an D-Bus object’s properties using Python is pityful and mostly inaccurate. Recently GDBus has replaced dbus-glib as the preferred way to interface with D-Bus on GNOME platforms. The central concepts of D-Bus are modelled in a very similar way in dbus-glib and GDBus. Both have objects representing connections, proxies and method invocations. However there are some important differences: dbus-glib uses the D-Bus libdbus reference implementation, GDBus does not. Instead, it relies on GIO streams as transport layer, and has its own implementation for the the D-Bus connection setup and authentication. dbus-glib uses the GObject This question is often asked in the various Unix and Linux forums. For example, suppose you want to create a string of 50 asterisks other than str=”***********************************” Here are some of the ways I have come across over the years. perl -e ‘print “*”x50’ ruby -e ‘puts “*”*50’ awk ‘BEGIN { while (a++<50) s=s “x”; print s }’ printf ‘%*s’ “50” ‘ ‘ | tr ‘ ‘ “*” echo “*****” | sed ‘s/.*/&&&&&&&&&&/’ The following works for gawk but not oawk. echo | awk NF=51 OFS=* |
||
Copyright © 2007-2024 Finnbarr P. Murphy. All Rights Reserved |