个人工具

“UbuntuHelp:Devilspie”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的7个中间版本)
第2行: 第2行:
 
{{Languages|UbuntuHelp:Devilspie}}
 
{{Languages|UbuntuHelp:Devilspie}}
 
=== What is devilspie? ===
 
=== What is devilspie? ===
devilspie is a non-gui utility that lets you make applications start in specified workplaces, in specified sizes and placements, minimized or maximized and much more based on simple config files. The homepage can be found [http://www.burtonini.com/blog/computers/devilspie here]  
+
devilspie is a <code><nowiki>non-gui</nowiki></code> utility that lets you make applications start in specified workplaces, in specified sizes and placements, minimized or maximized and much more based on simple config files. The homepage can be found [http://www.burtonini.com/blog/computers/devilspie here]
 +
=== The gui ===
 +
A simple fully capable gui has been written, [http://code.google.com/p/gdevilspie/ gdevilspie], by a different author. If you install it you will likely not need this page as it is pretty self-explanatory.
 
=== How can I get it? ===
 
=== How can I get it? ===
 
[[UbuntuHelp:InstallingSoftware|Install]] the '''devilspie''' package from the [[UbuntuHelp:Repositories|Universe]] repository.
 
[[UbuntuHelp:InstallingSoftware|Install]] the '''devilspie''' package from the [[UbuntuHelp:Repositories|Universe]] repository.
第9行: 第11行:
 
* Syntax is not difficult and is much more effective than it was in versions previous to 0.13, which used .xml files.
 
* Syntax is not difficult and is much more effective than it was in versions previous to 0.13, which used .xml files.
 
* For details, see:
 
* For details, see:
** README, which should be placed in the directory where you unpacked the source (see above)
+
* README, which should be placed in the directory where you unpacked the source (see above)
*** Forum [http://www.ubuntuforums.org/showthread.php?t=98071 thread] with list of logical operations and many examples
+
* Forum [http://www.ubuntuforums.org/showthread.php?t=98071 thread] with list of logical operations and many examples
**** Another forum [http://ubuntuforums.org/showthread.php?t=75749 thread] which is mainly about the 0.10 version but begins with great [[UbuntuHelp:HowTo|HowTo]] which also includes some very useful stuff about later versions.
+
* Another forum [http://ubuntuforums.org/showthread.php?t=75749 thread] which is mainly about the 0.10 version but begins with great [[UbuntuHelp:HowTo|HowTo]] which also includes some very useful stuff about later versions.
***** Great non-Ubuntu wiki [http://wiki.foosel.net/linux/devilspie page] which can be a great reference.
+
* Great non-Ubuntu wiki [http://wiki.foosel.net/linux/devilspie page] which can be a great reference.
***** [http://x2.zuavra.net/index.php/48/ Tutorial] which can provide you with some deeper understanding of the principles of Devil's Pie.
+
* [http://x2.zuavra.net/index.php/48/ Tutorial] which can provide you with some deeper understanding of the principles of Devil's Pie.
 
=== How do I use it? ===
 
=== How do I use it? ===
 
* You can start Devil's pie with
 
* You can start Devil's pie with
<pre><nowiki>devilspie
+
<pre><nowiki>
 +
devilspie
 
</nowiki></pre>
 
</nowiki></pre>
 
in gnome-terminal.
 
in gnome-terminal.
* It will read all the s-expressions stored in these two directories:  
+
* It will read all the s-expressions stored in these two directories:
** $HOME/.devilspie/ which should be /home/<YourUserName>/.devilspie on Ubuntu
+
* $HOME/.devilspie/ which should be /home/<YourUserName>/.devilspie/ on Ubuntu
*** $SYSCONFDIR/devilspie which should be /etc/devilspie on Ubuntu
+
* $SYSCONFDIR/devilspie/ which should be /etc/devilspie/ on Ubuntu
The former will apply just when you start devilspie, the latter will apply to all users.  
+
The former will apply just when you start devilspie, the latter will apply to all users.
 
* You can use several options:
 
* You can use several options:
**  <code><nowiki>-d</nowiki></code> or <code><nowiki>--debug</nowiki></code> for debuging purposes, when run in terminal, it will print some useful information.
+
*  <code><nowiki>-d</nowiki></code> or <code><nowiki>--debug</nowiki></code> for debuging purposes, when run in terminal, it will print some useful information.
 
'''Note:''' this is the same as running Devil's Pie with an s-expression like this: (debug)
 
'''Note:''' this is the same as running Devil's Pie with an s-expression like this: (debug)
 
* <code><nowiki>-a</nowiki></code> or <code><nowiki>--apply-to-existing</nowiki></code> should apply devilspie also to existing windows. However, it seems that it applies regardless this option.
 
* <code><nowiki>-a</nowiki></code> or <code><nowiki>--apply-to-existing</nowiki></code> should apply devilspie also to existing windows. However, it seems that it applies regardless this option.
第46行: 第49行:
 
</nowiki></pre>
 
</nowiki></pre>
 
==== pidgin.ds ====
 
==== pidgin.ds ====
Buddy list and conversation window are undecorated (no titles or borders), moved and resized. Buddy list is also removed from task list (so it won't show up in Window list).  
+
Buddy list and conversation window are undecorated (no titles or borders), moved and resized. Buddy list is also removed from task list (so it won't show up in Window list).
 
Note: Even with 'undecorate' the conversation window seems to have a some border, this is the reason for some additional pixels there...
 
Note: Even with 'undecorate' the conversation window seems to have a some border, this is the reason for some additional pixels there...
<pre><nowiki>(if (is (application_name) "Pidgin")  
+
<pre><nowiki>
 +
(if (is (application_name) "Pidgin")
 
(begin
 
(begin
 
(if (is (window_role) "buddy_list")
 
(if (is (window_role) "buddy_list")
第75行: 第79行:
 
)
 
)
 
)</nowiki></pre>
 
)</nowiki></pre>
 +
=== How can I see what applications are currently running? ===
 +
''xlsclients -l''
 +
<pre><nowiki>
 +
Window 0x4e00001:
 +
  Machine:  sally
 +
  Name:  Pidgin
 +
  Icon Name:  pidgin
 +
  Command:  pidgin
 +
  Instance/Class:  pidgin/Pidgin
 +
</nowiki></pre>
 +
From the above, to match on pidgin requires <code><nowiki>(is (application_name) "Pidgin")</nowiki></code> and not <code><nowiki>(is (application_name) "pidgin")</nowiki></code>
 
=== How can I improve this wiki page? ===
 
=== How can I improve this wiki page? ===
 
Simply add any useful stuff! Especially the section about setting up should be improved so that it more then just linking somewhere else, also some examples would be greatly appreciated. Also feel free to correct anything wrong.
 
Simply add any useful stuff! Especially the section about setting up should be improved so that it more then just linking somewhere else, also some examples would be greatly appreciated. Also feel free to correct anything wrong.
* I am not sure if devilspie reads files stored in /etc/devilspie/. It seems so, because other people say so, but when I checked, it did not work for me. Could someone please check it, correct it and then delete this note?
 
 
----
 
----
[[category:CategoryDocumentation]]
+
[[category:CategorySoftware]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 22:01的最新版本

What is devilspie?

devilspie is a non-gui utility that lets you make applications start in specified workplaces, in specified sizes and placements, minimized or maximized and much more based on simple config files. The homepage can be found here

The gui

A simple fully capable gui has been written, gdevilspie, by a different author. If you install it you will likely not need this page as it is pretty self-explanatory.

How can I get it?

Install the devilspie package from the Universe repository.

How do I set it up?

  • devilspie is configured with s-expressions stored in files ending with ".ds".
  • Syntax is not difficult and is much more effective than it was in versions previous to 0.13, which used .xml files.
  • For details, see:
  • README, which should be placed in the directory where you unpacked the source (see above)
  • Forum thread with list of logical operations and many examples
  • Another forum thread which is mainly about the 0.10 version but begins with great HowTo which also includes some very useful stuff about later versions.
  • Great non-Ubuntu wiki page which can be a great reference.
  • Tutorial which can provide you with some deeper understanding of the principles of Devil's Pie.

How do I use it?

  • You can start Devil's pie with
devilspie

in gnome-terminal.

  • It will read all the s-expressions stored in these two directories:
  • $HOME/.devilspie/ which should be /home/<YourUserName>/.devilspie/ on Ubuntu
  • $SYSCONFDIR/devilspie/ which should be /etc/devilspie/ on Ubuntu

The former will apply just when you start devilspie, the latter will apply to all users.

  • You can use several options:
  • -d or --debug for debuging purposes, when run in terminal, it will print some useful information.

Note: this is the same as running Devil's Pie with an s-expression like this: (debug)

  • -a or --apply-to-existing should apply devilspie also to existing windows. However, it seems that it applies regardless this option.
  • devilspie <file.ds> or devilspie <file1.ds> <file2.ds> etc will explicitly specify which config files should be used.
  • After setting it up, you will probably want to run it on start up, so that every window you open will open the way you want it to. For further info as to how to do that, read AddingProgramToSessionStartup
  • If you were to experience freezes down after adding devilspie to your startup programs with a low number (such as 30 or 50), try to higher it up so that devilspie starts as the last application. You may want to start it with -a option that applies the rules to already existing windows then. However, it may not be necessary.

Examples

Background for this setup: A dual-screen workspace where the smaller (laptop) screen is used solely for "communications" (IRC and IM windows). The goal is to get three windows (xchat, Pidgin buddy list and Pidgin chat window) into pre-set locations wasting as little screen estate as possible.

+--------+------------------------+
| Pidgin |                        |
| Buddy  |        Pidgin          |
| List   |     Conversation       |
|        |                        |
|        +------------------------+
|        |                        |
|        |        Xchat           |
|        |                        |
|        |                        |
+--------+------------------------+

pidgin.ds

Buddy list and conversation window are undecorated (no titles or borders), moved and resized. Buddy list is also removed from task list (so it won't show up in Window list). Note: Even with 'undecorate' the conversation window seems to have a some border, this is the reason for some additional pixels there...

(if (is (application_name) "Pidgin")
	(begin
		(if (is (window_role) "buddy_list")
			(begin
				(undecorate)
				(skip_tasklist)
				(geometry "199x767+0+0")
			)
		)
		(if (is (window_role) "conversation")
			(begin
				(undecorate)
				(geometry "822x400+201+0")
			)
		)
	)
)

xchat.ds

Xchat is undecorated (no titles or borders), moved and resized. Xchat main window does not have a window_role defined, but fortunately the other windows (like Preferences or Network List) do, so the empty match seems to work.

(and (is (application_name) "xchat")
     (is (window_role) "")
	(begin
		(undecorate)
		(geometry "823x363+200+404")
	)
)

How can I see what applications are currently running?

xlsclients -l

Window 0x4e00001:
  Machine:  sally
  Name:  Pidgin
  Icon Name:  pidgin
  Command:  pidgin
  Instance/Class:  pidgin/Pidgin

From the above, to match on pidgin requires (is (application_name) "Pidgin") and not (is (application_name) "pidgin")

How can I improve this wiki page?

Simply add any useful stuff! Especially the section about setting up should be improved so that it more then just linking somewhere else, also some examples would be greatly appreciated. Also feel free to correct anything wrong.