0

For fun I'm attempting to write a light clone of autohotkey for gnome. All i really want it to be able to do is:

  • move/maximize/minimize existing application windows
  • launch gui applications(firefox, gedit, etc)
  • change the system audio volume
  • run from system tray

I have no idea really where to get started. Finding up to date information on gnome dev is pretty hard in and of itself and most of what I found is for building simple gui applications. I haven't been able to find anything about how to get a list of active applications and manipulate their windows and whatnot. Can anyone point me in the direction at least of what tools would be good for this sort of thing? I'm on ubuntu and have been messing around in ajunta/glade and ruby-gnome2. A ruby library for this sort of thing would be perfect.

4

3 回答 3

1

I am thinking a reasonable solution would be to write in js to make a gnome3 shell extension - it's quite likely one the best approaches ...I am going to give it a try

于 2012-06-10T05:31:28.417 回答
1

我还没有找到任何关于如何获取活动应用程序列表和操作它们的窗口之类的东西

你看过GnomeLove吗?

于 2011-01-20T20:39:16.890 回答
0

我还没有找到任何关于如何获取活动应用程序列表和操作它们的窗口等等的信息。

您需要sudo apt-get installwmctrl(用于获取活动窗口列表,而不是应用程序)和xdotool(用于操作从中获得的窗口 ID wmctrl)。

要获取窗口标题可以由正则表达式“FOO”唯一匹配的应用程序的窗口 ID:

wmctrl -l | grep "FOO"

要仅获取该窗口的窗口 ID(使用该cut命令仅检索第一列):

wmctrl -l | grep "FOO" | cut -d' ' -f1

要执行上述所有操作,然后将找到的窗口 ID 分配给变量:

BAR=$( wmctrl -l | grep "FOO" | cut -d' ' -f1 )

(例如)最小化现在由存储在BAR变量中的 ID 标识的窗口:

xdotool windowminimize $BAR

玩得开心!

PS:这是我编写的将上述步骤捆绑在一起的shell 脚本的要点。

于 2020-01-28T17:03:29.010 回答