gnome-shell-extensions

How to colorize the output of Python errors in the Gnome terminal?

隐身守侯 提交于 2021-02-18 00:53:21
问题 Note: I am asking this question after researching how to actually do it. Other questions which are somewhat similar, but actually differ from my question relate to: Color-coding within the python script Importing color libraries within the script Using tools like Solarized to improve tools like Vim to color-code python code. What I am looking for: I already have a simple python script (say, test.py) and I am executing it from the Gnome terminal. python test.py test.py will output some errors

How can my GNOME Shell extension detect the GNOME version?

眉间皱痕 提交于 2020-08-07 05:45:59
问题 I'd like to support multiple GNOME versions with my shell extension. How can I detect the GNOME version it's running on and branch the code appropriately? 回答1: const Config = imports.misc.config; if (Config.PACKAGE_VERSION.startsWith("3.42")) // etc. 来源: https://stackoverflow.com/questions/34120963/how-can-my-gnome-shell-extension-detect-the-gnome-version

UI freezes for a short moment while trying to execute multiple commands in a gnome shell extension

為{幸葍}努か 提交于 2020-05-17 06:11:07
问题 Original question: Multiple arguments in Gio.Subprocess So currently I'm trying to execute multiple asynchronous commands in my gnome-shell-extension via Gio.Subprocess. This works fine, if I put all commands as only one chained command with && in the command vector of the Subprocess. The drawback of this solution is, that the output of the different chained commands is only updated once and the execution time may be long. What I'm now trying to do, is to execute every command on its own at

Getting list of contacts with Gnome-Shell JS interface

匆匆过客 提交于 2020-01-23 17:19:28
问题 I've just started fiddling with writing gnome-shell extensions, and would like to know how to get a list of contacts a user has. I've tracked down some likely files: gnome-shell/js/ui/contactDisplay.js and gnome-shell/src/shell_contact_system.c . Now I notice in shell_contact_system.c the following function: /** * shell_contact_system_get_all: * @self: A #ShellContactSystem * * Returns: (transfer none): All individuals */ GeeMap * shell_contact_system_get_all (ShellContactSystem *self) {

unpacking GVariant in javascript

我怕爱的太早我们不能终老 提交于 2020-01-06 08:16:17
问题 I have an array stored as a GVariant of type a(ss) in GSettings, that I want to use in a Cinnamon Applet. I can retrieve the value successfully using the following code: let schema = schema_source.lookup(SCHEMA_NAME, false); let settings = new Gio.Settings({ settings_schema: schema }); let my_value = settings.get_value('myvalue'); but I can't unpack it. As far as I can see, I will probably need to unpack it using a GVariantIter structure, but the documentation is limited, and I can't find the

Getting keyboard modifiers state using Gnome libs (GDK) fetches initial state only

佐手、 提交于 2019-12-29 08:06:43
问题 I'm trying to get the current keyboard modifiers state through gnome GDK or GTK library in aim to implement an accessibility gnome shell extension that shows that state. I know how to get thier state using xlib, but there is not full binding for gnome gjs. The code below get only the initial state. It does not update state. /* * compiling: gcc `pkg-config --cflags gdk-3.0` -o gdk_mod gdk_mod.c `pkg-config --libs gdk-3.0` */ #include <gdk/gdk.h> int main (int argc, char **argv) { gdk_init(

Consume a webservice with basic authentication using Soup

好久不见. 提交于 2019-12-25 07:05:54
问题 As part of a gnome-shell extension, I try to consume a webservice using xmlrpc. The webservice expects a basic authentication header. Using Soup, I got the following code (basically a blueprint from the great openweather extension): function load_json_async() { if (_httpSession === undefined) { _httpSession = new Soup.Session(); } else { // abort previous requests. _httpSession.abort(); } let message = Soup.xmlrpc_message_new ( "https://api.sipgate.net/RPC2", "samurai.BalanceGet", new GLib

Gnome Shell Extension Key Binding

假如想象 提交于 2019-12-22 05:26:20
问题 What is the simplest way to (globally) bind a key combination (e.g. <Super>+A ) to a function in a gnome shell extension? Inspecting a couple of extensions, I ran into the following code: global.display.add_keybinding('random-name', new Gio.Settings({schema: 'org.gnome.shell.keybindings'}), Meta.KeyBindingFlags.NONE, function() { /* ... some code */ }); I understand that the key combination is specified by the schema parameter, and that it's possible to create an XML file describing the

Programming a Gnome extension to disable left edge drag gesture to show the app picker

廉价感情. 提交于 2019-12-13 06:12:53
问题 My apologies to all, if this is in the wrong group. We’d like to use Fedora 23 in Kiosk mode, but there is was a recently added left edge swipe feature that was added to Gnome Shell (https://github.com/GNOME/gnome-shell)that cannot be disabled easily. https://github.com/GNOME/gnome-shell/commit/9c4ffc4bf353fe9c64368f3e194e38b0e8f61311 As far as I can tell, our options are: 1) Write an extension to fix this — My favorite We spoke to the original author, who recommended removing the gesture via

How do I get the monitor of an active window in GNOME?

跟風遠走 提交于 2019-12-11 17:10:57
问题 I am very new to GNOME extension development, and I am having a hard time working with it, due to a profound lack of documentation (or maybe my Internet is clandestinely censored) of the API. I started by modifying an existing extension, so that it is easier to make my way around it. The issue is, I can obtain the active window using global.display.focus_window , and also a list of monitors connected to the computer using Main.layoutManager.monitors . Now, what I would like to do, is find out