这个问题与前一个问题的连续性有关:如何使emacs控制台模式继承shell颜色
在Ubuntu 12.10和Gnome Shell 3.6.2上,我正在运行Emacs.关于http://www.emacswiki.org/emacs/TransparentEmacs我可以使用以下方法在我的Emacs X窗口上设置alpha透明度:
(set-frame-parameter (selected-frame) 'alpha '(85 50))
(add-to-list 'default-frame-alist '(alpha 85 50))
Run Code Online (Sandbox Code Playgroud)
不幸的是,这为我的emacs窗口中的所有"项目"设置了透明度,包括包含文本的前景.因此,很难阅读Emacs内容.我正在寻找的只是在背景上设置alpha值的方法.通过这种方式,我将能够清楚地看到我的Emacs窗口的内容,并从emacs后面的窗口中读取信息(我用非常好的gnome终端成功地做到了这一点).
我编写了一个简单的shell脚本来完成一项常见任务,我希望能够在单击按钮时运行它.我已经使用gnome-shell-extension-tool创建了Hello World示例,但现在我需要知道如何在单击时让它运行任意命令.没有输入或输出需要关注; 它只需要运行.
我需要你的帮助:我正在研究一个小的Java应用程序(Java版本7),它必须最小化到系统托盘中.
我正在使用Class SystemTray,使用SystemTray.isSupported(),然后
SystemTray systemTray = SystemTray.getSystemTray();
ImageIcon icon = new javax.swing.ImageIcon(getClass().getResource("icon.png"));
Run Code Online (Sandbox Code Playgroud)
[...]
systemTray.add(trayIcon);
Run Code Online (Sandbox Code Playgroud)
(当然有弹出窗口)
在Windows上,它运行良好.在XFCE,Xubuntu,没问题,图标正在使用弹出窗口.但是在KDE和Gnome shell上......它不起作用.
(Qt:4.8.6工具等离子:4.11.12)
SystemTray.isSupported()= true,当程序到达该行时:systemTray.add(trayIcon); 捕获异常:
托盘进程中出错:java.awt.AWTException:无法显示TrayIcon.
因此,图标是白色的,当用户点击它时不起作用,没有弹出窗口.
SystemTray.isSupported()= true,图标位于底部的通知区域,但鼠标事件不起作用...
为了解决这些问题,我认为SWT可能是一个好主意.但是当我实现它(上一个版本)时,我收到了这个警告:
警告**:无法连接到辅助功能总线:无法连接到socket/tmp/[...]
它不起作用......编辑:不再了,我可以用外部类修复SWT的问题.警告不是由SWT引起的,而是环境系统引起的(我和终端中的其他应用程序有相同的警告).
那么现在,我该怎么办?我想用&检查环境系统,然后启用或禁用系统托盘,如果它是KDE或Gnome 3 ...但是这个解决方案不是很好,因为它是多平台的本地解决方案(在操作系统的功能中我的意思),而不是全局解决方案(适用于所有操作系统的一种方法)......System.getenv("XDG_CURRENT_DESKTOP")System.getenv("GDMSESSION")
那么,其他想法呢?我不知道......有没有办法将嵌入式JWindow定义到系统托盘中?
我正在尝试使用gjs为gnome-shell创建简单的gtk应用程序.
它的窗口只包含Gtk.TextView,我想在用户输入时处理事件.
这是我的代码:
#!/usr/bin/gjs
var Gtk = imports.gi.Gtk;
function MainWindow () {
this._init ();
}
MainWindow.prototype = {
_init: function () {
this.window = new Gtk.Window ({
title: "Just Calculator",
window_position: Gtk.WindowPosition.CENTER,
default_height: 400,
default_width: 440,
});
//this.window.show ();
this.window.connect ("hide", Gtk.main_quit);
this.window.connect ("delete-event", function () {
Gtk.main_quit();
return true;
});
this.textbox = new Gtk.TextView();
this.textbox.connect('key-press-event', this._keyPress);
var sw = new Gtk.ScrolledWindow ({shadow_type:Gtk.ShadowType.IN});
sw.add (this.textbox);
this.window.add(sw);
this.window.show_all();
},
_keyPress: function(textview, event) {
print(event, event.type, event.keyval);
textview.buffer.text = 'ok';
return true; …Run Code Online (Sandbox Code Playgroud) (全局)将键组合(例如<Super>+A)绑定到gnome shell扩展中的函数的最简单方法是什么?
检查了几个扩展,我遇到了以下代码:
global.display.add_keybinding('random-name',
new Gio.Settings({schema: 'org.gnome.shell.keybindings'}),
Meta.KeyBindingFlags.NONE,
function() { /* ... some code */ });
Run Code Online (Sandbox Code Playgroud)
我知道组合键是由schema参数指定的,并且可以创建描述组合的XML文件.有更简单的方法吗?
linux hotkeys key-bindings gnome-shell gnome-shell-extensions
Gnome Shell 有很好的快捷方式,但是,我没有找到以编程方式调用它们的方法 假设我想使用 GJS 脚本启动 Google Chrome,将其移至工作区 1,并最大化它,然后启动 Emacs,将其移至工作区 2,并将其最大化。这可以使用 wm.keybindings 来完成:move-to-workspace-1、move-to-workspace-2 和最大化。但是,如何以编程方式调用它们?
我注意到在 GJS 中,Meta.prefs_get_keybinding_action('move-to-workspace-1')将返回动作 move-to-workspace-1 的提示,但我没有找到任何调用该动作的函数。在https://github.com/GNOME/mutter/blob/master/src/core/keybindings.c 中,我找到了一个函数 meta_display_accelerator_activate,但是我找不到这个函数的 GJS 绑定。
那么,有没有办法以编程方式调用 gnome shell 快捷方式?
假设我正在使用intel的驱动程序.
Gnome-shell允许在使用Xorg时在设置 - >显示中旋转屏幕.
使用Wayland时是否可以旋转?
如何让Popover出现在应用程序窗口之外,如 gnome-shell 面板中的菜单?还是我应该使用另一个 GTK 小部件?
gnome-shell ×10
gnome-3 ×3
gjs ×2
gnome ×2
linux ×2
ubuntu ×2
emacs ×1
gtk ×1
gtk3 ×1
hotkeys ×1
java ×1
javascript ×1
kde ×1
key-bindings ×1
lockscreen ×1
menu ×1
popover ×1
system-tray ×1
transparency ×1
ubuntu-18.04 ×1
wayland ×1