gnome-3

How to set application title in Gnome Shell?

别说谁变了你拦得住时间么 提交于 2020-01-11 01:49:05
问题 I am new to Gtk+ development, and am trying to write an app using PyGObject and Gtk+3.0. When I run my app in Gnome Shell from the command line, however, the application name as it appears in the upper-left hand corner (immediately to the right of the Activities hot corner) is just set to the name of the Python source file that I ran to start the app. Is there any way to set the name to appear in Gnome Shell for my application? I've looked at Gtk.Application, and though it seems to do some of

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

Properly structure and highlight a GtkPopoverMenu using PyGObject

限于喜欢 提交于 2020-01-04 15:26:35
问题 I am trying to make an example of a proper Gtk.HeaderBar with Gtk.PopoverMenus that shows how the different widgets are used. I looked at a lot of examples and code, but can't figure out, how to work the Gtk.ModelButton . Especially this sentence makes no sense to me: When the action is specified via the “action-name” and “action-target” properties, the role of the button (i.e. whether it is a plain, check or radio button) is determined by the type of the action and doesn't have to be

How do I get the active window on Gnome Wayland?

你。 提交于 2019-12-20 09:28:43
问题 Background: I'm working on a piece of software called ActivityWatch that logs what you do on your computer. Basically an attempt at addressing some of the issues with: RescueTime, selfspy, arbtt, etc. One of the core things we do is log information about the active window (class and title). In the past, this has been done using on Linux using xprop and now python-xlib without issue. But now we have a problem: Wayland is on the rise, and as far as I can see Wayland has no notion of an active

GTK+ 3.0 and GNOME 3 Programming! Any Blog or Book or Tutorial? [closed]

帅比萌擦擦* 提交于 2019-12-18 10:28:11
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am new to gtk and gnome programming and like to study GTK+ 3.0 and Gnome 3 programming. Since both of these are recent APIs, I can't find a good tutorial or blog post about these topics. The books I found on GTK+ or GNOME programming are very old ones. So I decided to start with the latest gtk tutorial at http

how to save Drawing area's content after resizing window at cairo

此生再无相见时 提交于 2019-12-13 04:53:22
问题 how can I change the below code so the contents and drawings at the Drawing-area won't clean after changing window's size. I want to copy smaller surface content to top left corner of the bigger content and for copying bigger surface to smaller surface there should be some data loss code is from gtk+-3.0 reference manual #include <gtk/gtk.h> /* Surface to store current scribbles */ static cairo_surface_t *surface = NULL; static void clear_surface (void) { cairo_t *cr; cr = cairo_create

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

org.gnome.SessionManager in Ubuntu 12.04 chroot

℡╲_俬逩灬. 提交于 2019-12-11 03:26:05
问题 I'm trying to test totem in a minimal chroot (host and chroot both ubuntu 12.04 amd64). When I load a video, I get the error ** (totem:25660): WARNING **: Problem inhibiting the screensaver: GDBus.Error: org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist Indeed, the screen will turn off (session idle) while watching a video. To confirm, I tested with python: >>> import dbus >>> bus = dbus.SessionBus() >>> bus.get_object('org.gnome.SessionManager','/org

Gnome shell extensions: how to run a command with pipes

回眸只為那壹抹淺笑 提交于 2019-12-07 05:15:26
问题 So I'm making a Gnome Shell extension. And I want to be able to run some command with a pipe. (The command is actually "xrandr --query | awk 'something'" , but that is off topic) So, what I have done so far is GLib.spawn_async_with_pipes(null, ['/usr/bin/xrandr', '--query', '|', 'awk...'], null, GLib.SpawnFlags.DO_NOT_REAP_CHILD, null); But it doesn't work! I can't find any example of running a command in a gnome extensions with a pipe. Do I have to write "|" in the command like I did ? 回答1:

Change directory and execute file in one command

狂风中的少年 提交于 2019-12-05 12:32:27
问题 When I want to execute a file, it seems that I always have to first 'cd' into that file's directory before executing it, unless it fails on a can't-find-my-dataz type error. How can I get around typing two commands to just execute a program? Example: cd /usr/local/bin/minecraft/ java -Xms512M -Xmx2048M -jar minecraft.jar How can I make that into one line, so as I can put it as my Exec= _ line when creating a custom launcher in Gnome3? 回答1: cd /usr/local/bin/minecraft/ && java -Xms512M